Twilio Gather,无需延迟即可获得用户的输入

时间:2016-06-16 16:03:14

标签: twilio

我正在使用聚集动词来获取用户的输入,但是在用户按下某个键之前我会播放mp3。 问题是我想在mp3文件播放完毕之前将用户的输入发布到动作URL。 我的TwiML在mp3文件播放完毕之前不会接受任何用户的输入。 我不确定是否有办法在用户按键时立即发布用户的输入。

<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Play>http://www.action.com/greeting.mp3?1925924752</Play>
    <Play>http://www.action.com/selection.mp3?1925924752</Play>
    <Gather NumDigits="1" Timeout="5" Method="GET" Action="Http://www.action.com/handler.Php?Repeated=1"/>
    <Redirect Method="GET">http://www.action.com/handler.php?repeated=1</Redirect>
</Response>

谢谢。

1 个答案:

答案 0 :(得分:2)

Twilio传道者在这里。

将这些<Play>动词放入<Gather>

<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Play>http://www.action.com/greeting.mp3?1925924752</Play>
  <Gather NumDigits="1" Timeout="5" Method="GET" Action="Http://www.action.com/handler.Php?Repeated=1">
    <Play>http://www.action.com/selection.mp3?1925924752</Play>
  </Gather>
  <Redirect Method="GET">http://www.action.com/handler.php?repeated=1</Redirect>
</Response>

希望有所帮助。

相关问题