Created
October 5, 2016 17:21
-
-
Save meganspeir/309650dcf768f11701ee018ecb2cf401 to your computer and use it in GitHub Desktop.
This gist calls two numbers from a given Twilio number and then connects the callers to a conference.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask | |
from twilio.rest import TwilioRestClient | |
from twilio import twiml | |
app = Flask(__name__) | |
client = TwilioRestClient(SID, token) | |
client.calls.create(to="FIRST_PHONE_NUMBER", from_="YOUR_TWILIO_NUMBER", url='http://URL/conference') | |
client.calls.create(to="SECOND_PHONE_NUMBER", from_="YOUR_TWILIO_NUMBER", url='http://URL/conference') | |
@app.route('/conference', methods=['GET', 'POST']) | |
def conference_call(): | |
res = twiml.Response() | |
with res.dial() as dial: | |
dial.conference("My Conf") | |
return res.toxml() | |
if __name__ == "__main__": | |
app.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment