在Twilio队列中录制语音邮件

在Twilio队列中录制语音邮件,twilio,Twilio,我正在使用Twilio编写呼叫中心应用程序,遇到了一个问题。呼叫被接收并放入队列,同时我们找到一个代理来应答呼叫。当他们在听暂停音乐时,他们会读取他们在队列中的位置,我尝试使用聚集动词让他们按1然后留言 这一切都很好,只是它不会录制。我试着在队列外录音,一切都很好,所以问题似乎出在队列中。我不确定,因此,如何处理它 所以,如果我只是在初始连接时发送: <Response><Say>Please record your message after the tone.<

我正在使用Twilio编写呼叫中心应用程序,遇到了一个问题。呼叫被接收并放入队列,同时我们找到一个代理来应答呼叫。当他们在听暂停音乐时,他们会读取他们在队列中的位置,我尝试使用聚集动词让他们按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>
[2016-01-19 17:38:45.637]感谢您的来电,请注意,出于安全和培训目的,可能会记录所有来电。我们将很快接听您的电话。1谢谢
队列等待URL响应:

[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>
[2016-01-19 17:38:56.202]谢谢您的等待,您排在第一位。随时按1可留言。https://s3-ap-southeast-2.amazonaws.com/somemusic.mp3
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>
[2016-01-19 17:39:10.861]请在铃声后录制您的留言。
然后3秒钟后(在演讲结束时),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>
[2016-01-19 17:39:13.757]感谢您的等待,您在队列中是1。随时按1可留言。https://s3-ap-southeast-2.amazonaws.com/somemusic.mp3

有什么想法吗?这是故意的吗?我能以一种有用的方式解决这个问题吗?

这里是Twilio开发者福音传道者

这种行为是故意的。
文档为您提供了。但是,这并不意味着你运气不好,我们仍然可以创建此功能

您可以使用
让用户离开队列,而不是从
转到
。电话不会挂断,而是尝试从原始的
之后继续。将您的
添加到原始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>

感谢您的来电,请注意,出于安全和培训目的,可能会记录所有来电。我们很快就会接你的电话。
1覆盖层
请在铃声后录制您的信息。
您的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>

谢谢您的等待,您排在第一位。随时按1可留言。
https://s3-ap-southeast-2.amazonaws.com/somemusic.mp3
“聚集”操作简单地变成:

<Response>
  <Leave/>
</Response>


让我知道这是否有帮助。

我找到了一个解决方案,这并不意味着任何退出队列的人都可以使用语音邮件,而是使用REST API更改相关调用,将其从队列中删除,并转发到另一个TWiML文档来记录您的消息。

谢谢,是的,虽然我不想这样做,因为电话可能会因为其他原因退出队列。最后,我通过使用REST API取消呼叫队列并转到另一个TWiML记录语音邮件来解决这个问题。很抱歉回复太慢-现在可以使用REST API暂停录制,因此您不再需要解决方法。