Learn how to use Twilio to forward a series of phone calls to your state senators.
This project is built using the Sinatra web framework.
To run the app locally, follow these steps:
-
Clone this repository and
cd
into it.git clone [email protected]:TwilioDevEd/call-forwarding-sinatra.git cd call-forwarding-sinatra
-
Install the dependencies:
bundle install
-
Create application database: Make sure you have installed PostgreSQL. If on a Mac, I recommend Postgres.app. Given that, we'll use a rake task to generate the database used by the app. You just need to provide a valid user with permission to create databases.
bundle exec rake db:create[db_user_name] db:seed
Find more information on how Rake tasks are created and executed.
-
Expose your application to the internet using ngrok. In a separate terminal session, start ngrok with:
ngrok http 9292
Once you have started ngrok, update your TwiML application's voice URL setting to use your ngrok hostname. It will look something like this in your Twilio console:
https://d06f533b.ngrok.io/callcongress/welcome
-
Start your development server:
bundle exec rackup
Once ngrok is running, open up your browser and go to your ngrok URL.
bundle exec rake spec
- No warranty expressed or implied. Software is as is. Diggity.
- MIT License
- Lovingly crafted by Twilio Developer Education.