How is the Twilio 'ConferenceSid' generated?

こ雲淡風輕ζ 提交于 2019-12-11 10:16:26

问题


Here is the code from 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

I am trying to create conference call instance. I have everything working except for the conference call instance. Ideally I would like for hosts to enter a pin and listeners to join the conference by pressing a digit. But right now, I am trying to create a conference instance. I do not under stand from the above docs, how do I create the 34-key conference sid? I am assuming this is automatically generated? How could I store this value?

@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}

回答1:


As per Twilio's documentation, it seems like you're not really supposed to return the conference's SID to create one.

You're supposed to provide a conference name instead:

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

The SID may be useful later on if you also need to call the API. If you actually need it, you should be able to get a list of conferences.



来源:https://stackoverflow.com/questions/27463301/how-is-the-twilio-conferencesid-generated

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!