Skip to content

Instantly share code, notes, and snippets.

@RobSpectre
Created July 9, 2013 22:19
Show Gist options
  • Save RobSpectre/5961823 to your computer and use it in GitHub Desktop.
Save RobSpectre/5961823 to your computer and use it in GitHub Desktop.
Flask app creating a Twilio Conference room.
# Import our dependencies
from flask import Flask
from twilio import twiml
# Instantiate our Flask app
app = Flask(__name__)
# Create an endpoint '/conference' to serve as our
# Voice Request URL
@app.route('/conference', methods=['POST'])
def voice():
# Use the Twilio Python Module's TwiML generator to
# create a response
response = twiml.Response()
# Have that response dial into a conference room we call
# "Today's Headlines"
with response.dial() as dial:
dial.conference("Today's Headlines")
return str(response)
# Add a little boilerplate to run our Flask app.
if __name__ == '__main__':
port = os.environ.get(5000)
if port == 5000:
app.debug = True
app.run(host='0.0.0.0', port=port)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment