var ws;
|
//--------------------------------��������websocket-----------------------------------------//
|
function initwebsocket(cti_ws_url) {
|
if ('WebSocket' in window) {
|
ws = new WebSocket(cti_ws_url);
|
} else {
|
alert("do not suports websocket");
|
}
|
ws.onopen = function(evt) {
|
alert("open websocket success");
|
}
|
ws.onclose = function(evt) {
|
alert("websocket close");
|
}
|
//��������
|
ws.onmessage = function(evt) {
|
var reader = new FileReader();
|
reader.onloadend = function(e) {
|
console.log(this.result);
|
var msgdiv = document.getElementById("msg");
|
var span = document.createElement("span");
|
span.innerHTML = "receive_msg:"+this.result + "<br />";
|
msgdiv.appendChild(span);
|
var obj = eval('(' + this.result + ')');
|
if(obj.cmd=="system"&&obj.action=="keepalive"){
|
keepalive(obj.seatname,obj.seatnum);
|
}
|
var uuid = document.getElementById("uuid");
|
if(obj.cmd=="control"&&obj.action=="tp_callin"){
|
uuid.value=obj.uuid;
|
}
|
};
|
reader.readAsText(event.data);
|
}
|
ws.onerror = function(evt) {
|
alert("websocket error");
|
}
|
}
|
function sendmessage(protocolStr){
|
console.log();
|
var msgdiv = document.getElementById("msg");
|
var span = document.createElement("span");
|
span.innerHTML = "send_msg:"+protocolStr + "<br />";
|
msgdiv.appendChild(span);
|
ws.send(protocolStr);
|
}
|
function testclear(){
|
var msgdiv = document.getElementById("msg");
|
msgdiv.innerHTML="";
|
}
|
//--------------------------------command send-----------------------------------------//
|
//��ϯǩ��
|
function seatlogin(seatname,seatnum,password,cti_ws_url) {
|
if ('WebSocket' in window) {
|
ws = new WebSocket(cti_ws_url);
|
} else {
|
alert("do not suports websocket");
|
}
|
ws.onopen = function(evt) {
|
alert("open websocket success");
|
if(seatname=="")
|
{
|
alert("seatname is null");
|
return;
|
}
|
if(seatnum=="")
|
{
|
alert("seatnum is null");
|
return;
|
}
|
var protocol={"cmd":"system","action":"seatlogin","seatname":"<seatname>","seatnum":"<seatnum>","password":"<password>","timestamp":"<timestamp>"};
|
protocol.seatname=seatname;
|
protocol.seatnum=seatnum;
|
protocol.password=password;
|
var protocolStr=JSON.stringify(protocol);
|
sendmessage(protocolStr);
|
}
|
ws.onclose = function(evt) {
|
alert("websocket close");
|
}
|
//��������
|
ws.onmessage = function(evt) {
|
var reader = new FileReader();
|
reader.onloadend = function(e) {
|
console.log(this.result);
|
var msgdiv = document.getElementById("msg");
|
var span = document.createElement("span");
|
span.innerHTML = "receive_msg:"+this.result + "<br />";
|
msgdiv.appendChild(span);
|
var obj = eval('(' + this.result + ')');
|
if(obj.cmd=="system"&&obj.action=="keepalive"){
|
keepalive(obj.seatname,obj.seatnum);
|
}
|
var uuid = document.getElementById("uuid");
|
if(obj.cmd=="control"&&obj.action=="tp_callin"){
|
uuid.value=obj.uuid;
|
}
|
};
|
reader.readAsText(event.data);
|
}
|
ws.onerror = function(evt) {
|
alert("websocket error");
|
}
|
|
//ws.send(protocolStr);
|
}
|
//��ϯǩ��
|
function seatlogout(seatname,seatnum) {
|
if(seatname=="")
|
{
|
alert("seatname is null");
|
return;
|
}
|
if(seatnum=="")
|
{
|
alert("seatnum is null");
|
return;
|
}
|
var protocol={"cmd":"system","action":"seatlogout","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
|
protocol.seatname=seatname;
|
protocol.seatnum=seatnum;
|
var protocolStr=JSON.stringify(protocol);
|
sendmessage(protocolStr);
|
//ws.send(protocolStr);
|
ws.close();
|
}
|
//����
|
function afk(seatname,seatnum) {
|
if(seatname=="")
|
{
|
alert("seatname is null");
|
return;
|
}
|
if(seatnum=="")
|
{
|
alert("seatnum is null");
|
return;
|
}
|
var protocol={"cmd":"system","action":"afk","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
|
protocol.seatname=seatname;
|
protocol.seatnum=seatnum;
|
var protocolStr=JSON.stringify(protocol);
|
sendmessage(protocolStr);
|
//ws.send(protocolStr);
|
}
|
//����
|
function online(seatname,seatnum) {
|
if(seatname=="")
|
{
|
alert("seatname is null");
|
return;
|
}
|
if(seatnum=="")
|
{
|
alert("seatnum is null");
|
return;
|
}
|
var protocol={"cmd":"system","action":"online","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
|
protocol.seatname=seatname;
|
protocol.seatnum=seatnum;
|
var protocolStr=JSON.stringify(protocol);
|
sendmessage(protocolStr);
|
//ws.send(protocolStr);
|
}
|
//���
|
function callout(seatname,seatnum,phone) {
|
if(seatnum=="")
|
{
|
alert("seatnum is null");
|
return;
|
}
|
if(phone=="")
|
{
|
alert("phone is null");
|
return;
|
}
|
var protocol={"cmd":"control","action":"callout","phone":"<phone>","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
|
protocol.phone=phone;
|
protocol.seatname=seatname;
|
protocol.seatnum=seatnum;
|
var protocolStr=JSON.stringify(protocol);
|
sendmessage(protocolStr);
|
//ws.send(protocolStr);
|
}
|
//ת��
|
function transfer(seatname,seatnum,phone,uuid) {
|
if(seatnum=="")
|
{
|
alert("seatnum is null");
|
return;
|
}
|
if(phone=="")
|
{
|
alert("phone is null");
|
return;
|
}
|
if(uuid=="")
|
{
|
alert("uuid is null");
|
return;
|
}
|
var protocol={"cmd":"control","action":"transfer","uuid":"<uuid>","phone":"<phone>","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
|
protocol.phone=phone;
|
protocol.seatname=seatname;
|
protocol.seatnum=seatnum;
|
protocol.uuid=uuid;
|
var protocolStr=JSON.stringify(protocol);
|
sendmessage(protocolStr);
|
//ws.send(protocolStr);
|
}
|
//ת���ջ�
|
function transferresume(seatname,seatnum,phone,uuid) {
|
if(seatnum=="")
|
{
|
alert("seatnum is null");
|
return;
|
}
|
if(phone=="")
|
{
|
alert("phone is null");
|
return;
|
}
|
if(uuid=="")
|
{
|
alert("uuid is null");
|
return;
|
}
|
var protocol={"cmd":"control","action":"transferresume","uuid":"<uuid>","phone":"<phone>","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
|
protocol.phone=phone;
|
protocol.seatname=seatname;
|
protocol.seatnum=seatnum;
|
protocol.uuid=uuid;
|
var protocolStr=JSON.stringify(protocol);
|
sendmessage(protocolStr);
|
//ws.send(protocolStr);
|
}
|
|
//ͨ������
|
function hold(seatname,seatnum,uuid) {
|
if(seatnum=="")
|
{
|
alert("seatnum is null");
|
return;
|
}
|
if(uuid=="")
|
{
|
alert("uuid is null");
|
return;
|
}
|
var protocol={"cmd":"control","action":"hold","uuid":"<uuid>","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
|
protocol.uuid=uuid;
|
protocol.seatname=seatname;
|
protocol.seatnum=seatnum;
|
var protocolStr=JSON.stringify(protocol);
|
sendmessage(protocolStr);
|
//ws.send(protocolStr);
|
}
|
//ͨ�������ջ�
|
function holdresume(seatname,seatnum,uuid) {
|
if(seatnum=="")
|
{
|
alert("seatnum is null");
|
return;
|
}
|
if(uuid=="")
|
{
|
alert("uuid is null");
|
return;
|
}
|
var protocol={"cmd":"control","action":"holdresume","uuid":"<uuid>","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
|
protocol.uuid=uuid;
|
protocol.seatname=seatname;
|
protocol.seatnum=seatnum;
|
var protocolStr=JSON.stringify(protocol);
|
sendmessage(protocolStr);
|
//ws.send(protocolStr);
|
}
|
//����
|
function pickup(seatname,seatnum) {
|
if(seatnum=="")
|
{
|
alert("seatnum is null");
|
return;
|
}
|
var protocol={"cmd":"control","action":"pickup","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
|
protocol.seatnum=seatnum;
|
protocol.seatname=seatname;
|
var protocolStr=JSON.stringify(protocol);
|
sendmessage(protocolStr);
|
//ws.send(protocolStr);
|
}
|
//�Ҷ�
|
function hangup(seatname,seatnum) {
|
if(seatnum=="")
|
{
|
alert("seatnum is null");
|
return;
|
}
|
var protocol={"cmd":"control","action":"hangup","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
|
protocol.seatnum=seatnum;
|
protocol.seatname=seatname;
|
var protocolStr=JSON.stringify(protocol);
|
sendmessage(protocolStr);
|
//ws.send(protocolStr);
|
}
|
|
//ͨ��ǿ��
|
function remove(seatname,seatnum,phone) {
|
if(seatnum=="")
|
{
|
alert("seatnum is null");
|
return;
|
}
|
if(phone=="")
|
{
|
alert("phone is null");
|
return;
|
}
|
var protocol={"cmd":"control","action":"remove","phone":"<phone>","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
|
protocol.phone=phone;
|
protocol.seatname=seatname;
|
protocol.seatnum=seatnum;
|
var protocolStr=JSON.stringify(protocol);
|
sendmessage(protocolStr);
|
//ws.send(protocolStr);
|
}
|
//ͨ��ǿ��
|
function insert(seatname,seatnum,phone) {
|
if(seatnum=="")
|
{
|
alert("seatnum is null");
|
return;
|
}
|
if(phone=="")
|
{
|
alert("phone is null");
|
return;
|
}
|
var protocol={"cmd":"control","action":"insert","phone":"<phone>","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
|
protocol.phone=phone;
|
protocol.seatname=seatname;
|
protocol.seatnum=seatnum;
|
var protocolStr=JSON.stringify(protocol);
|
sendmessage(protocolStr);
|
//ws.send(protocolStr);
|
}
|
//����
|
function monitor(seatname,seatnum,phone) {
|
if(seatnum=="")
|
{
|
alert("seatnum is null");
|
return;
|
}
|
if(phone=="")
|
{
|
alert("phone is null");
|
return;
|
}
|
var protocol={"cmd":"control","action":"monitor","phone":"<phone>","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
|
protocol.phone=phone;
|
protocol.seatname=seatname;
|
protocol.seatnum=seatnum;
|
var protocolStr=JSON.stringify(protocol);
|
sendmessage(protocolStr);
|
//ws.send(protocolStr);
|
}
|
//����תͨ��
|
function monitor_to_talk(seatname,seatnum,phone) {
|
if(seatnum=="")
|
{
|
alert("seatnum is null");
|
return;
|
}
|
if(phone=="")
|
{
|
alert("phone is null");
|
return;
|
}
|
var protocol={"cmd":"control","action":"monitor_to_talk","phone":"<phone>","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
|
protocol.phone=phone;
|
protocol.seatname=seatname;
|
protocol.seatnum=seatnum;
|
var protocolStr=JSON.stringify(protocol);
|
sendmessage(protocolStr);
|
//ws.send(protocolStr);
|
}
|
//��������
|
function monitor_end(seatname,seatnum,phone) {
|
if(seatnum=="")
|
{
|
alert("seatnum is null");
|
return;
|
}
|
if(phone=="")
|
{
|
alert("phone is null");
|
return;
|
}
|
var protocol={"cmd":"control","action":"monitor_end","phone":"<phone>","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
|
protocol.phone=phone;
|
protocol.seatname=seatname;
|
protocol.seatnum=seatnum;
|
var protocolStr=JSON.stringify(protocol);
|
sendmessage(protocolStr);
|
//ws.send(protocolStr);
|
}
|
//ѡ��
|
function choosecall(seatname,seatnum,uuid) {
|
if(seatnum=="")
|
{
|
alert("seatnum is null");
|
return;
|
}
|
if(uuid=="")
|
{
|
alert("uuid is null");
|
return;
|
}
|
var protocol={"cmd":"control","action":"choosecall","uuid":"<uuid>","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
|
protocol.uuid=uuid;
|
protocol.seatname=seatname;
|
protocol.seatnum=seatnum;
|
var protocolStr=JSON.stringify(protocol);
|
sendmessage(protocolStr);
|
//ws.send(protocolStr);
|
}
|
//����
|
function replacecall(seatname,seatnum,phone) {
|
if(seatnum=="")
|
{
|
alert("seatnum is null");
|
return;
|
}
|
if(phone=="")
|
{
|
alert("phone is null");
|
return;
|
}
|
var protocol={"cmd":"control","action":"replacecall","phone":"<phone>","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
|
protocol.phone=phone;
|
protocol.seatname=seatname;
|
protocol.seatnum=seatnum;
|
var protocolStr=JSON.stringify(protocol);
|
sendmessage(protocolStr);
|
//ws.send(protocolStr);
|
}
|
//����ͨ��
|
function three(seatname,seatnum,phone) {
|
if(seatnum=="")
|
{
|
alert("seatnum is null");
|
return;
|
}
|
if(phone=="")
|
{
|
alert("phone is null");
|
return;
|
}
|
var protocol={"cmd":"control","action":"three","phone":"<phone>","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
|
protocol.phone=phone;
|
protocol.seatname=seatname;
|
protocol.seatnum=seatnum;
|
var protocolStr=JSON.stringify(protocol);
|
sendmessage(protocolStr);
|
//ws.send(protocolStr);
|
}
|
//������ϯ״̬
|
function openseatlist(seatname,seatnum) {
|
if(seatnum=="")
|
{
|
alert("seatnum is null");
|
return;
|
}
|
var protocol={"cmd":"status","action":"openseatlist","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
|
protocol.seatnum=seatnum;
|
protocol.seatname=seatname;
|
var protocolStr=JSON.stringify(protocol);
|
sendmessage(protocolStr);
|
//ws.send(protocolStr);
|
}
|
//�ر���ϯ״̬
|
function closeseatlist(seatname,seatnum) {
|
if(seatnum=="")
|
{
|
alert("seatnum is null");
|
return;
|
}
|
var protocol={"cmd":"status","action":"closeseatlist","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
|
protocol.seatnum=seatnum;
|
protocol.seatname=seatname;
|
var protocolStr=JSON.stringify(protocol);
|
sendmessage(protocolStr);
|
//ws.send(protocolStr);
|
}
|
//�����Ŷ���Ϣ
|
function openqueues(seatname,seatnum) {
|
if(seatnum=="")
|
{
|
alert("seatnum is null");
|
return;
|
}
|
var protocol={"cmd":"status","action":"openqueues","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
|
protocol.seatnum=seatnum;
|
protocol.seatname=seatname;
|
var protocolStr=JSON.stringify(protocol);
|
sendmessage(protocolStr);
|
//ws.send(protocolStr);
|
}
|
//�ر��Ŷ���Ϣ
|
function closequeues(seatname,seatnum) {
|
if(seatnum=="")
|
{
|
alert("seatnum is null");
|
return;
|
}
|
var protocol={"cmd":"status","action":"closequeues","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
|
protocol.seatnum=seatnum;
|
protocol.seatname=seatname;
|
var protocolStr=JSON.stringify(protocol);
|
sendmessage(protocolStr);
|
//ws.send(protocolStr);
|
}
|
//����ͨ����Ϣ
|
function opencalllist(seatname,seatnum) {
|
if(seatnum=="")
|
{
|
alert("seatnum is null");
|
return;
|
}
|
var protocol={"cmd":"status","action":"opencalllist","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
|
protocol.seatnum=seatnum;
|
protocol.seatname=seatname;
|
var protocolStr=JSON.stringify(protocol);
|
sendmessage(protocolStr);
|
//ws.send(protocolStr);
|
}
|
//�ر�ͨ����Ϣ
|
function closecalllist(seatname,seatnum) {
|
if(seatnum=="")
|
{
|
alert("seatnum is null");
|
return;
|
}
|
var protocol={"cmd":"status","action":"closecalllist","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
|
protocol.seatnum=seatnum;
|
protocol.seatname=seatname;
|
var protocolStr=JSON.stringify(protocol);
|
sendmessage(protocolStr);
|
//ws.send(protocolStr);
|
}
|
//�����м���Ϣ
|
function openroutelist(seatname,seatnum) {
|
if(seatnum=="")
|
{
|
alert("seatnum is null");
|
return;
|
}
|
var protocol={"cmd":"status","action":"openroutelist","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
|
protocol.seatnum=seatnum;
|
protocol.seatname=seatname;
|
var protocolStr=JSON.stringify(protocol);
|
sendmessage(protocolStr);
|
//ws.send(protocolStr);
|
}
|
//�ر��м���Ϣ
|
function closeroutelist(seatname,seatnum) {
|
if(seatnum=="")
|
{
|
alert("seatnum is null");
|
return;
|
}
|
var protocol={"cmd":"status","action":"closeroutelist","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
|
protocol.seatnum=seatnum;
|
protocol.seatname=seatname;
|
var protocolStr=JSON.stringify(protocol);
|
sendmessage(protocolStr);
|
//ws.send(protocolStr);
|
}
|
|
|
|
//��ȡ��ϯ��Ϣ
|
function seatlist(group) {
|
if(group=="")
|
{
|
alert("group is null");
|
return;
|
}
|
var protocol={"cmd":"status","action":"seatlist","group":"<group>","timestamp":"<timestamp>"};
|
protocol.group=group;
|
var protocolStr=JSON.stringify(protocol);
|
sendmessage(protocolStr);
|
//ws.send(protocolStr);
|
}
|
|
//��ȡ�Ŷ���Ϣ
|
function queues() {
|
var protocol={"cmd":"status","action":"queues","timestamp":"<timestamp>"};
|
var protocolStr=JSON.stringify(protocol);
|
sendmessage(protocolStr);
|
//ws.send(protocolStr);
|
}
|
//��ȡͨ����Ϣ
|
function calllist() {
|
var protocol={"cmd":"status","action":"calllist","timestamp":"<timestamp>"};
|
var protocolStr=JSON.stringify(protocol);
|
sendmessage(protocolStr);
|
//ws.send(protocolStr);
|
}
|
//��ȡ�м���Ϣ
|
function routelist() {
|
var protocol={"cmd":"status","action":"routelist","timestamp":"<timestamp>"};
|
var protocolStr=JSON.stringify(protocol);
|
sendmessage(protocolStr);
|
//ws.send(protocolStr);
|
}
|
//��ȡ�������������Ϣ
|
function batch(paramid) {
|
if(paramid=="")
|
{
|
alert("paramid is null");
|
return;
|
}
|
var protocol={"cmd":"status","action":"batch","paramid":"<paramid>","timestamp":"<timestamp>"};
|
protocol.paramid=paramid;
|
var protocolStr=JSON.stringify(protocol);
|
sendmessage(protocolStr);
|
//ws.send(protocolStr);
|
}
|
//��ʼ�������
|
function batch_start(seatname,seatnum) {
|
if(seatnum=="")
|
{
|
alert("seatnum is null");
|
return;
|
}
|
var protocol={"cmd":"system","action":"batch_start","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
|
protocol.seatnum=seatnum;
|
protocol.seatname=seatname;
|
var protocolStr=JSON.stringify(protocol);
|
sendmessage(protocolStr);
|
//ws.send(protocolStr);
|
}
|
//�ر��������
|
function batch_stop(seatname,seatnum) {
|
if(seatnum=="")
|
{
|
alert("seatnum is null");
|
return;
|
}
|
var protocol={"cmd":"system","action":"batch_stop","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
|
protocol.seatnum=seatnum;
|
protocol.seatname=seatname;
|
var protocolStr=JSON.stringify(protocol);
|
sendmessage(protocolStr);
|
//ws.send(protocolStr);
|
}
|
//ͨ����ѯ��ʼ
|
function handoff_ready(seatname,seatnum,uuid) {
|
if(seatnum=="")
|
{
|
alert("seatnum is null");
|
return;
|
}
|
if(uuid=="")
|
{
|
alert("uuid is null");
|
return;
|
}
|
var protocol={"cmd":"control","action":"handoff_ready","uuid":"<uuid>","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
|
protocol.uuid=uuid;
|
protocol.seatname=seatname;
|
protocol.seatnum=seatnum;
|
var protocolStr=JSON.stringify(protocol);
|
sendmessage(protocolStr);
|
//ws.send(protocolStr);
|
}
|
//��ѯ
|
function handoff_call(seatname,seatnum,phone,uuid) {
|
if(seatnum=="")
|
{
|
alert("seatnum is null");
|
return;
|
}
|
if(phone=="")
|
{
|
alert("phone is null");
|
return;
|
}
|
if(uuid=="")
|
{
|
alert("uuid is null");
|
return;
|
}
|
var protocol={"cmd":"control","action":"handoff_call","uuid":"<uuid>","phone":"<phone>","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
|
protocol.phone=phone;
|
protocol.seatname=seatname;
|
protocol.seatnum=seatnum;
|
protocol.uuid=uuid;
|
var protocolStr=JSON.stringify(protocol);
|
sendmessage(protocolStr);
|
//ws.send(protocolStr);
|
}
|
//��ѯ�ջ�
|
function handoff_resume(seatname,seatnum,uuid) {
|
if(seatnum=="")
|
{
|
alert("seatnum is null");
|
return;
|
}
|
if(uuid=="")
|
{
|
alert("uuid is null");
|
return;
|
}
|
var protocol={"cmd":"control","action":"handoff_resume","uuid":"<uuid>","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
|
protocol.seatname=seatname;
|
protocol.seatnum=seatnum;
|
protocol.uuid=uuid;
|
var protocolStr=JSON.stringify(protocol);
|
sendmessage(protocolStr);
|
//ws.send(protocolStr);
|
}
|
//��ѯת��
|
function handoff_transfer(seatname,seatnum,phone,uuid) {
|
if(seatnum=="")
|
{
|
alert("seatnum is null");
|
return;
|
}
|
if(phone=="")
|
{
|
alert("phone is null");
|
return;
|
}
|
if(uuid=="")
|
{
|
alert("uuid is null");
|
return;
|
}
|
var protocol={"cmd":"control","action":"handoff_transfer","uuid":"<uuid>","phone":"<phone>","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
|
protocol.phone=phone;
|
protocol.seatname=seatname;
|
protocol.seatnum=seatnum;
|
protocol.uuid=uuid;
|
var protocolStr=JSON.stringify(protocol);
|
sendmessage(protocolStr);
|
//ws.send(protocolStr);
|
}
|
//��ѯ����
|
function handoff_three(seatname,seatnum,uuid) {
|
if(seatnum=="")
|
{
|
alert("seatnum is null");
|
return;
|
}
|
if(uuid=="")
|
{
|
alert("uuid is null");
|
return;
|
}
|
var protocol={"cmd":"control","action":"handoff_three","uuid":"<uuid>","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
|
protocol.seatname=seatname;
|
protocol.seatnum=seatnum;
|
protocol.uuid=uuid;
|
var protocolStr=JSON.stringify(protocol);
|
sendmessage(protocolStr);
|
//ws.send(protocolStr);
|
}
|
//����
|
function keepalive(seatname,seatnum) {
|
if(seatnum=="")
|
{
|
alert("seatnum is null");
|
return;
|
}
|
var protocol={"cmd":"system","action":"keepalive","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
|
protocol.seatnum=seatnum;
|
protocol.seatname=seatname;
|
var protocolStr=JSON.stringify(protocol);
|
sendmessage(protocolStr);
|
}
|
//ͨ������¼��
|
function record_start(seatname,seatnum,uuid) {
|
if(seatnum=="")
|
{
|
alert("seatnum is null");
|
return;
|
}
|
if(uuid=="")
|
{
|
alert("uuid is null");
|
return;
|
}
|
var protocol={"cmd":"control","action":"record_start","uuid":"<uuid>","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
|
protocol.uuid=uuid;
|
protocol.seatname=seatname;
|
protocol.seatnum=seatnum;
|
var protocolStr=JSON.stringify(protocol);
|
sendmessage(protocolStr);
|
//ws.send(protocolStr);
|
}
|
//ͨ��ֹͣ¼��
|
function record_stop(seatname,seatnum,uuid) {
|
if(seatnum=="")
|
{
|
alert("seatnum is null");
|
return;
|
}
|
if(uuid=="")
|
{
|
alert("uuid is null");
|
return;
|
}
|
var protocol={"cmd":"control","action":"record_stop","uuid":"<uuid>","seatname":"<seatname>","seatnum":"<seatnum>","timestamp":"<timestamp>"};
|
protocol.uuid=uuid;
|
protocol.seatname=seatname;
|
protocol.seatnum=seatnum;
|
var protocolStr=JSON.stringify(protocol);
|
sendmessage(protocolStr);
|
//ws.send(protocolStr);
|
}
|
|
//---------------------------------------------------------------------------------//
|