我正在使用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;
}
如果有更好的一天这样做,我可以修改实时通话,将其挂回到未断开连接的客户端,我很乐意这样做
答案 0 :(得分:0)
在与Twilio支持直接对话后,我转而使用会议室处理所有事情,现在它工作得更顺利,没有任何延误。