How to hang up after key press or after a minute with twilio?
I am trying to make an application with twilio. The overall functionality is that a user is going to call into a system, and right away be presented with a voice menu to either press 1 through 9 or hang up. Is there a way to make twilio disconnect the call (and pass me the keypress) as soon as the user presses a digit (I don't want them to have to press #)? If they don't press anything, I want to hang up after a minut开发者_JAVA技巧e and the system would pass me something that says they pressed nothing.
Thanks
I think you could accomplish this with the following TwiML:
<Response>
<Gather numDigits="1" action="keypressed.php">
<Pause length="60" />
</Gather>
<Redirect method="GET">nokeypressed.php</Redirect>
</Response>
In each keypressed.php
and nokeypressed.php
you would respond accordingly.
<Gather> Hints and Advanced Uses
精彩评论