Twilio客户持有

Twilio客户持有,twilio,Twilio,我正在使用node.js和twilio客户端 但是,只有在我将呼叫放入等待队列后等待6秒钟,等待呼叫断开连接,我才能将呼叫置于等待状态并检索它。如果我尝试在呼叫方进入等待队列后断开软电话的连接,它也会断开呼叫方的连接 function holdCall(){ console.log(callStatus); //I am passing the agents name, and the current call status which is a boolean to the b

我正在使用node.js和twilio客户端

但是,只有在我将呼叫放入等待队列后等待6秒钟,等待呼叫断开连接,我才能将呼叫置于等待状态并检索它。如果我尝试在呼叫方进入等待队列后断开软电话的连接,它也会断开呼叫方的连接

function holdCall(){
    console.log(callStatus);
    //I am passing the agents name, and the current call status which is a boolean to the back end to modify the call so it is in a hold enqueue    
    socket.emit('holdCall', {agent: '{{client}}', status: callStatus});
    //If the call is currently on hold it returns true and I connect the agent to their custom queue
    if(callStatus){
        params = {"PhoneNumber": $("#number").val(), "State": "{{client}}"};
         call = Twilio.Device.connect(params);
    //if the call is not currently on hold then we want the twilio client to disconnect so the call can be taken off hold.
    }else{
      console.log(call);
      call.disconnect();
    }
    //switch the call status
    callStatus = !callStatus;


  }

如果有更好的一天可以这样做,我可以修改实时通话,将其连接回没有断开连接的客户,我很乐意这样做

在直接与Twilio支持人员交谈后,我转向使用会议室处理所有事情,现在它工作得更加顺利,没有任何延迟。

Twilio evangelist在这里您是否考虑过使用TaskRouter()为您管理呼叫的排队和退队?使用TaskRouter,您可以将呼叫排入TaskQueue。当代理(或TaskRouter术语中的工作者)可用时,呼叫将分配给他们。Twilio会主动要求他们接受任务(如呼叫),如果他们将两个呼叫连接在一起。@devinReader这将如何与我们当前的流程集成。现在,我们的系统中已经内置了所有的路由。我们所要做的就是添加挂起并检索呼叫的功能。我们可以这样做,但Web RTC在呼叫方已处于保留状态时断开呼叫方的连接似乎存在问题。如何将电话提供给代理人?我们不想让电话铃响,我们想让代理按暂停按钮取消呼叫暂停。按照您的描述,它只会提供给下一个可用的代理,这不是真正的等待功能。您如何将客户置于“等待”状态?我正在将他们移至等待队列中。这很有效。然后,为了让它们离开队列,我将它们和代理移动到另一个工作正常的队列。问题是,当您将它们挂起时,代理客户端将保持打开状态6秒钟。在那6秒钟内,你不能让他们离开,等等。如果您让系统断开客户机与呼叫的连接,则允许您将其挂起。但是,如果您尝试在客户机进入新的等待队列后断开客户机的连接,则会断开客户机的连接。我不确定我是否完全遵循了您的工作流。介意把这个发电子邮件吗?devin[at]twilio[dot]com。