G5 / call-tracking-rails

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Call Tracking on Rails

Build Status

Use Twilio to track the effectiveness of your different marketing campaigns. Learn how call tracking helps organizations in these Twilio customer stories.

Quickstart

Create a TwiML App

This project is configured to use a TwiML App, which allows us to easily set the voice URLs for all Twilio phone numbers we purchase in this app.

Create a new TwiML app at https://www.twilio.com/user/account/apps/add and use its Sid as the TWIML_APPLICATION_SID environment variable wherever you run this app.

Creating a TwiML App

You can learn more about TwiML apps here: https://www.twilio.com/help/faq/twilio-client/how-do-i-create-a-twiml-app

Local development

This project is built using the Ruby on Rails web framework. It runs on Ruby 2.2.3.

  1. First clone this repository and cd into its directory:

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

    bundle
    
  3. Export the environment variables: You can find the AccountSID and the AuthToken at https://www.twilio.com/user/account/settings.

    export TWILIO_ACCOUNT_SID=your account sid
    export TWILIO_AUTH_TOKEN=your auth token
    

    Also export the SID for the TwiML App you created above:

    export TWIML_APPLICATION_SID=your twiml app sid
    
  4. Create database and run migrations:

Make sure you have installed PostgreSQL.

rake db:setup
  1. Make sure the tests succeed:

    rspec
    
  2. Run the server:

    rails server
    
  3. Check it out at http://localhost:3000

  4. Test the API

    curl -v --data "Cid=EE009a79-1a05-49d7-b876-2b884d0f825b&ClientUrn=g5-c-icewl2o8-nolan-real-estate-client&LocationUrn=g5-cl-53g6uec0q-twin-creek" http://localhost:3000/lease
    

About


Languages

Language:JavaScript 67.7%Language:Ruby 26.5%Language:HTML 5.7%Language:CSS 0.1%