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

twilio

Solution

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.

Problem

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.

Original source