开发者

How to hang up after key press or after a minute with twilio?

开发者 https://www.devze.com 2023-01-26 20:16 出处:网络
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 ha

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

0

精彩评论

暂无评论...
验证码 换一张
取 消