小型客户服务团队的 Twilio 呼叫路由/管理 [英] Twilio call routing/management for small customer service team

查看:28
本文介绍了小型客户服务团队的 Twilio 呼叫路由/管理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Twilio Javascript 客户端 SDK 为具有以下条件的小型客户服务团队创建电话系统:

  1. 每个客户都可以查看是否有多个电话同时拨入并选择接听哪个电话
  2. 每个客户端都可以将呼叫转移到另一个客户端

据我所知,无法看到多个来电

也就是说,在转接电话时,如果电话同时响铃,则接收转接电话的客户端无法看到/接听来电.

我们有一个小团队(一次有 2-4 个在线客户)在同一个办公室工作.似乎 TaskRouter 是唯一可行的选择,但考虑到我们团队的规模和我试图解决的问题的简单性,感觉有点过分.

任何帮助将不胜感激.

解决方案

我想我会回答我自己的问题,因为我已经为自己解决了这个问题.

在我阅读的任何文档或堆栈溢出问题中,我都没有看到任何提到可以使用 JavaScript SDK 在浏览器中处理多个传入呼叫的​​内容.但是,我已经能够这样做了.似乎每个 Twilio.Device() 都可以有多个连接.因此,通过创建一个如下所述的新手机容器,您可以分别管理每个容器.

HTML

<div class="phone_container" call_sid=""><div class="well well-sm call-status">连接到 Twilio...

<div class="phone_btn_container"><button class="btn btn-md btn-success answer-button" disabled>Answer</button><button class="btn btn-md btn-danger hangup-button" disabled>End</button><button class="btn btn-md btn-default mute-button" disabled>静音</button>

Javascript

device.on('incoming', function(connection) {//获取电话号码var call_sid = connection.parameters.CallSid//获取包含按钮和呼叫状态等的电话容器.var phone_container = $('.phone_container')//如果只有一个容器并且它是空的,用这个来处理调用if (phone_container.length == 1 &&phone_container.attr('call_sid') == '') {//将调用 sid 设置为容器$('.phone_container').attr('call_sid', call_sid)}//否则为新呼叫克隆电话容器别的 {//克隆,设置调用 sid 并附加到主容器$('.phone_container').first().clone().attr('call_sid', call_sid).appendTo($('#main_container'))}});

关于转接电话,我使用了会议室来管理.类似于 Devin Rader 对这个问题的回答:Twilio - How将现有呼叫转移到会议

I am trying to create a phone system with Twilio Javascript client SDK for a small customer service team with the following criteria:

  1. each Client can see if multiple calls are coming in at the same time and choose which one to answer
  2. each Client can transfer a call to another Client

From what I can tell there is no way to see multiple incoming calls

Which means, when transferring a call, if the phone is also ringing at the same time, the Client who is to be receiving the transferred call cannot see/accept the incoming call.

We have a small team (between 2-4 Clients online at any one time) working from the same office. It seems like TaskRouter is the only viable option but feels like overkill considering the size of our team and the simplicity of the problem I am trying to solve.

Any help would be much appreciated.

解决方案

I thought I'd answer my own question as I have solved this problem for myself.

Nowhere in any of the docs or stack overflow questions I read did I see any mention that handling multiple incoming calls is possible within the browser with the JavaScript SDK. However, I have been able to do so. It seems that each Twilio.Device() can have multiple Connections. So by creating a new phone container as outlined bellow, you can manage each separately.

HTML

<div id="main_container">
    <div class="phone_container" call_sid="">
        <div class="well well-sm call-status">
            Connecting to Twilio...
        </div>

        <div class="phone_btn_container">
            <button class="btn btn-md btn-success answer-button" disabled>Answer</button>
            <button class="btn btn-md btn-danger hangup-button" disabled>End</button>
            <button class="btn btn-md btn-default mute-button" disabled>Mute</button>
        </div>
    </div>
</div>

Javascript

device.on('incoming', function(connection) {

    // get call sid
    var call_sid = connection.parameters.CallSid

    // get phone container which holds the buttons and call status etc.
    var phone_container = $('.phone_container')

    // if there is only one container and it's empty, use this to handle call
    if (phone_container.length == 1 && phone_container.attr('call_sid') == '') {
        // set call sid to container
        $('.phone_container').attr('call_sid', call_sid)
    }

    // else clone phone container for new call
    else {
        // clone , set call sid and append to main container
        $('.phone_container').first().clone().attr('call_sid', call_sid).appendTo($('#main_container'))
    }

});

In regards to transferring calls, I have used conference rooms to manage this. Similar to Devin Rader's answer to this question: Twilio - How to move an existing call to a conference

这篇关于小型客户服务团队的 Twilio 呼叫路由/管理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
其他开发最新文章
热门教程
热门工具
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆