Twilio TaskRouter:断开连接时更改工作人员活动 [英] Twilio TaskRouter: change worker activity when disconnected

查看:19
本文介绍了Twilio TaskRouter:断开连接时更改工作人员活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设工作人员 X 登录到我们的呼叫中心应用程序并在 twilio 中上线.他现在将能够接受预订并回复人们.X 生活在互联网连接非常不可靠的第三世界国家.他的互联网在上网时突然中断,他无法再回复预订.他的活动仍然是在线,他没有办法改变它,因为他没有互联网连接.当客户端和服务器之间的 WebSocket 连接丢失时,有没有办法告诉 twilio Offline?

Let's say worker X logged in to our call center app and went online in twilio. He will now be able to receive reservations and respond to people. X lives in a third world country where the internet connection is very unreliable. His internet suddenly cut off while online and he is no longer able to respond to reservations. His activity is still Online and he has no way of changing it because he doesn't have an internet connection. Is there a way to tell twilio to go Offline when the WebSocket connection is lost between the client and the server?

我知道我们在 TaskRouter.js 中有 disconnectActivitySid 但它只在 window.unload 事件上触发并且不包括浏览器崩溃的情况或者我们有互联网连接问题.

I'm aware that we have disconnectActivitySid in TaskRouter.js but it is only fired on window.unload event and doesn't cover the cases where the browser crashes or we have internet connectivity problems.

推荐答案

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

Twilio developer evangelist here.

今天唯一的方法是让 Worker 收到下一个 Reservation,但有一个 Workflow ReservationTimeout 半低值(10-15 秒)并利用 Workspace 的 TimeoutActivitySid 以推动 Worker 离线.

The only way to do this today would be to have the Worker receive a next Reservation, but have a Workflow ReservationTimeout of a semi-low value (10-15 seconds) and to utilize the Workspace’s TimeoutActivitySid to push the Worker to Offline.

通过这种设置,如果 Worker 失去连接(但处于空闲状态),并且接收到一个 Reservation 并且能够在该 Reservation 超时之前重新连接(在那个 15 秒窗口中),他们将使用 JS SDK 呈现 Reservation.所以什么都不会丢失.如果他们没有在该超时窗口内重新连接,该 Worker 将被推送到 Offline,另一个 Worker 将有资格接取该 Task.

With that setup, if the Worker loses connection (but is Idle), and receives a Reservation and is able to reconnect before that Reservation Times out (in that 15 second window), they will presented the Reservation with the JS SDK. So nothing will be lost. If they do not reconnect within that timeout window, the Worker will be pushed to Offline, and another Worker will be eligible to pick up the Task.

让我知道这是否有帮助.

Let me know if that helps at all.

这篇关于Twilio TaskRouter:断开连接时更改工作人员活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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