Simple Sinatra application for prototyping Twilio workflows.
- Copy
twilio.yml.sample
totwilio.yml
and add your account settings - Run
proxylocal 9393
to allow Twilio to reach your app - Run
URL=http://<your_unique_id>.proxylocal.com rake config_twilio
to configure Twilio to hit your/voice
route - Run
rerun 'rackup -p 9393'
- to start a reloading local app - Open your app at
/agent_client
- Dial your number and try some of the commands below
Here is an example set of commands your could run to manipulate the enqueued call:
curl http://<your_unique_id>.proxylocal.com/run/dial_client/agent_client
curl http://<your_unique_id>.proxylocal.com/run/enqueue
curl http://<your_unique_id>.proxylocal.com/run/dial_number/+123456789
curl http://<your_unique_id>.proxylocal.com/run/enqueue
curl http://<your_unique_id>.proxylocal.com/run/say_hello
A sample call hold workflow is implemented which can be driven from the terminal.
To start, make a call using your number. The call with be enqueued with hold music. Next put the caller a specific conference:
curl http://<your_unique_id>.proxylocal.com/put_caller_in_conference -d ''
Next we need to call the agent in the browser. The call will ring in the browser, so allow it and the agent will be put direcly into the conference with the caller:
curl http://<your_unique_id>.proxylocal.com/dial_agent -d ''
Now the two parties should be connected. Now we can put each on hold in turn:
Caller first:
curl http://<your_unique_id>.proxylocal.com/put_caller_on_hold -d ''
Then the agent:
curl http://<your_unique_id>.proxylocal.com/put_agent_on_hold -d ''
Then put them back into conference in reverse order. First the agent goes back into the conference:
curl http://<your_unique_id>.proxylocal.com/put_agent_in_conference -d ''
And then the caller:
curl http://<your_unique_id>.proxylocal.com/put_caller_in_conference -d ''
When you are finished you can hang up both parties:
curl http://<your_unique_id>.proxylocal.com/hangup_all -d ''
Simply follow the convention in app.rb
!