Reputation: 23
I would like to have my Twilio number dial multiple of my off-site technicians within my company simultaneously and only connect the caller to a human (aka, block voicemails from grabbing the call).
I've got the Simulring working great, but the problem is when one of my techs is out of cell range/phone is off, his voicemail answers immediately and the DIAL disconnects from all the other technicians (NUMBER nouns).
My first thought was to set it up so that the NUMBER nouns go to another TwiML Bin that performs a GATHER requesting that they press any key to accept the call (which guarantees it's a human and not a VM). That works for human detection, but when a voicemail is reached all other calls are dropped.
So, how do I proceed to restart the Simulring after that voicemail fails the GATHER, and omit the voicemail's number so it doesn't capture the call again?
This post references exactly what I need, but the answer was theoretical, and didn't offer a solution. Now that I'm trying what Devin suggests, I can't find a way to actually do it.
This is my initial TwiML Bin:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Dial method="GET" action="/retry-simulring">
<Number url='/human-check' method="GET">
8885551111
</Number>
<Number url='/human-check' method="GET">
8885551112
</Number>
</Dial>
<Hangup></Hangup>
</Response>
This is the /human-check TwiML Bin:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Gather numDigits="1" timeout="5" method="GET" action="/human-check-result">
<Say voice="alice">You are receiving a work call, press any key to accept</Say>
</Gather>
</Response>
And the /human-check-result just sends a HANGUP if the GATHER fails or connects the Tech and the caller if it passes.
I am aware of the findme Twimlet, but for user experience reasons, I want all technicians to be called at the same time.
Thanks for your help... I've spent the better part of a day trying to figure this out with no decent solution in sight.
Upvotes: 0
Views: 917
Reputation: 73037
Twilio developer evangelist here.
First up, noting that you pointed to an answer that referenced our old experimental answering machine detection, we now have a new enhanced Answering Machine Detection product that you may want to try with this.
But if you want to carry on with the <Gather>
method then you could try the following.
When you get the result from the <Gather>
you are currently just hanging up the call. Instead of doing that, you could redirect back to your simulring <Dial>
.
That would be great, except that it would dial the same number again. So, what you could do is store the number/voicemail that answered the call against the call sid in a database, it will be the To
parameter in the webhook to the <Number>
url. You could then redirect to the simulring again and then list out any numbers that have been stored as having been tried for the current call SID and remove them from the list of numbers you try to call.
I'm not sure how to give you an example of this, as I don't know what you're application is written in. Let me know if I can help any further.
Upvotes: 0