This application demonstrates how to use Twilio and TwiML to perform automated phone surveys.
This project is built using the Ruby on Rails web framework.
-
First clone this repository and
cd
into it.$ git clone [email protected]:TwilioDevEd/automated-survey-rails.git $ cd automated-survey-rails
-
Install the dependencies.
$ bundle install
-
Create the database and run migrations.
Make sure you have installed PostgreSQL. If on a Mac, I recommend Postgres.app.
$ bundle exec rake db:setup
-
Make sure the tests succeed.
$ bundle exec rspec
-
Run the server
$ bundle exec rails s
-
Expose your application to the wider internet using ngrok. You can click here for more details. This step is important because the application won't work as expected if you run it through localhost.
$ ngrok http 3000
Once ngrok is running, open up your browser and go to your ngrok URL. It will
look something like this: http://9a159ccf.ngrok.io
- Configure Twilio to call your webhooks
You will also need to configure Twilio to call your application when calls or messages are received on your Twilio Phone Number.
The Voice Request URL should look something like this:
http://<sub-domain>.ngrok.io/surveys/voice
The SMS & MMS Request URL should look something like this:
http://<sub-domain>.ngrok.io/surveys/sms
That's it!
Voice Surveys. Call your Twilio phone number and follow the instructions.
Voice Surveys. Text your Twilio phone number with any text and follow the instructions.
- No warranty expressed or implied. Software is as is. Diggity.
- MIT License
- Lovingly crafted by Twilio Developer Education.