(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0e66c4"],{"994b":function(module,exports,__webpack_require__){var ws;function initwebsocket(cti_ws_url){"WebSocket"in window?ws=new WebSocket(cti_ws_url):alert("do not suports websocket"),ws.onopen=function(e){alert("open websocket success")},ws.onclose=function(e){alert("websocket close")},ws.onmessage=function(evt){var reader=new FileReader;reader.onloadend=function(e){console.log(this.result);var msgdiv=document.getElementById("msg"),span=document.createElement("span");span.innerHTML="receive_msg:"+this.result+"<br />",msgdiv.appendChild(span);var obj=eval("("+this.result+")");"system"==obj.cmd&&"keepalive"==obj.action&&keepalive(obj.seatname,obj.seatnum);var uuid=document.getElementById("uuid");"control"==obj.cmd&&"tp_callin"==obj.action&&(uuid.value=obj.uuid)},reader.readAsText(event.data)},ws.onerror=function(e){alert("websocket error")}}function sendmessage(e){console.log();var a=document.getElementById("msg"),s=document.createElement("span");s.innerHTML="send_msg:"+e+"<br />",a.appendChild(s),ws.send(e)}function testclear(){var e=document.getElementById("msg");e.innerHTML=""}function seatlogin(seatname,seatnum,password,cti_ws_url){"WebSocket"in window?ws=new WebSocket(cti_ws_url):alert("do not suports websocket"),ws.onopen=function(e){if(alert("open websocket success"),""!=seatname)if(""!=seatnum){var a={cmd:"system",action:"seatlogin",seatname:"<seatname>",seatnum:"<seatnum>",password:"<password>",timestamp:"<timestamp>"};a.seatname=seatname,a.seatnum=seatnum,a.password=password;var s=JSON.stringify(a);sendmessage(s)}else alert("seatnum is null");else alert("seatname is null")},ws.onclose=function(e){alert("websocket close")},ws.onmessage=function(evt){var reader=new FileReader;reader.onloadend=function(e){console.log(this.result);var msgdiv=document.getElementById("msg"),span=document.createElement("span");span.innerHTML="receive_msg:"+this.result+"<br />",msgdiv.appendChild(span);var obj=eval("("+this.result+")");"system"==obj.cmd&&"keepalive"==obj.action&&keepalive(obj.seatname,obj.seatnum);var uuid=document.getElementById("uuid");"control"==obj.cmd&&"tp_callin"==obj.action&&(uuid.value=obj.uuid)},reader.readAsText(event.data)},ws.onerror=function(e){alert("websocket error")}}function seatlogout(e,a){if(""!=e)if(""!=a){var s={cmd:"system",action:"seatlogout",seatname:"<seatname>",seatnum:"<seatnum>",timestamp:"<timestamp>"};s.seatname=e,s.seatnum=a;var t=JSON.stringify(s);sendmessage(t),ws.close()}else alert("seatnum is null");else alert("seatname is null")}function afk(e,a){if(""!=e)if(""!=a){var s={cmd:"system",action:"afk",seatname:"<seatname>",seatnum:"<seatnum>",timestamp:"<timestamp>"};s.seatname=e,s.seatnum=a;var t=JSON.stringify(s);sendmessage(t)}else alert("seatnum is null");else alert("seatname is null")}function online(e,a){if(""!=e)if(""!=a){var s={cmd:"system",action:"online",seatname:"<seatname>",seatnum:"<seatnum>",timestamp:"<timestamp>"};s.seatname=e,s.seatnum=a;var t=JSON.stringify(s);sendmessage(t)}else alert("seatnum is null");else alert("seatname is null")}function callout(e,a,s){if(""!=a)if(""!=s){var t={cmd:"control",action:"callout",phone:"<phone>",seatname:"<seatname>",seatnum:"<seatnum>",timestamp:"<timestamp>"};t.phone=s,t.seatname=e,t.seatnum=a;var n=JSON.stringify(t);sendmessage(n)}else alert("phone is null");else alert("seatnum is null")}function transfer(e,a,s,t){if(""!=a)if(""!=s)if(""!=t){var n={cmd:"control",action:"transfer",uuid:"<uuid>",phone:"<phone>",seatname:"<seatname>",seatnum:"<seatnum>",timestamp:"<timestamp>"};n.phone=s,n.seatname=e,n.seatnum=a,n.uuid=t;var m=JSON.stringify(n);sendmessage(m)}else alert("uuid is null");else alert("phone is null");else alert("seatnum is null")}function transferresume(e,a,s,t){if(""!=a)if(""!=s)if(""!=t){var n={cmd:"control",action:"transferresume",uuid:"<uuid>",phone:"<phone>",seatname:"<seatname>",seatnum:"<seatnum>",timestamp:"<timestamp>"};n.phone=s,n.seatname=e,n.seatnum=a,n.uuid=t;var m=JSON.stringify(n);sendmessage(m)}else alert("uuid is null");else alert("phone is null");else alert("seatnum is null")}function hold(e,a,s){if(""!=a)if(""!=s){var t={cmd:"control",action:"hold",uuid:"<uuid>",seatname:"<seatname>",seatnum:"<seatnum>",timestamp:"<timestamp>"};t.uuid=s,t.seatname=e,t.seatnum=a;var n=JSON.stringify(t);sendmessage(n)}else alert("uuid is null");else alert("seatnum is null")}function holdresume(e,a,s){if(""!=a)if(""!=s){var t={cmd:"control",action:"holdresume",uuid:"<uuid>",seatname:"<seatname>",seatnum:"<seatnum>",timestamp:"<timestamp>"};t.uuid=s,t.seatname=e,t.seatnum=a;var n=JSON.stringify(t);sendmessage(n)}else alert("uuid is null");else alert("seatnum is null")}function pickup(e,a){if(""!=a){var s={cmd:"control",action:"pickup",seatname:"<seatname>",seatnum:"<seatnum>",timestamp:"<timestamp>"};s.seatnum=a,s.seatname=e;var t=JSON.stringify(s);sendmessage(t)}else alert("seatnum is null")}function hangup(e,a){if(""!=a){var s={cmd:"control",action:"hangup",seatname:"<seatname>",seatnum:"<seatnum>",timestamp:"<timestamp>"};s.seatnum=a,s.seatname=e;var t=JSON.stringify(s);sendmessage(t)}else alert("seatnum is null")}function remove(e,a,s){if(""!=a)if(""!=s){var t={cmd:"control",action:"remove",phone:"<phone>",seatname:"<seatname>",seatnum:"<seatnum>",timestamp:"<timestamp>"};t.phone=s,t.seatname=e,t.seatnum=a;var n=JSON.stringify(t);sendmessage(n)}else alert("phone is null");else alert("seatnum is null")}function insert(e,a,s){if(""!=a)if(""!=s){var t={cmd:"control",action:"insert",phone:"<phone>",seatname:"<seatname>",seatnum:"<seatnum>",timestamp:"<timestamp>"};t.phone=s,t.seatname=e,t.seatnum=a;var n=JSON.stringify(t);sendmessage(n)}else alert("phone is null");else alert("seatnum is null")}function monitor(e,a,s){if(""!=a)if(""!=s){var t={cmd:"control",action:"monitor",phone:"<phone>",seatname:"<seatname>",seatnum:"<seatnum>",timestamp:"<timestamp>"};t.phone=s,t.seatname=e,t.seatnum=a;var n=JSON.stringify(t);sendmessage(n)}else alert("phone is null");else alert("seatnum is null")}function monitor_to_talk(e,a,s){if(""!=a)if(""!=s){var t={cmd:"control",action:"monitor_to_talk",phone:"<phone>",seatname:"<seatname>",seatnum:"<seatnum>",timestamp:"<timestamp>"};t.phone=s,t.seatname=e,t.seatnum=a;var n=JSON.stringify(t);sendmessage(n)}else alert("phone is null");else alert("seatnum is null")}function monitor_end(e,a,s){if(""!=a)if(""!=s){var t={cmd:"control",action:"monitor_end",phone:"<phone>",seatname:"<seatname>",seatnum:"<seatnum>",timestamp:"<timestamp>"};t.phone=s,t.seatname=e,t.seatnum=a;var n=JSON.stringify(t);sendmessage(n)}else alert("phone is null");else alert("seatnum is null")}function choosecall(e,a,s){if(""!=a)if(""!=s){var t={cmd:"control",action:"choosecall",uuid:"<uuid>",seatname:"<seatname>",seatnum:"<seatnum>",timestamp:"<timestamp>"};t.uuid=s,t.seatname=e,t.seatnum=a;var n=JSON.stringify(t);sendmessage(n)}else alert("uuid is null");else alert("seatnum is null")}function replacecall(e,a,s){if(""!=a)if(""!=s){var t={cmd:"control",action:"replacecall",phone:"<phone>",seatname:"<seatname>",seatnum:"<seatnum>",timestamp:"<timestamp>"};t.phone=s,t.seatname=e,t.seatnum=a;var n=JSON.stringify(t);sendmessage(n)}else alert("phone is null");else alert("seatnum is null")}function three(e,a,s){if(""!=a)if(""!=s){var t={cmd:"control",action:"three",phone:"<phone>",seatname:"<seatname>",seatnum:"<seatnum>",timestamp:"<timestamp>"};t.phone=s,t.seatname=e,t.seatnum=a;var n=JSON.stringify(t);sendmessage(n)}else alert("phone is null");else alert("seatnum is null")}function openseatlist(e,a){if(""!=a){var s={cmd:"status",action:"openseatlist",seatname:"<seatname>",seatnum:"<seatnum>",timestamp:"<timestamp>"};s.seatnum=a,s.seatname=e;var t=JSON.stringify(s);sendmessage(t)}else alert("seatnum is null")}function closeseatlist(e,a){if(""!=a){var s={cmd:"status",action:"closeseatlist",seatname:"<seatname>",seatnum:"<seatnum>",timestamp:"<timestamp>"};s.seatnum=a,s.seatname=e;var t=JSON.stringify(s);sendmessage(t)}else alert("seatnum is null")}function openqueues(e,a){if(""!=a){var s={cmd:"status",action:"openqueues",seatname:"<seatname>",seatnum:"<seatnum>",timestamp:"<timestamp>"};s.seatnum=a,s.seatname=e;var t=JSON.stringify(s);sendmessage(t)}else alert("seatnum is null")}function closequeues(e,a){if(""!=a){var s={cmd:"status",action:"closequeues",seatname:"<seatname>",seatnum:"<seatnum>",timestamp:"<timestamp>"};s.seatnum=a,s.seatname=e;var t=JSON.stringify(s);sendmessage(t)}else alert("seatnum is null")}function opencalllist(e,a){if(""!=a){var s={cmd:"status",action:"opencalllist",seatname:"<seatname>",seatnum:"<seatnum>",timestamp:"<timestamp>"};s.seatnum=a,s.seatname=e;var t=JSON.stringify(s);sendmessage(t)}else alert("seatnum is null")}function closecalllist(e,a){if(""!=a){var s={cmd:"status",action:"closecalllist",seatname:"<seatname>",seatnum:"<seatnum>",timestamp:"<timestamp>"};s.seatnum=a,s.seatname=e;var t=JSON.stringify(s);sendmessage(t)}else alert("seatnum is null")}function openroutelist(e,a){if(""!=a){var s={cmd:"status",action:"openroutelist",seatname:"<seatname>",seatnum:"<seatnum>",timestamp:"<timestamp>"};s.seatnum=a,s.seatname=e;var t=JSON.stringify(s);sendmessage(t)}else alert("seatnum is null")}function closeroutelist(e,a){if(""!=a){var s={cmd:"status",action:"closeroutelist",seatname:"<seatname>",seatnum:"<seatnum>",timestamp:"<timestamp>"};s.seatnum=a,s.seatname=e;var t=JSON.stringify(s);sendmessage(t)}else alert("seatnum is null")}function seatlist(e){if(""!=e){var a={cmd:"status",action:"seatlist",group:"<group>",timestamp:"<timestamp>"};a.group=e;var s=JSON.stringify(a);sendmessage(s)}else alert("group is null")}function queues(){var e={cmd:"status",action:"queues",timestamp:"<timestamp>"},a=JSON.stringify(e);sendmessage(a)}function calllist(){var e={cmd:"status",action:"calllist",timestamp:"<timestamp>"},a=JSON.stringify(e);sendmessage(a)}function routelist(){var e={cmd:"status",action:"routelist",timestamp:"<timestamp>"},a=JSON.stringify(e);sendmessage(a)}function batch(e){if(""!=e){var a={cmd:"status",action:"batch",paramid:"<paramid>",timestamp:"<timestamp>"};a.paramid=e;var s=JSON.stringify(a);sendmessage(s)}else alert("paramid is null")}function batch_start(e,a){if(""!=a){var s={cmd:"system",action:"batch_start",seatname:"<seatname>",seatnum:"<seatnum>",timestamp:"<timestamp>"};s.seatnum=a,s.seatname=e;var t=JSON.stringify(s);sendmessage(t)}else alert("seatnum is null")}function batch_stop(e,a){if(""!=a){var s={cmd:"system",action:"batch_stop",seatname:"<seatname>",seatnum:"<seatnum>",timestamp:"<timestamp>"};s.seatnum=a,s.seatname=e;var t=JSON.stringify(s);sendmessage(t)}else alert("seatnum is null")}function handoff_ready(e,a,s){if(""!=a)if(""!=s){var t={cmd:"control",action:"handoff_ready",uuid:"<uuid>",seatname:"<seatname>",seatnum:"<seatnum>",timestamp:"<timestamp>"};t.uuid=s,t.seatname=e,t.seatnum=a;var n=JSON.stringify(t);sendmessage(n)}else alert("uuid is null");else alert("seatnum is null")}function handoff_call(e,a,s,t){if(""!=a)if(""!=s)if(""!=t){var n={cmd:"control",action:"handoff_call",uuid:"<uuid>",phone:"<phone>",seatname:"<seatname>",seatnum:"<seatnum>",timestamp:"<timestamp>"};n.phone=s,n.seatname=e,n.seatnum=a,n.uuid=t;var m=JSON.stringify(n);sendmessage(m)}else alert("uuid is null");else alert("phone is null");else alert("seatnum is null")}function handoff_resume(e,a,s){if(""!=a)if(""!=s){var t={cmd:"control",action:"handoff_resume",uuid:"<uuid>",seatname:"<seatname>",seatnum:"<seatnum>",timestamp:"<timestamp>"};t.seatname=e,t.seatnum=a,t.uuid=s;var n=JSON.stringify(t);sendmessage(n)}else alert("uuid is null");else alert("seatnum is null")}function handoff_transfer(e,a,s,t){if(""!=a)if(""!=s)if(""!=t){var n={cmd:"control",action:"handoff_transfer",uuid:"<uuid>",phone:"<phone>",seatname:"<seatname>",seatnum:"<seatnum>",timestamp:"<timestamp>"};n.phone=s,n.seatname=e,n.seatnum=a,n.uuid=t;var m=JSON.stringify(n);sendmessage(m)}else alert("uuid is null");else alert("phone is null");else alert("seatnum is null")}function handoff_three(e,a,s){if(""!=a)if(""!=s){var t={cmd:"control",action:"handoff_three",uuid:"<uuid>",seatname:"<seatname>",seatnum:"<seatnum>",timestamp:"<timestamp>"};t.seatname=e,t.seatnum=a,t.uuid=s;var n=JSON.stringify(t);sendmessage(n)}else alert("uuid is null");else alert("seatnum is null")}function keepalive(e,a){if(""!=a){var s={cmd:"system",action:"keepalive",seatname:"<seatname>",seatnum:"<seatnum>",timestamp:"<timestamp>"};s.seatnum=a,s.seatname=e;var t=JSON.stringify(s);sendmessage(t)}else alert("seatnum is null")}function record_start(e,a,s){if(""!=a)if(""!=s){var t={cmd:"control",action:"record_start",uuid:"<uuid>",seatname:"<seatname>",seatnum:"<seatnum>",timestamp:"<timestamp>"};t.uuid=s,t.seatname=e,t.seatnum=a;var n=JSON.stringify(t);sendmessage(n)}else alert("uuid is null");else alert("seatnum is null")}function record_stop(e,a,s){if(""!=a)if(""!=s){var t={cmd:"control",action:"record_stop",uuid:"<uuid>",seatname:"<seatname>",seatnum:"<seatnum>",timestamp:"<timestamp>"};t.uuid=s,t.seatname=e,t.seatnum=a;var n=JSON.stringify(t);sendmessage(n)}else alert("uuid is null");else alert("seatnum is null")}__webpack_require__("8ada")}}]);
|