Twilio 客户端保留
Twilio Client hold
我正在使用 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 支持人员交谈后,我转而使用会议室来处理所有事情,现在它工作得更加顺畅,没有任何延迟。
我正在使用 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 支持人员交谈后,我转而使用会议室来处理所有事情,现在它工作得更加顺畅,没有任何延迟。