简体   繁体   English

Twilio TaskRouter 无服务器预留功能

[英]Twilio TaskRouter Serverless Reservation Function

Has anyone completed or found a guide on routing/ accepting a task router reservation?有没有人完成或找到有关路由/接受任务路由器预留的指南?

Example flow:示例流程:

Call # > picked up by Twilio Studio and enqueued to TaskRouter Workspace with attributes > task router workflow associates to a taskrouter queue and finds available agent > [i need to connect this call to the workers attribute which is their sip:phonenumber呼叫 # > 由 Twilio Studio 接听并通过属性排入 TaskRouter 工作区 > 任务路由器工作流关联到任务路由器队列并找到可用代理 > [我需要将此呼叫连接到工人属性,即他们的 sip:phonenumber

I'm trying to avoid an aws server and lambda while keeping this entire orchestration native to twilio via function.我试图避免使用 aws 服务器和 lambda,同时通过函数将整个编排保持在 twilio 本地。

Twilio developer evangelist here. Twilio 开发人员布道者在这里。

The docs on dealing with the TaskRouter reservation callback are here . 有关处理 TaskRouter 保留回调文档在此处 When you receive the callback you need to respond with JSON describing the action you want to do.当您收到回调时,您需要使用 JSON 进行响应,描述您想要执行的操作。

The simplest instruction to connect the call from task to the worker that receives the reservation is to use the dequeue instruction .将 task 的调用连接到接收预留的 worker 的最简单指令是使用dequeue 指令 In a Twilio Function that would look like this:在如下所示的 Twilio 函数中:

exports.handler = function (context, event, callback) {
  callback(null, {
    instruction: "dequeue"
  });
}

To make this connect, your worker needs a contact_uri attribute that points to their address, in this case their SIP phone number.要进行此连接,您的工作人员需要一个指向其地址的contact_uri属性,在本例中为他们的 SIP 电话号码。 Alternatively, you can add a to attribute to the dequeue instruction with the address.或者,您可以to带有地址的出队指令添加to属性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM