Pockethotline is a rails app that allows you to setup a "distributed hotline". This allows you to have a hotline number that is published and operators signup with their personal numbers. When someone calls the main number the operators will be called (depending on their on-call status) and connected to the main caller.
It was originally conceived as a business by Scott Magee and Chap Ambrose at the Austin Center for Design in the winter of 2011.
The software was open-sourced January 2014.
The minimum hosting costs are about $35 a month. This is because a background worker dyno is required. (Assuming you're using Heroku for hosting).
Twilio phone numbers cost $1/month for local numbers and $2/month for toll-free.
Twilio charges you by minutes used, $0.03/minute for local and $0.05/minute for toll-free.
Twilio's published rates are $0.01 / $0.03 but that is only for the incoming call, you also have to add another $0.02 to each call because of the outgoing connection to the operators.
Start with the free trial number or purchase another toll-free or local number.
Find them under "Account Settings"
$ git clone email@example.com:chap/pockethotline.git
You must edit values for:
$ git commit config/initializers/hotline.rb -m "updated config"
$ heroku create myhotline-name
$ heroku addons:add sendgrid
Any SMTP provider should work. If you don't use Sendgrid, manually update settings at
$ git push heroku master
$ heroku run rake db:schema:load
$ heroku ps:scale worker=1
Use Twilio API credentials from step 3.
$ heroku config:set TWILIO_AUTH_TOKEN=XXXXXXXXXXXXXX
$ heroku run rake secret
Copy the output and use it here:
$ heroku config:set SESSION_SECRET=XXXXXXXXXXXXXX
$ heroku addons:add scheduler
$ heroku addons:open scheduler
- Click "Add Job"
- In the left-most field enter "rake oncall_scheduler"
- Change frequency to "Hourly"
- Set next run to "XX:00" (The XX will depend on the current time.)
- Click "Save"
$ heroku run rails console $ u = User.new( :name => 'my name', :email => 'firstname.lastname@example.org', :phone => '215-359-5228', :password => 'setyourpasswordhere' ) u.admin = true u.on_call = true u.save!
$ heroku open
- Click on 'Numbers' in the nav bar
- Click on your phone number
- Change the 'Voice Request URL' to
- Set request method to [POST]
- Don't call from the same number that you added for yourself
- If you're using your free demo Twilio account you'll hear a pre-roll message. That will go away when you upgrade your account.
- Your call should be connected after the greeting message is used.
- If calling via Gtalk fails to connect, try a real land or cell line.
Uncomment (remove leading '#') and edit values in
$ heroku config:set STRIPE_SECRET_KEY=XXXXXXXXXXXXXX
$ git commit /config/initializers/hotline.rb -m "add stripe details"
$ git push heroku
Stripe requires SSL to be enabled, if you're using your default heroku domain you will seemlessly piggy-back on the wildcard certificate at *.herokuapp.com.
If you want to use a different domain you may have to purchase and setup your own certificate.
$ heroku config:set S3_ACCESS_KEY_ID=XXXXXXXXXXXXXX S3_SECRET_ACCESS_KEY=XXXXXXXXXXXXXX
Look at all the options in /config/hotline.rb