如何不向Twilio上的特定工人提供任务 [英] How to not offer a task to specific worker on Twilio

查看:96
本文介绍了如何不向Twilio上的特定工人提供任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Twilio的新手,在设计出站拨号程序时当前遇到问题,当前预览拨号.如果工人拒绝一项任务,则不应再将同一任务提供给该工人. 我该如何处理这种情况?

I am new in Twilio and i have been facing an issue while designing outbound dialer currently preview dialing. If a worker rejects a task than the same task should not be offered to that worker again. How do i handle this case?

推荐答案

通常,如果工作人员拒绝任务,则应将其移至不可用的活动.否则,如果该工作人员是唯一可用且合格的工作人员,则TaskRouter将继续创建新的保留.

Typically if a worker rejects the task, the worker should be moved to an unavailable activity. Otherwise, if the worker is the only available and qualified worker, TaskRouter will continue to create new reservations.

您可以在拒绝时指定一个新的activitySid,以便同时将工作人员移至不可用的活动:

You can specify a new activitySid upon rejection, so that the worker is moved to an unavailable activity at the same time:

https://www.twilio.com/docs/api/taskrouter/worker-js#reservation-reject

在这里,使工作人员活动不可用仅表示工作人员将无法执行任何任务.

Here, making the worker activity unavailable would simply mean the worker will not be able to get any task.

但是让我们看一个更复杂的用例,其中Worker可以接受,拒绝或取消任务.他们需要提供做出选择的机会.

But let's look at a more complicated use case where a Worker can accept, reject or cancel tasks. They need to be available to make this choice.

如果只有该代理,并且可用,那么除非您操纵Task属性或worker属性,以便TaskRouter不分配任务,否则无法阻止该代理接收任务.例如,您可以更新TaskAttributes以使其具有拒绝的工作程序SID列表,然后在工作流中说出worker.sid NOT IN task.rejectedWorkerSids.

If you have only that agent, and they are available, then there is no way to prevent that agent from receiving the Task, unless you manipulate the Task attributes or worker attributes so that TaskRouter doesn’t assign the Task. For example, you could update TaskAttributes to have a rejected worker SID list, and then in the workflow say that worker.sid NOT IN task.rejectedWorkerSids.

今天,此功能已作为漏洞修复程序发布,并且具有执行目标工作者表达式"的功能!看起来应该像这样:

And the ability to do this Target Workers Expression just shipped as a bug fix today! It should look like:

worker.sid NOT IN task.rejectedWorkers

这篇关于如何不向Twilio上的特定工人提供任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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