Search code examples
laraveltwiliotwilio-phptwilio-twiml

Twilio incoming call, dial another number and make sure human picks up


I'm working on a twilio App in PHP Laravel. I've a scenario I'm not able to get working and need some help.

Our scenario is whenever we get an incoming call we forward the call to a support person's phone number but if the number is busy/not-answer then we ask the user to record the voice mail message in our APP. I've handled this through action parameter in dial.

But the problem is when there's a voice mail on the dialed number we don't want the caller to hear the number's voice mail message instead hear our system's message and record voice mail like normal no-answer. I've see the documentation for twilio AMD but that only works for outgoing API calls not any other Dial inside a call.

Maybe I've to use twilio queues or is there any easier solution? Just want to confirm if there's any solution without queue because I've a transfer call feature that provides a button to our app users to transfer the in-progress call to another support agent's phone number and if we've to change to queue then need to change the complete flow.


Solution

  • Please take a look at this blog post:

    Outsmart Voice Mail with Human Detection Using Keypress Prompts

    Look for the heading "Human Detection" to specifically answer your question.

    The gist of the post is that when you dial out to the your support person you should ask them to press any key in order to take the call. A voicemail system won't be able to press a key, so you can know that when a key is pressed there is a person there and you can connect the calls. And when a key isn't pressed you can direct the call somewhere else.