1

We are trying to gather caller information through a series of <Gather> steps, but give them the option to escape from the flow by sending just #. We would like the caller to be able to escape the series of <Gather> steps and follow separate logic if a step times out. According to the <Gather> documentation, in the example below the <Redirect> verb will be used by Twilio in either case if the input times out or if the caller sends no input and just hits #.

<Response>
  <Gather action="https://localhost:8001/api/Step" method="POST" timeout="7" finishOnKey="#">
    <Play>[Prompts omitted]</Play>
  </Gather>
  <Redirect method="POST">https://localhost:8001/api/Step?timeout=true</Redirect>
</Response>

My question is, is there any way to differentiate between those two scenarios? The major complication is this: Our existing recorded prompts already instruct callers to use # as both the escape key and finishOnKey, so if possible we need to keep those the same.

  • 1
    Do the other potential responses to the prompts require multiple key presses? – philnash Aug 11 '21 at 23:47
  • @philnash Yes, they do. I got a potential answer from someone in the Twilio community forums. If their answer works, I'll update this question with the solution. It requires getting the `FinishedOnKey` from the request form (which for some reason isn't an available member of the C# VoiceRequest model provided in the Twilio.AspNet.Common package). – James Meisler Aug 12 '21 at 16:40

1 Answers1

0

In the documentation for the TwiML gather verb, I see this called out:

Note: finishOnKey only works when a digit sequence precedes it. It cannot be used as a mechanism to stop a Gather without previous digit input

Are you seeing different behavior? It sounds like you are attempting to press # without any input.

Alan
  • 10,465
  • 2
  • 8
  • 9