GithubHelp home page GithubHelp logo

brettsenna / twilio-queue-example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from robspectre/twilio-queue-example

0.0 2.0 0.0 274 KB

A hackpack example using Twilio's new Queue verb.

License: MIT License

Makefile 0.25% Python 84.43% CSS 6.21% HTML 9.10%

twilio-queue-example's Introduction

Twilio Queue Example

A hackpack example using Twilio's new Queue verb to create a call-in queue. Not into Python? Check out examples in other languages in the Twilio Howto.

[Build Status] (http://travis-ci.org/RobSpectre/Twilio-Queue-Example)

Features

Holy biscuits! It's got features!

  • Caller Handling - Take callers and put them in a call queue with TwiML's new Enqueue verb.
  • Agent Handling - Answers callers in the order they dialed in using TwiML's new Queue noun.
  • Automagic Configuration - Just run python configure.py --account_sid ACxxxx --auth_token yyyyy and this hackpack will Twilio and Heroku for you.
  • Plug-and-Play - Procfile, requirements.txt and Makefile make installation and usage a breeze.
  • Testing - Totally tested with examples for you to use in your larger implementations.
  • PEP8 - It's good for you!

Usage

Install using the Getting Started instructions below and configure a pair of Twilio Phone Numbers with the two links provided - one for callers and one for agents.

Success page

Callers are the people who are placed into the Queue, while Agents are the people who answer them. In most implementations, "callers" can be considered customers who need support and "agents" are the service representatives responsible for providing it.

To use this app, purchase two Twilio Phone Numbers and configure one number to use the Caller Voice Request URL and the other to use the Agent Voice Request URL.

For an example in action, be sure to check out Jon Gottfried's screencast.

Installation

Step-by-step on how to deploy, configure and develop on this hackpack.

Getting Started

  1. Get the requirements:
  1. Grab latest source
git clone git://github.com/RobSpectre/Twilio-Queue-Example.git 
  1. Navigate to folder and create new Heroku Cedar app
heroku create
  1. Deploy to Heroku
git push heroku master
  1. Scale your dynos
heroku scale web=1
  1. Visit the home page of your new Heroku app to see your newly configured app!
heroku open

Configuration

Configure your hackpack with three easy options.

Automagic Configuration

This hackpack ships with an auto-configure script that will create a new TwiML app, purchase a new phone number, and set your Heroku app's environment variables to use your new settings. Here's a quick step-by-step:

  1. Make sure you have all dependencies installed
make init
  1. Run configure script and follow instructions.
python configure.py --account_sid ACxxxxxx --auth_token yyyyyyy
  1. For local development, copy/paste the environment variable commands the configurator provides to your shell.
export TWILIO_ACCOUNT_SID=ACxxxxxx
export TWILIO_AUTH_TOKEN=yyyyyyyyy
export TWILIO_APP_SID=APzzzzzzzzzz
export TWILIO_CALLER_ID=+15556667777

Automagic configuration comes with a number of features.
python configure.py --help to see them all.

local_settings.py

local_settings.py is a file available in the hackpack route for you to configure your twilio account credentials manually. Be sure not to expose your Twilio account to a public repo though.

ACCOUNT_SID = "ACxxxxxxxxxxxxx" 
AUTH_TOKEN = "yyyyyyyyyyyyyyyy"
TWILIO_APP_SID = "APzzzzzzzzz"
TWILIO_CALLER_ID = "+17778889999"

Setting Your Own Environment Variables

The configurator will automatically use your environment variables if you already have a TwiML app and phone number you would prefer to use. When these environment variables are present, it will configure the Twilio and Heroku apps all to use the hackpack.

  1. Set environment variables locally.
export TWILIO_ACCOUNT_SID=ACxxxxxxxxxxxxxx
export TWILIO_AUTH_TOKEN=yyyyyyyyyyyyyyyyy
export TWILIO_APP_SID=APzzzzzzzzzzzzzzzzzz
export TWILIO_CALLER_ID=+15556667777
  1. Run configurator
python configure.py

Development

Getting your local environment setup to work with this hackpack is similarly easy. After you configure your hackpack with the steps above, use this guide to get going locally:

  1. Install the dependencies.
make init
  1. Launch local development webserver
foreman start
  1. Open browser to http://localhost:5000.

  2. Tweak away on app.py.

Testing

This hackpack comes with a full testing suite ready for nose.

make test

Meta

twilio-queue-example's People

Contributors

robspectre avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.