twilio - 录制 Twilio 调用,包括拨号动词前的播放动词

标签 twilio twilio-twiml

当我们接到电话时,我们会向来电者播放提示,内容类似于“我们可能会出于质量和培训目的记录通话”。

我们为响应来电而发送的 TWiML 如下所示。

<Response>
    <Play>http://domain.tld/may_record_call.wav</Play>
    <Dial timeout="10" callerId="5555551234" record="record-from-ringing" action="https://my_url.com/action" method="POST">
        <Client>my_user</Client>
    </Dial>
</Response>

我们的录音是正确创建的,但它不包括调用前的提示。

我们想要证明我们正确播放了提示,理想情况下它会包含在我们制作的录音中,但拨号录音选项似乎不允许这样做。

from the TWiml docs

record

The 'record' attribute lets you record both legs of a call within the associated verb. When using record-from-answer, the recording will begin when a call is answered. When using record-from ringing, the recording will begin when the ringing starts. In both cases, a RecordingUrl parameter will be sent to the 'action' URL on the associated verb. You must set an 'action' URL to receive the RecordingUrl.



我不能在 dial 之后添加 play,因为当接听电话时, dial 后面的动词没有执行。

我的问题是如何将我的通话录音警告记录为通话录音的一部分?是否有另一个可以使用的隐藏记录值?有没有办法让拨号开始,但向调用者播放提示?

最佳答案

如果这是一个出站调用,请在您的 API 请求中包含可选的 POST 参数 Record=true .这将记录整个电话调用,包括 <Play><Dial>标签。 RecordingUrl将发送至StatusCallback网址。然后您可能想要删除 record参数来自 <Dial>标记,否则您最终会得到两个对话录音。

您可以在 API documentation 中阅读有关以这种方式录制通话的更多信息。 .

您可以在 Twilio Skills Training 中了解有关 Twilio 记录调用的各种方式的更多信息。 .

关于twilio - 录制 Twilio 调用,包括拨号动词前的播放动词,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27492600/

相关文章:

c# - 如何使用 .NET Core MVC 框架将 TwiML 实现为一种方法?

node.js - 将8kHz mulaw转换为PCM 16kHz

php - 如何使用 PHP 在 Twilio 中传递自定义参数?

php - 如何使用 Twilio PHP SDK 删除电话号码?

java - 如何使用 Java 在 Twilio 中使用 TwiML 而不是 URL 进行出站调用?

c# - 在对 Twilio 的 JSON 调用中获取 "A From phone number is required"

php - Twilio 短信 mysql 插入

twilio - 如何在 TwiML 中生成半秒暂停?

testing - 如何自动化 twilio 拨出调用测试