【问题标题】:Recording a voicemail while in a Twilio Queue在 Twilio 队列中录制语音邮件
【发布时间】:2016-01-19 17:45:24
【问题描述】:

我正在使用 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>

记录命令,Say of which 有效,而 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


    【解决方案1】:

    这里是 Twilio 开发者宣传员。

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

    您可以使用&lt;Leave&gt; 让用户离开队列,而不是从&lt;Gather&gt;&lt;Say/&gt;&lt;Record/&gt;。通话不会挂断,而是会尝试在原始&lt;Enqueue&gt; 之后继续。在原始 TwiML 中添加您的 &lt;Say/&gt;&lt;Record/&gt;,它会在用户决定离开队列并记录消息时播放。

    因此,您最初的 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 动作简单地变成:

    <Response>
      <Leave/>
    </Response>
    

    让我知道这是否有帮助。

    【讨论】:

    • 谢谢,是的,虽然我不想那样做,因为呼叫可能会因其他原因出队。我最终通过使用 REST API 将呼叫出队并转到另一个记录语音邮件的 TWiML 来修复它。
    【解决方案2】:

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

    【讨论】:

    • 抱歉回复缓慢 - 现在可以使用 REST API 暂停录制,因此您不再需要解决方法。
    猜你喜欢
    • 2017-11-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-10-20
    • 1970-01-01
    • 2017-10-19
    相关资源
    最近更新 更多