在 Twilio 队列中录制语音邮件

2023-12-12

我正在使用 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>文档为您提供了可以在里面使用的动词waitUrl TwiML。然而,这并不意味着你运气不好,我们仍然可以创建这个功能。

而不是从<Gather> to <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>

收集动作就变成了:

<Response>
  <Leave/>
</Response>

让我知道这是否有帮助。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

在 Twilio 队列中录制语音邮件 的相关文章

随机推荐