This application is an example of hosting conference calls with Twilio in a Ruby on Rails application.
There are three types of conference call available and blog posts to describe how to build and run them.
- An open conference line
- A passcode protected conference line
- A one-time passcode protected conference line with Twilio Verify
The path you use when setting your phone number's webhook will define which type of conference you are using.
Make sure you have the following:
- Ruby and Bundler installed
- A Twilio account (sign up for a free account here)
- A Twilio phone number that can receive incoming calls
- ngrok for testing webhooks with our local application
Clone or download the repo:
git clone https://github.com/philnash/conference-calls-on-rails.git
cd conference-calls-on-rails
Install the dependencies:
bundle install
Copy the config/env.yml.example
to config/env.yml
and fill in the details:
Environment variable | Meaning |
---|---|
CONFERENCE_PIN |
A static passcode to protect conference calls using the ProtectedCallsController |
TWILIO_ACCOUNT_SID |
Your Account Sid from the Twilio console |
TWILIO_AUTH_TOKEN |
Your Auth Token from the Twilio console |
VERIFY_SERVICE_SID |
A Verify Service Sid, create the service in your Twilio console |
PERMITTED_CALLERS |
A comma separated list of e.164 formatted phone numbers that are permitted to join a conference call using the VerifiedCallsController |
MODERATOR |
An e.164 formatted phone number that is allowed to moderate conference calls using the VerifiedCallsController |
Start the application:
bundle exec rails server
Start ngrok exposing port 3000:
ngrok http 3000
Take the ngrok URL, add the required path:
/calls
for an open conference line/protected_calls/welcome
for a passcode protected conference line/verified_calls/welcome
for a one-time passcode verified conference line
Then open the edit page for your Twilio phone number and enter it in the field marked "When a call comes in". The full URL should look like: https://YOUR_NGROK_SUBDOMAIN.ngrok.io/PATH
. Save the number.
Place a phone call to your Twilio number.
MIT © Phil Nash 2020