Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Ruby HTML CSS JavaScript CoffeeScript
Branch: master
Failed to load latest commit information.
app an exception is no longer raised if there is no ENV['SPECIAL_MESSAGE'…
config Upgrade rails to 3.2.11
db bump rails
doc new app
lib new app
log
public new app
script new app
spec new app
vendor new app
.gitignore new app
.rspec
.rvmrc new app
Gemfile Bump rails to v3.2.19
Gemfile.lock Bump rails to v3.2.19
Guardfile Upgrade rails to 3.2.11
LICENSE Updates LICENSE.
Procfile new app
README.md Updates LICENSE.
Rakefile new app
config.ru new app

README.md

Call Roulette

Sample Rails 3 app using call_center

Overview

Call Roulette is like Chat Roulette but with calls. People call in and are connected to random people. They can "next" their call buddy by pressing '*' until they've talked to their heart's content.

Requirements

This app requires that you have a Twilio account set up and you have its TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN set up in your environment variables.

You will also need to set up a Twilio number that points to your app (being sure to replace call-roulette with the name of your Heroku app):

Request URL: http://call-roulette.herokuapp.com/calls/create
Fallback URL: http://call-roulette.herokuapp.com/calls/exception
Status Callback URL: http://call-roulette.herokuapp.com/calls/flow?event=hang_up

Usage

This app can be deployed to Heroku in the following steps:

# Cedar stack allows us to run multiple processes
heroku create --stack cedar

# First deploy
git push heroku master

# Set up required variables
heroku config:add TWILIO_ACCOUNT_SID=...
heroku config:add TWILIO_AUTH_TOKEN=...
heroku config:add TWILIO_TUNNEL_URL=http://name-of-app.herokuapp.com
heroku config:add CALL_ROULETTE_PHONE_NUMBER="(123) 456 7890"

# Start background process that routes calls
heroku scale web=1 clock=1

Non-heroku deploys can just:

export=TWILIO_ACCOUNT_SID=...
export=TWILIO_AUTH_TOKEN=...
export=TWILIO_TUNNEL_URL=http://name-of-app.herokuapp.com
export=CALL_ROULETTE_PHONE_NUMBER="(123) 456 7890"

bundle install

bundle exec foreman start

Call Flow (Clean)

State Diagram Clean

Call Flow (Full)

State Diagram

Copyright and license

Copyright 2013 Zendesk

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Something went wrong with that request. Please try again.