Rails application to:
- point a Twilio phone and play FizzBuzz; production env validates the X-Twilio-Signature header.
- interface to enter a phone number (Twilio), gather a number and play FizzBuzz
- interface delay + step 2
built on ruby 2.2; rails 4.2
Running the app:
Pre-requirements:
- ngrok - to deploy on the internet; https://ngrok.com/
- redis-server; sudo apt-get install redis-server
commands are:
- bundle install
- rails s
- redis-server (in a separate terminal)
- bundle exec sidekiq (in a separate terminal)
- ./ngrok http 3000 ( in a separate terminal)
now that the webapp is hosted publically, we can use the url at Twilio we configure the app now.
config.application.rb holds:
- Twilio number (config.twilio_number)
- host_url (config.host_url); same to be used in the Twilio account for calls. this the ngrok hosted url.
- twilio account sid, auth token are in config/secrets.yml
url for phase 1 is hostname:port/ivr/welcome url for phase 2 and 3 is the default page.
After filling in the config parameter, we run the app in production mode:
rails s -e production