Question

I'm trying to make a Twilio workflow that allows for a user to press 1 at any time to cancel out (as long as a <Dial> hasn't connected yet) and leave a voicemail instead. The TwiML documentation offers a <Gather> option, but this is for a specific time and it supposedly won't let me run a <Dial> command during a <Gather>. Is there a trick to getting this to work?

Était-ce utile?

La solution

Twilio evangelist here.

You should be able to Dial another number after gathering input.

<Gather action="[your_gather_processing_url]">

When the <Gather> completes (eg the user presses one), then Twilio will make a request for the URL you've set in the action parameter. In there you can use <Dial> to connect to another number.

It sounds like what you want to do is have Twilio <Gather> for input while the <Dial> is ringing. I believe in that case you are correct, thats something we cannot do today.

One option might be to use <Dial>s timeout property to set a finite limit on the length of time Twilio will wait for the call to be answered (its 30 seconds by default), and then in the action URL, check the DialCallStatus to see if the call was not-answered and send to voicemail when appropriate.

Hope that helps.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top