Skip to content
This repository has been archived by the owner on Jun 22, 2023. It is now read-only.

TwilioDevEd/call-forwarding-sinatra

Repository files navigation

Twilio

Advanced Call Forwarding with Ruby, Sinatra, and Twilio

Build Status

Learn how to use Twilio to forward a series of phone calls to your state senators.

Local Development

This project is built using the Sinatra web framework.

To run the app locally, follow these steps:

  1. Clone this repository and cd into it.

    git clone git@github.com:TwilioDevEd/call-forwarding-sinatra.git
    cd call-forwarding-sinatra
  2. Install the dependencies:

    bundle install
  3. 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.

  4. 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
    
  5. Start your development server:

    bundle exec rackup

    Once ngrok is running, open up your browser and go to your ngrok URL.

Run the Tests

bundle exec rake spec

Meta

  • No warranty expressed or implied. Software is as is. Diggity.
  • MIT License
  • Lovingly crafted by Twilio Developer Education.