How to not offer a task to specific worker on Twilio

橙三吉。 提交于 2019-12-22 06:55:31

问题


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?


回答1:


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.

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.

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.

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


来源:https://stackoverflow.com/questions/38356604/how-to-not-offer-a-task-to-specific-worker-on-twilio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!