在任务/保留超时后将 twilio 任务重定向到新的 TwiML [英] Redirecting a twilio task to a new TwiML after task/reservation timeout

查看:26
本文介绍了在任务/保留超时后将 twilio 任务重定向到新的 TwiML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前正在使用 Twilio TaskRouter 构建电话呼叫中心来路由呼叫.

Currently using Twilio TaskRouter to build a telephony call center to route the calls.

我的目标是:

  1. 当某个任务在一段时间内一直处于待处理状态(即:没有可供预订的工作人员),将其重定向到语音信箱
  2. 当任务被保留但工作人员没有回应时,将其重定向到语音邮件

我目前的实施是:

  1. 同时指定任务超时和预留超时
  2. 当触发任务超时/预留超时回调时,查询重定向指令 保留 api 将其重定向到录制语音邮件的 TwiML.
  1. Specify both task timeout and reservation timeout
  2. When task timeout / reservation timeout callback is triggered, query the Redirect Instruction reservation api to redirect it to a TwiML of recording voicemail.

但问题是:

  1. 当任务处于 pending 状态时,没有创建预留,因此我无法访问预留来执行重定向
  2. 当预留超时时,尝试执行重定向会收到来自 Twilio 的 execption,说明预留不再可用于重定向
  1. When a task is in pending status, no reservation was created so that I could not access the reservation to perform a redirect
  2. When a reservation is timed out, trying to perform a redirect would receive an execption from Twilio saying that the reservation was nolonger available for redirecting

推荐答案

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

Twilio developer evangelist here.

这里有两个问题,正如你最后所说的.您要么尝试移动不存在的预留,要么重定向不可重定向的预留.

There's two issues here, as you've said at the end. You're either trying to move a reservation that doesn't exist or redirecting a reservation that isn't available to redirect.

我认为您可以通过使用工作流程来实现您的目标.

I think you can achieve your goals by using the workflow instead.

首先,考虑事情的任务方面.你给一个任务超时.当它超时时,任务的正常行为是移动到工作流中匹配的下一个队列.

First up, consider the task side of things. You give a task a timeout. When it does timeout the normal behaviour for a task is to move to the next queue that it matches in the workflow.

我建议设置一个最终队列,其中包含一个永久可用的工作对象(但不是真人).当您为该队列中的任务预留的分配回调时,您可以使用 重定向分配 将调用发送到返回 的某个 TwiML 以获取消息.您的 TwiML 应用程序还可以调用 REST API 来接受预订.

I'd suggest setting up a final queue that has one permanently available worker object (but not real person) in it. When you get an assignment callback for a reservation for a task in that queue then you can use the redirect assignment to send the call to some TwiML that returns a <Record> to take a message. Your TwiML application can also call the REST API to accept the reservation.

这适用于从未从初始队列分配给工作人员的任务.对于预订超时方面的事情,请考虑这一点.

That works for tasks that are never assigned from the initial queue to a worker. For the reservation timeout side of things, consider this.

当预约超时时,任务会回到原来的队列中再次分配.该任务保持在我们上面为其定义的相同原始超时下,因此当任务本身超时时,最终将移至我们的语音邮件队列.这对呼叫者具有相同的效果,因为他们永远不知道何时分配了预订,因为他们只会在他们所在的队列中体验等待音乐.

When a reservation times out, the task goes back into its original queue for assignment again. The task remains under the same original timeout that we defined for it above, so will eventually move to our voicemail queue when the task itself times out. This has the same effect for the caller, as they never know when a reservation is assigned as they'll just be experiencing the wait music in the queue they are in.

这有意义吗?

这篇关于在任务/保留超时后将 twilio 任务重定向到新的 TwiML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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