Twilio Queue – From Push to Pull

twilio queue push pullTaking calls from customers and leads is challenging when you don’t have a dedicated staff to do so but you can do it with a pretty straight forward solution using Twilio Queue. The problem is we are frequently in meetings or tied up to take calls as they come in and having a lead or customer leave a message is a poor user experience. For ThinkVoice we didn’t want to just put up an email address because we really want to and love to talk to customers and leads. It is the fastest and most effective way to understand our customers and potential customers. So we solved the inherent problem with the phone using Twilio Queue.

The phone is by nature a push system. When someone dials your phone number that call is pushed to your phone and you have somewhere around four rings to answer or it goes to voicemail. To fix this we created a Twilio app that will change the phone from being a push system to a pull system where calls can be queued and pulled to mobile phones by the person best suited to take the call.

Queues are nothing new for phones but the idea of calls being pulled out of queue rather than being pushed is new. In call centers ACDs are large complex systems that queue calls and push those calls to agents. In order to do this the ACD must monitor each agent in real time via synchronous messaging to deliver a call as soon as that agent is available. If we change that push model to be a pull model then we can have the agent’s system asynchronously pull calls out of queue or they themselves queue up for the next call. Breaking that synchronous communication requirement drastically reduces the complexity of call center technology making it less expensive and more agile.

Twilio Queue small

Here is how we did it using Twilio Queue.

The first thing we are going to do is answer the call and immediately send a SMS message. Using the meta data from Twilio we can include a look up of the caller’s name and their location. We then place them in a queue and redirect the app to tell Twilio what to play them while in queue. For our case we will tell the caller we are routing them and play them some music.

When we receive the SMS message we can reply to tell Twilio what to do with the call. We can configure the SMS to take any number of keywords to control different routing behaviors but we are just using a Yes or No to take the call or send it to voicemail. In either case when the SMS is received we are going to pull the call out of queue and redirect the call to the proper instructions.

If we have decided not to take the call we are simply going to send Twilio instructions to tell the caller to leave a message that will be recorded and stored by Twilio. If we have decided to take the call then we tell Twilio to call our mobile number and bridge the caller.

The full code for the Pull Phone system is on GitHub. If you need any help setting up your own Pull Phone system please let us know and we would be glad to help.


push pull image from Robert S Donovan