Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use twilio to guarantee a live answer or voicemail?

Tags:

twilio

Update: I got it working https://github.com/coolaj86/bizilio

I have this scenario where a customer makes a call and that call should be forwarded to the first representative to answer (let's just focus on one for the moment).

The problem is that occasionally the rep butt-answers or the phone is off and goes straight to voicemail, which is detected as an answer.

What I would like to do is put up a challenge such as using gather & say "press 2 to answer" with a 5 second timeout and then connect the call (or drop the call) and if no rep responds go to voicemail.

I'm not clear on how to connect the person who presses 2 to the phone that's ringing.

like image 214
coolaj86 Avatar asked Jul 17 '13 03:07

coolaj86


People also ask

Can twilio tell whether a call was answered by a human or machine?

Twilio has an Answering Machine Detection system which can detect if an outbound call made with Twilio's API was picked up by a human, an answering machine, or a fax machine.

Does twilio offer voicemail?

With Twilio's suite of tools, it's easy to create a fully functioning voicemail box for Flex. This guide walks you through creating a special voicemail-specific TaskRouter queue with no agents, and a workflow to send tasks to this queue after they've waited for 30 seconds.

Can twilio leave voicemail?

If you would like to leave a voicemail on an answering machine, specify DetectMessageEnd . In this case, Twilio will return an AnsweredBy immediately when a human is detected but for an answering machine, AnsweredBy is returned only once the end of the greeting is reached, usually indicated by a beep.

How do I detect my answering machine?

The standard Answering Machine Detection algorithm uses voicemail tone detection to identify whether a call has been answered by a human or a machine. Detection accuracy can be tested and refined using configurable time-windowing parameters.


2 Answers

Twilio evangelist here.

So just to make sure I understand your question. You've got customers making inbound calls and for each customers calling, you're dialing a bunch of reps. But you want to make sure that the rep actually wants to accept that call by issuing a "challenge" of some kind that require explicit action on their part to complete.

This is totally possible with Twilio and most of how to do it is described in these HowTos:

https://www.twilio.com/docs/howto/callscreening (press * to answer this call)

http://www.twilio.com/blog/2009/05/dialing-multiple-numbers-simultaneously-with-twilio.html

https://www.twilio.com/docs/api/rest/answering-machine-detection (answering machine detection)

Their are two key parts of this HowTo.

First, it uses the Number noun to dial the second leg of the call. In your case this is dialing a rep. The <Number> noun has a url attribute that lets you provide a URL that Twilio will request when the rep answers. This give you the opportunity to provide some TwiML that Twilio will execute for that leg of the call. So you can for example prompt the rep to press the number 2.

Second, the <Dial> verb has its action attribute set. This URL will be requested when the second leg of the call to the rep ends and gives you the opportunity to take some other action. So if the agent does not answer or fails press 2 within the require time, their call ends and your app can make a call to another rep.

Hope that helps.

like image 69
Devin Rader Avatar answered Dec 20 '22 23:12

Devin Rader


Devin's answer is correct, but the < Number > verb is always a bit tricky to use.

What you can also do is use the Find Me twimlet, or figure out how to code that twimlet in your app if you chose not to use premade twimlets.

The concept is that it dials up to 10 numbers, one by one. Even if you don't use all 10 numbers, you can enter enough to make sure that the call is eventually answered by a human *no matter what.*

Otherwise, another solution that I used in my Twilio App is before you dial them, you tell them in your verb that if they hit a voicemail, that they don't leave a message there as it WILL NOT be answered. Then, if they press 1 while listening to the phone's voicemail, it will HANG UP (but not disconnect them) they will not leave a message to that voicemail and be redirected to your TwiML.

— You then redirect them to a Voicemail Twimlet —>

where you ask them to leave an email and phone number and Twilio emails you the audio. That way you can answer their concern at a later time.

The TwiML should look like :

< Say > Bla bla dont answer first voicemail < /Say >

< Dial> the rep # < /Dial>

//Depending on answer, if it's missed they exit the Dial verb.

< redirect > "the voicemail url" < /redirect >

(go read the Voicemail page to understand how to customize it to your choosing/business logic.)

like image 36
Zagstrug Avatar answered Dec 20 '22 21:12

Zagstrug