Skip to content

TwilioDevEd/anonymous-communications-rails

Repository files navigation

Twilio

Airtng App: Part 2 - Anonymous Calling and SMS with Twilio

Protect your customers' privacy, and create a seamless interaction by provisioning Twilio numbers on the fly, and routing all voice calls, and messages through your very own 3rd party. This allows you to control the interaction between your customers, while putting your customer's privacy first.

Read the full tutorial here!

Local Development

This project is built using Ruby on Rails Framework.

  1. First clone this repository and cd into it.

    $ git clone [email protected]:TwilioDevEd/anonymous-communications-rails.git
    $ cd anonymous-communications-rails
  2. Install the dependencies.

    $ bundle install
  3. Expose your application to the wider internet using ngrok. This step is important because the application won't work as expected if you run it through localhost.

    $ ngrok http 3000

    Your ngrok URL should look something like this: http://9a159ccf.ngrok.io

    You can read this blog post for more details on how to use ngrok.

  4. Configure Twilio App to call your webhooks.

    Before you can run this app you need to go into your account portal and create a new Twilio Application. Once you have created an app the urls should look like:

    Voice: https://<ngrok_subdomain>.ngrok.io/reservations/connect_voice

    SMS & MMS: https://<ngrok_subdomain>.ngrok.io/reservations/connect_sms

  5. Copy the sample configuration file and edit it to match your configuration.

    $ cp .env.example .env

    You can find your TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN in your Twilio Account Settings. You will also need a TWILIO_NUMBER, which you may find here.

  6. Create database and run migrations. Be sure to have SQLite installed before running this command.

    $ bundle exec rails db:setup
  7. Make sure the tests succeed.

    $ bundle exec rspec
  8. Start the server.

    $ bundle exec rails s

That's it!

Meta

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