Hey sports fans, welcome to my latest Node.js experiment. Check out the hosted version of the Twilio Fantasy Football Draft Room.
- Node.js Express - Express 3.0 app configured to use Hogan.js templating
- Twilio Client - Twilio Client lets us easily spin-up conference rooms. Uses the twilio-client-token NPM module to generate the capability tokens.
- Twilio Security - Uses the twiliosig NPM module to validate that TwiML requests are coming from Twilio.
- Redis Storage - conference rooms codes are stored using Redis
This app contains a single endpoint /voice
for Twilio to use in setting-up your conference room. The TwiML is defined in views\voice.hjs
and is currently configured to support conference calls with a max of 14 participants and a max duration of 3 hours. You can easily edit this to your liking:
<Response>
{{^digits}}
<Say>Welcome to the Fantasy Football Draft Room</Say>
<Pause length="1"/>
<Say>Brought to you by Twilio</Say>
<Pause length="1"/>
{{/digits}}
{{#id}}
<Say>Connecting you to your conference now</Say>
<Dial timeLimit="10800">
<Conference maxParticipants="14" waitUrl="http://twimlets.com/holdmusic?Bucket=com.twilio.music.rock">{{id}}</Conference>
</Dial>
{{/id}}
{{^id}}
<Gather method="get" numDigits="4">
<Say>Please enter your 4 digit code now</Say>
</Gather>
{{/id}}
</Response>
Step-by-step instructions on getting this up and running:
-
Create free accounts on Twilio, Nodejitsu and RedisToGo if you don't already have them. Nodejitsu and RedisToGo are optional, feel free to swap-in similar services.
-
Create a new Twilio TwiML application (note the Application ID)
-
Grab the latest source
git clone https://github.com/crabasa/ff-draft-app.git
- Create your own config.js file
mv config.sample.js config.js
-
Edit config.js and configure your Twilio & Redis credentials
-
Edit package.json and set your own values for
subdomain
anddomains
-
Deploy to Nodejitsu
jitsu deploy
-
Point your TwiML application's voiceURL at http://yoursubdomain.jit.su/voice
-
Done!
- No warranty expressed or implied. Software is as is.
- MIT License
- Built by Twilio Seattle.