1

这是来自 Twilio Docs - Python 的代码

# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient
# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "AC0edc1a7f12e0e0876ce878e903d3bd54"
auth_token = "{{ auth_token }}"
client = TwilioRestClient(account_sid, auth_token)
conference = client.conferences.get("CFbbe46ff1274e283f7e3ac1df0072ab39")
print conference.status

我正在尝试创建电话会议实例。除了电话会议实例外,我一切正常。理想情况下,我希望主持人输入密码,听众通过按数字加入会议。但是现在,我正在尝试创建一个会议实例。我不了解上述文档,如何创建 34 键会议 sid?我假设这是自动生成的?我怎么能存储这个值?

@app.route('/caller', methods=['GET','POST']) #'GET'
def caller():
    response = twiml.Response()
    response.say("Welcome to the conference call.")
    response.pause(length = "1")
    response.say ("Please hold.")
    conference()

    return str(response)

def conference():
    client = TwilioRestClient(settings.api_key, settings.api_tok)
    conference = client.conferences.get(ConferenceSid)
    #print /2010-04-01/Accounts/settings.api_key/Conferences/{ConferenceSid}
4

1 回答 1

3

根据Twilio 的文档,您似乎不应该返回会议的 SID 来创建一个。

您应该提供一个会议名称:

<Response>
  <Dial>
    <Conference>Room 1234</Conference>
  </Dial>
</Response>

如果您以后还需要调用 API,SID 可能会很有用。如果您确实需要它,您应该能够获得会议列表。

于 2014-12-13T20:51:18.127 回答