'Twilio Programmable Voice - How to prevent <Gather> prompt from playing if the call is picked up by an answering machine
We started using Twilio Programmable Voice for appointment reminders, and we are using AMD with the MachineDetection parameter set to "DetectMessageEnd" so we can leave voicemail messages on the recipients answering machine. We are also using a Gather tag in our TwiML to get user input (Ex. "Press 1 to confirm your appointment").
However, we noticed that if the call goes to a voicemail box, the Gather prompts still get triggered. We'd like to be able to prevent this from occurring so the recipient doesn't hear the prompts in their voicemail message.
Is this even possible? Here's an example of our current TwiML:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say voice="Polly.Joanna">
<prosody rate="95%">Hello, you have an appointment tomorrow at 10:30AM</prosody>
</Say>
<Pause length="1" />
<Gather action="https://example.com" timeout="5">
<Say voice="Polly.Joanna">
<prosody rate="95%">Press 1 to confirm your appointment, Press 2 to repeat the message</prosody>
</Say>
</Gather>
</Response>
Solution 1:[1]
The AMD AnsweredBy parameter would be used to determine which TwiML you want to return.
If it is a Machine, you would not return the TwiML with the Gather (since it is a machine and you will wait for the DetectMessageEnd event to drop the announcement). If it is a human (AnsweredBy=human), you can use the Gather to get their response around their availability for their appointment.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Alan |
