0

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>

1 Answers1

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.

Alan
  • 10,465
  • 2
  • 8
  • 9
  • Thanks for the response. So where exactly would that logic go? I tried putting my logic in place and returning the Gather TwiML in the StatusCallback endpoint, but I'm not hearing the response during my call – David Moeller Mar 04 '22 at 15:06
  • If you are using regular AMD (vs. Async AMD), your TwiML would be returned via the url you define when calling the /Calls resource). If you are using Async AMD, you can refer to this blog post - https://www.twilio.com/blog/async-answering-machine-detection-tutorial – Alan Mar 04 '22 at 20:04