Twilio - 中断 Say block

标签 twilio

我有一个播放 block ,上面写着许多 .mp3 文件(它读取帐户余额和有关帐户的其他信息。

结果是一条需要一段时间才能收听的消息。消息的长度各不相同,具体取决于所说的内容。

我想要“任意”键来结束播放消息并跳回 c#。

我尝试使用 Gather,但超时值要么截断 Say block ,要么在最后等待很长时间(如果没有按下任何键)

有没有想过如何实现这一目标?

当前流程是这样的:

<?xml version="1.0"?>
<Response>
    <Play>/Voice/test/messages/CurrentlyYourPAYGBalanceIs_.mp3</Play>
    <Play>/Voice/test/common/numbers/78.mp3</Play>
    <Play>/Voice/test/common/currency/_pounds_.mp3</Play>
    <Play>/Voice/test/common/misc/_and_.mp3</Play>
    <Play>/Voice/test/common/numbers/91.mp3</Play>
    <Play>/Voice/test/common/currency/Pence.mp3</Play>
    <Play>/Voice/test/messages/_AndYouHavea_.mp3</Play>
    <Play>/Voice/test/products/BD021.mp3</Play>
    <Play>/Voice/test/common/misc/_with_.mp3</Play>
    <Play>/Voice/test/common/numbers/95.mp3</Play>
    <Play>/Voice/test/messages/_VoiceBalance.mp3</Play>
    <Play>/Voice/test/common/misc/_and_.mp3</Play>
    <Play>/Voice/test/common/numbers/2.mp3</Play>
    <Play>/Voice/test/common/data/_gigabytes_.mp3</Play>
    <Play>/Voice/test/common/numbers/200.mp3</Play>
    <Play>/Voice/test/common/misc/_and_.mp3</Play>
    <Play>/Voice/test/common/numbers/94.mp3</Play>
    <Play>/Voice/test/common/data/_megabytes_.mp3</Play>
    <Play>/Voice/test/common/misc/_remaining.mp3</Play>
    <Play>/Voice/test/common/misc/Expiring_.mp3</Play>
    <Play>/Voice/test/common/dates/31.mp3</Play>
    <Play>/Voice/test/common/months/_of12_.mp3</Play>
    <Play>/Voice/test/common/years/2016.mp3</Play>
</Response>

最佳答案

大卫,看看这个问题:

Twilio play pause/resume

具体:

The playback is interrupt-able as it is wrapped in Gather which points to Pause action.

您可以包装您的<Play> TwiML <Gather> 并指向包含您想要的说明的 URL。

关于Twilio - 中断 Say block ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41149077/

相关文章:

HTML5 音频标签播放,但控件未按预期工作

python - 将用户添加到 Twilio channel 。

ruby-on-rails - 获取 Twilio 404 错误 Rails 接收短信

php - 使用录制的语音作为 twilio 创建调用响应

python - Python 中的 Twilio 跟踪系统

php - Twilio 发送消息使用 twilio 库

audio - 在twilio session 中播放音频文件

JavaScript 参数在箭头函数中使用,但未在本地范围内的任何位置声明 - Twilio 函数

javascript - 如何使用 Twilio SMS/语音 api 实现一次性验证 (OTP)

node.js - 与 twilio 调用国际电话