在 Twilio 队列中录制语音邮件 [英] Recording a voicemail while in a Twilio Queue

查看:30
本文介绍了在 Twilio 队列中录制语音邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

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

请在提示音后录制您的信息.</Say><Record action="http://ngrok.com/handleVoicemailRecording"></Record></响应>

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

初始调用:

[2016-01-19 17:38:45.637] <Response><Say voice="alice" language="en-AU">感谢来电,请注意所有通话可能会被录音出于安全和培训目的.我们很快就会接听您的电话.</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>谢谢等待,您在队列中的第 1 名.随时按 1 留言.</Say><Play>https://s3-ap-southeast-2.amazonaws.com/somemusic.mp3</Play></Gather></响应>

Record 命令,Say 有效,Record 无效

[2016-01-19 17:39:10.861] <Response><Say voice="alice" language="en-AU">请在提示音后录制您的信息.</说><Record action="http://ngrok.com/handleVoicemailRecording"></Record></Response>

然后 3 秒后(在 Say 结束时),Twilio 再次请求 waitUrl,没有发出哔哔声.

[2016-01-19 17:39:13.757] 

有什么想法吗?这是故意的吗?我可以用一种有用的方式绕过它吗?

解决方案

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

这种行为是设计使然.<Enqueue> 文档为您提供了 动词可以在 waitUrl TwiML 中使用.但是,这并不意味着您不走运,我们仍然可以创建此功能.

你可以使用 而不是从 code> 让用户离开队列.呼叫不会挂断,而是会尝试从原始 之后继续.在原始 TwiML 中添加您的 <Say/><Record/>,它会在用户决定离开队列并录制消息时播放.

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

<Say voice="alice" language="en-AU">感谢您的来电,请注意,出于安全和培训目的,所有来电可能会被录音.我们会尽快接听您的电话.</说><Enqueue waitUrl="http://ngrok.com/holdMusic">1COVERAUS</Enqueue><Say voice="alice" language="en-AU">请在提示音后录制您的信息.</说><Record action="http://ngrok.com/handleVoicemailRecording"></Record></响应>

您的 waitUrl TwiML 保持不变:

<Gather numDigits="1" action="http://ngrok.com/leaveVoicemail"><说>感谢您的等待,您在队列中的第 1 名.随时按 1 留言.</Say><播放>https://s3-ap-southeast-2.amazonaws.com/somemusic.mp3</Play></收集></响应>

而 Gather 操作就变成了:

<离开/></响应>

让我知道这是否有帮助.

I'm writing a call centre app using Twilio, and I've run into a problem. The calls are received and put into a queue, while we find an agent to answer the call. Whilst they're listening to the hold music, they are read their position in the queue, and I'm trying to use a Gather verb to allow them to press 1 and then leave a message.

It all works well, except that it won't record. I've tried recording outside of the queue and it's all fine, so it seems to be the fact that it's in the queue that is the problem. I'm not sure, thus, how to deal with it?

So, if I just send this on initial connection:

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

then it works fine, and calls the method. If however, I do the "proper" route as I see it, then the recording doesn't happen, and the queue immediately re-calls the "waitUrl" action for the queue:

Initial call:

[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>

Queue waitUrl response:

[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 command, the Say of which works, and the Record doesn't

[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>

And then 3 seconds later (at the end of the Say), Twilio requests the waitUrl again, having not beeped.

[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>

Any ideas? Is this by design? Can I get around it in a useful way?

解决方案

Twilio developer evangelist here.

This behaviour is by design. The <Enqueue> documentation provides you the verbs that can be used within the waitUrl TwiML. However, this does not mean that you are out of luck, we can still create this feature.

Instead of going from <Gather> to <Say/><Record/> you can use <Leave> to have the user leave the queue. The call won't hang up, rather it will try to carry on from after the original <Enqueue>. Add your <Say/><Record/> in that original TwiML and it will play when the user decides to leave the queue and record a message.

So, you initial TwiML will now be:

<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>

Your waitUrl TwiML stays the same:

<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>

And the Gather action simply becomes:

<Response>
  <Leave/>
</Response>

Let me know if that helps at all.

这篇关于在 Twilio 队列中录制语音邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆