gpt4 book ai didi

twilio - 在 Twilio 队列中录制语音邮件

转载 作者:行者123 更新时间:2023-12-01 09:52:41 26 4
gpt4 key购买 nike

我正在使用 Twilio 编写调用中心应用程序,但遇到了问题。接收到调用并将其放入队列,同时我们找到一个代理来接听调用。当他们在听保持音乐时,他们会读取他们在队列中的位置,我正在尝试使用 Gather 动词让他们按 1 然后留言。

一切都很好,只是它不会记录。我试过在队列外录音,一切都很好,所以问题似乎是在队列中。我不确定,因此,如何处理它?

所以,如果我只是在初始连接时发送这个:

<Response><Say>Please record your message after the tone.</Say><Record action="http://ngrok.com/handleVoicemailRecording"></Record></Response>

然后它工作正常,并调用该方法。但是,如果我按照我所见执行了“正确”的路由,则记录不会发生,并且队列立即重新调用队列的“waitUrl”操作:

初始调用:
[2016-01-19 17:38:45.637] <Response><Say voice="alice" language="en-AU">Thanks for calling, please note all calls may be recorded for security and training purposes. We'll answer your call very shortly.</Say><Enqueue waitUrl="http://ngrok.com/holdMusic">1COVERAUS</Enqueue></Response>

队列 waitUrl 响应:
[2016-01-19 17:38:56.202] <Response><Gather numDigits="1" action="http://ngrok.com/leaveVoicemail"><Say>Thanks for waiting, you're 1 in the queue. Press 1 at any time to leave a message.</Say><Play>https://s3-ap-southeast-2.amazonaws.com/somemusic.mp3</Play></Gather></Response>

Record 命令,Say 有效,而 Record 无效
[2016-01-19 17:39:10.861] <Response><Say voice="alice" language="en-AU">Please record your message after the tone.</Say><Record action="http://ngrok.com/handleVoicemailRecording"></Record></Response>

然后 3 秒后(在 Say 结束时),Twilio 再次请求 waitUrl,没有发出哔哔声。
[2016-01-19 17:39:13.757] <Response><Gather numDigits="1" action="http://ngrok.com/leaveVoicemail"><Say voice="alice" language="en-AU">Thanks for waiting, you're 1 in the queue.</Say><Say voice="alice" language="en-AU">Press 1 at any time to leave a message.</Say><Play>https://s3-ap-southeast-2.amazonaws.com/somemusic.mp3</Play></Gather></Response>

有任何想法吗?这是故意的吗?我能以一种有用的方式绕过它吗?

最佳答案

Twilio 开发人员布道者在这里。

此行为是设计使然。 <Enqueue>文档为您提供了 verbs that can be used within the waitUrl TwiML .但是,这并不意味着您不走运,我们仍然可以创建此功能。

而不是从 <Gather><Say/><Record/>您可以使用 <Leave>让用户离开队列。电话不会挂断,而是会尝试从原来的 <Enqueue> 之后继续。 .添加您的 <Say/><Record/>在原始 TwiML 中,当用户决定离开队列并录制消息时,它将播放。

因此,您最初的 TwiML 现在将是:

<Response>
<Say voice="alice" language="en-AU">
Thanks for calling, please note all calls may be recorded for security and training purposes. We'll answer your call very shortly.
</Say>
<Enqueue waitUrl="http://ngrok.com/holdMusic">1COVERAUS</Enqueue>
<Say voice="alice" language="en-AU">
Please record your message after the tone.
</Say>
<Record action="http://ngrok.com/handleVoicemailRecording"></Record>
</Response>

您的 waitUrl TwiML 保持不变:
<Response>
<Gather numDigits="1" action="http://ngrok.com/leaveVoicemail">
<Say>
Thanks for waiting, you're 1 in the queue. Press 1 at any time to leave a message.</Say>
<Play>https://s3-ap-southeast-2.amazonaws.com/somemusic.mp3</Play>
</Gather>
</Response>

而 Gather Action 就变成了:
<Response>
<Leave/>
</Response>

让我知道这是否有帮助。

关于twilio - 在 Twilio 队列中录制语音邮件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34883569/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com