WebSocket实际运用

接口HTML文档:此页面方法为提供给第三方接口对接方法,开头要配置服务器地址和端口
<script type="text/javascript">

            //alert('cti-applet-ape.html');
            var ws_server = "192.168.3.6";
            var ws_port = 1987;
            var socket_ready = false;
            var cti_websocket = null;
            //var callcenter = window.parent.CallCenter;
			var login_agent_id ="";
			var login_agent_pwd = "";
			var login_agent_ext = "";
			var websocketId = "";

			var socket_reconnect_flag = false;

			var ws_uri = "";

			var cticall_flag = false;

			var serialNumberQJ;

			function ccapi_socket_login(agent_id,agent_pwd,agent_ext,callback)
			{
				login_agent_id = agent_id;
				login_agent_pwd = agent_pwd;
				login_agent_ext = agent_ext;
				
				//login_agent_id = "1101";
				//login_agent_pwd = "123456";
				//login_agent_ext = "1001";
				console.log(login_agent_id + "," + login_agent_pwd + "," + login_agent_ext);
				init_websocket(callback);
			}

			function websocket_send_msg(msg_obj)
			{
				if(socket_ready)
				{
					cti_websocket.send(JSON.stringify(msg_obj));
					console.log(JSON.stringify(msg_obj));
                    
				}else{
					alert("电话已掉线,请重新登录");
				}
			}

			function agentLogin()
			{
			console.log("----agentLogin----");
				var json_obj = new Object();
				json_obj.eventCode = "Login";
				json_obj.agent_id = login_agent_id
				json_obj.password = login_agent_pwd;
				json_obj.extension = login_agent_ext;
				websocket_send_msg(json_obj);
			}

			function agentLogoff ()
			{
				var json_obj = new Object();
				json_obj.eventCode = "Logoff";
				websocket_send_msg(json_obj);
			}

			function ccapi_AgentSetReady()
			{
				var json_obj = new Object();
				json_obj.eventCode = "setIdle";
				websocket_send_msg(json_obj);
			}

			function ccapi_AgentSetPause()
			{
				var json_obj = new Object();
				json_obj.eventCode = "setPause";
				websocket_send_msg(json_obj);
			}

			function ccapi_AnswerCall()
			{
				var json_obj = new Object();
				json_obj.eventCode = "answerCall";
				websocket_send_msg(json_obj);
			}

			function ccapi_AgentHangup()
			{
				var json_obj = new Object();
				json_obj.eventCode = "Hangup";
				json_obj.cticall_flag = cticall_flag ? "1" : "0";
				websocket_send_msg(json_obj);
			}

			function ccapi_CallOut(callerNumber,calledNumber)
			{
				var json_obj = new Object();
				json_obj.eventCode = "Callout";
				json_obj.caller_number = callerNumber;

				json_obj.called_number = calledNumber;
				cticall_flag = true;
				websocket_send_msg(json_obj);
			}
			//来电提示信息
			function FSK(phone, serialNumber) {
			    if (serialNumberQJ==serialNumber) {
			        return;
			    } else {
			        serialNumberQJ = serialNumber;
			        window.open("../Case/SaveToCasePublic.aspx?evtSource=1a208f06-7470-446c-82cc-a40d863f406e&fakeId=" + phone + "&transType=3");
			    }
			    
			}
			//转移到坐席
			function ccapi_agentTransfer(agent_id)
			{
				var json_obj = new Object();
				json_obj.eventCode = "Transfer";
				json_obj.transferType = "Agent";
				json_obj.transferDest = agent_id;
				websocket_send_msg(json_obj);
			}

			function ccapi_extensionTransfer(ext_number)
			{
				var json_obj = new Object();
				json_obj.eventCode = "Transfer";
				json_obj.transferType = "Extension";
				json_obj.transferDest = ext_number;
				websocket_send_msg(json_obj);
			}

			function ccapi_outSideTransfer(phoneNumber)
			{
				var json_obj = new Object();
				json_obj.eventCode = "Transfer";
				json_obj.transferType = "Outside";
				json_obj.transferDest = "9" + phoneNumber;

				websocket_send_msg(json_obj);
			}

			//监听坐席
			function ccapi_listenAgent(agent_id)
			{
				var json_obj = new Object();
				json_obj.eventCode = "ForceListen";
				json_obj.monitorDest = agent_id ;//this.leaderMember;
				websocket_send_msg(json_obj);
			}

			//拦截坐席
			function ccapi_blockAgent(agent_id)
			{
				var json_obj = new Object();
				json_obj.eventCode = "TakeOver";
				json_obj.monitorDest = agent_id ;//this.leaderMember;
				websocket_send_msg(json_obj);
			}
			//强插
			function ccapi_forceInsert(agent_id)
			{
				var json_obj = new Object();
				json_obj.eventCode = "ForceInsert";
				json_obj.monitorDest = agent_id ;//this.leaderMember;
				websocket_send_msg(json_obj);
			}

			//强拆
			function ccapi_forceRemove(agent_id)
			{
				var json_obj = new Object();
				json_obj.eventCode = "ForceHangup";
				json_obj.monitorDest = agent_id ;//this.leaderMember;
				websocket_send_msg(json_obj);

			}

			function ccapi_stopListen()
			{
				var json_obj = new Object();
				json_obj.eventCode = "LeaderFinish";
				websocket_send_msg(json_obj);
			}

			//呼叫保持函数
			function ccapi_HoldLine()
			{
				alert('ccapi_HoldLine');
				var json_obj = new Object();
				json_obj.eventCode = "HoldOn";
				websocket_send_msg(json_obj);
			}

			//解除呼叫保持
			function ccapi_DisHoldLine()
			{
				var json_obj = new Object();
				json_obj.eventCode = "HoldOff";
				websocket_send_msg(json_obj);
			}

			//获取空闲坐席列表
			function ccapi_requestIdleAgent()
			{
				var json_obj = new Object();
				json_obj.eventCode = "ReqAgentList";
				json_obj.req_agent_state = "Idle";
				websocket_send_msg(json_obj);
			}

			function ccapi_requestIdleExtn()
			{
				var json_obj = new Object();
				json_obj.eventCode = "ReqAgentList";
				json_obj.req_agent_state = "IdleExtn";
				websocket_send_msg(json_obj);
			}

			//获取通话坐席列表
			function ccapi_requestTalkingAgent()
			{
				var json_obj = new Object();
				json_obj.eventCode = "ReqAgentList";
				json_obj.req_agent_state = "Talking";
				websocket_send_msg(json_obj);
			}

			function websocket_msg_decode(msg)
			{
				console.log("----websocket_msg_decode----\n" + msg);
				var json_msg = eval("(" + msg + ")");
				var msg_box = window.parent.document.getElementById("debugTextArea");
				//msg_box.value = msg_box.value + msg;
				if(websocketId == "" && (json_msg.eventCode == "Hello" || json_msg.eventCode == "hello"))
				{
					websocketId = json_msg.websocket_id;
					agentLogin();
					return;
				}

				if(json_msg.eventCode == "notifyState")
				{
					window.parent.cc_setAgentCurState(json_msg.agentState);
					return;
				}

				if(json_msg.eventCode == "ReqAgentList")
				{
					window.parent.cc_ReqAgentRet(json_msg);
					return;
				}
			}

			function socket_evt_close()
			{
				//alert(socket_ready);
				socket_reconnect_flag = true;
				websocketId = "";
				setTimeout('init_websocket()',5000);
			}

			function init_websocket(callback)
			{
				try{
					if (!!window.WebSocket && window.WebSocket.prototype.send)
					{

					}else{
						alert("浏览器不支持,请更换高版本浏览器!");
						return;
					}
					if(window.WebSocket)
					{
                         
						if (typeof MozWebSocket == 'function'){
							this.websocket = MozWebSocket;
						}
// 						var ws_uri = "ws://" + ws_server + ":" + ws_port;
						ws_uri = "ws://" + ws_server + ":" + ws_port;
		                if(cti_websocket == null)
		                {
	                		cti_websocket = new WebSocket(ws_uri);
		                }else{
		                	cti_websocket.close();
							cti_websocket = null;
		                	cti_websocket = new WebSocket(ws_uri);
		                }
		                cti_websocket.onopen = function (evt)
		                {
		                	socket_ready = true;
		                    //callcenter.setAgentState(callcenter.agentState.connect);
		                	if (typeof callback == "function") {
		                	    callback();
		                	}
		                };
		                cti_websocket.onclose = function (evt)
		                {
							cti_websocket = null;
							socket_evt_close();
		                };
		                cti_websocket.onmessage = function (evt)
		                {
		                	websocket_msg_decode(evt.data);
		                };
		                cti_websocket.onerror = function(evt){
		                	socket_ready = false;
		                	cti_websocket = null;
		                	if (typeof callback == "function") {
		                	    callback();
		                	}
						}
					}
				}catch (exception) {
		            alert('ERROR: ' + exception);
		        }
			}
    </script>
js过度方法
var CallCenter= {
		cti_server_addr:"",
		cti_server_port:0,
		ws_uri:"",
		callerNumber :"12319",
		leaderType : 0,
		leader_request_type : {
			Listen : 1,
			Block : 2,
			Insert : 3,
			Remove : 4,
			Transfer : 5
		},
		teamLeaderType:0,
		agentInfo:null,
		agentStateObj:null,
		agent_state_cn: {
			Error : "连接失败",
			Connect : "连接成功",
			Disconnect : "电话掉线",
			Pause : "暂停状态",
			Idle : "空闲状态",
			Callout : "外拨状态",
			Talking : "通话状态",
			Ring : "振铃状态",
			WaitAnswer : "等待接听",
			HoldOn:"保持状态",
			HoldOff:'保持取消'
				
		},
		agent_state_en : {
			Idle : 'Idle',
			Pause : 'Pause',
			Callout : 'Callout',
			Talking : 'Talking',
			Ring : 'Ring',
			WaitAnswer:'WaitAnswer',
			PostProcess : 'PostProcess',
			Disconnect : 'Disconnect',
			HoldOn:'HoldOn',
			HoldOff:'HoldOff'
		}
};

var Callout_On = "<img title='外拨电话' src='softphone/other/softphone/cti/images/Callout_On.png' onClick='ShowDivProc(3)' width='51' height='60' border='0'>";
//外呼灰色按钮
var Callout_Off =  "<img src='softphone/other/softphone/cti/images/Callout_Off.png'  width='51' height='60' border='0'>";
//置闲按钮
var Idle_On = "<img title='置闲' src='softphone/other/softphone/cti/images/Idle_On.png' onClick='cc_OnIdle()' width='51' height='60' border='0'>";
var Idle_Off = "<img  src='softphone/other/softphone/cti/images/Idle_Off.png' width='51' height='60' border='0'>";
//置忙按钮
var Pause_On = "<img title='外拨电话' src='softphone/other/softphone/cti/images/Pause_On.png' onClick='cc_OnPause()' width='51' height='60' border='0'>";
//挂机按钮
var Hook_Hangup = "<img title='挂机' src='softphone/other/softphone/cti/images/Hangup_On.png' onClick='cc_Hungup()'  width='51' height='60' border='0'>";
//摘机按钮
var Hook_Answer = "<img title='摘机' src='softphone/other/softphone/cti/images/Answer_On.png' onClick='cc_Answer()' width='51' height='60' border='0'>";
//摘/挂机 灰色按钮
	var Hook_Off = "<img src='softphone/other/softphone/cti/images/Answer_Off.png' width='51' height='60' border='0'>";
//-------------------------------------------------------------------------------------------
//保持按钮
var Hold_On = "<img title='保持' src='softphone/other/softphone/cti/images/HoldLine_On.png' onClick='cc_HoldLine()' width='51' height='60' border='0'>";
//取消保持按钮
var CancelHold = "<img title='取消保持' src='softphone/other/softphone/cti/images/CancelHold_On.png' onClick='cc_DisHoldLine()' width='51' height='60' border='0'>";
//保持灰色按钮
var Hold_Off = "<img src='softphone/other/softphone/cti/images/HoldLine_Off.png' width='51' height='60' border='0'>";
//---------------------------------------------------------------------------------------------
//转移按钮
var Transfer_On = "<img title='电话转移' src='softphone/other/softphone/cti/images/Transfer_On.png' οnclick='ShowDivProc(1)' width='51' height='60' border='0'>";
var Transfer_Off = "<img src='softphone/other/softphone/cti/images/Transfer_Off.png' width='51' height='60' border='0'>";
//---------------------------------------------------------------------------------------------
//会议按钮
var Meeting_On = "<img title='电话会议' src='softphone/other/softphone/cti/images/Meeting_On.png' onClick='ShowDivProc(2)' width='51' height='60' border='0'>";
var stopMeeting = "<img title='停止会议' src='softphone/other/softphone/cti/images/stopMeeting.jpg' onClick='on_StopMetting()' width='51' height='60' border='0'>";
var Meeting_Off = "<img src='softphone/other/softphone/cti/images/Meeting_Off.png' width='51' height='60' border='0'>";
//---------------------------------------------------------------------------------------------
//监听按钮
var Listen_On = "<img title='监听座席' src='softphone/other/softphone/cti/images/Listen_On.png' οnclick='ShowDivProc(4)' width='51' height='60' border='0'>";
var stopListen ="<img title='停止监听' src='softphone/other/softphone/cti/images/stopListen.png' οnclick='cc_doStopListen(1)' width='51' height='60' border='0'>";
var Listen_Off = "<img src='softphone/other/softphone/cti/images/Listen_Off.png' width='51'  height='60' border='0'>";
//---------------------------------------------------------------------------------------------
//拦截按钮
var Block_On = "<img title='拦截座席' src='softphone/other/softphone/cti/images/Block_On.png' onClick='ShowDivProc(5)' width='51' height='60' border='0'>";
var Block_Off = "<img src='softphone/other/softphone/cti/images/Block_Off.png' width='51' height='60' border='0'>";
//---------------------------------------------------------------------------------------------
//强插按钮
var Insert_On = "<img title='电话强插' src='softphone/other/softphone/cti/images/ForceInsert_On.png' onClick='ShowDivProc(6)' width='51' height='60' border='0'>";
var stopInsert = "<img title='停止强插' src='softphone/other/softphone/cti/images/stopInsert.png' οnclick='cc_doStopListen(2)' width='51' height='60' border='0'>";
var Insert_Off = "<img src='softphone/other/softphone/cti/images/ForceInsert_Off.png' width='51' height='60' border='0'>";
//---------------------------------------------------------------------------------------------
//强拆按钮
var Remove_On = "<img title='电话强拆' src='softphone/other/softphone/cti/images/ForceRemove_On.png' onClick='ShowDivProc(7)' width='51' height='60' border='0'>";
var Remove_Off = "<img src='softphone/other/softphone/cti/images/ForceRemove_Off.png' width='51' height='60' border='0'>";
//退出按钮
var Exit_On = "<img title='退出登录' src='softphone/other/softphone/cti/images/Exit_On.png' οnclick='cc_Logoff()' width='51' height='60' border='0'>";
var Exit_Off = "<img title='退出登录' src='softphone/other/softphone/cti/images/Exit_Off.png' width='51' height='60' border='0'>";

 
function  cc_setButtonState(button_id,State_String)
{
    document.getElementById(button_id).innerHTML = State_String;
}

function cc_setAgentCurState(state)
{
	
}

function cc_setAgentStateText(stateStr)
{
	currentAgentState = stateStr;
	document.getElementById("cc_curState").innerHTML = stateStr;
}

function cc_setAgentCurState(state)
{
	if(state == CallCenter.agent_state_en.Pause)
	{
		cc_setAgentStateText(CallCenter.agent_state_cn.Pause);
		cc_setButtonState("cc_Callout_id",Callout_On);	 //外呼按钮打开Callout_On
	     cc_setButtonState("cc_Hold_id",Hold_Off); 		//保持按钮关闭
	     cc_setButtonState("cc_HoldLine_id",Idle_On);
	     cc_setButtonState("cc_Transfer_id",Transfer_Off);  //转移按钮关闭
	     //cc_setButtonState("cc_Meeting_id",Meeting_Off);    //会议按钮关闭
	     cc_setButtonState("cc_Hook_id",Hook_Off);    		//挂机按钮关闭
	     
	     return;
	}
	
	if(state == CallCenter.agent_state_en.Idle)
	{
		cc_setAgentStateText(CallCenter.agent_state_cn.Idle);
		cc_setButtonState("cc_Callout_id",Callout_On);	 //外呼按钮打开Callout_On
	     cc_setButtonState("cc_Hold_id",Hold_Off); 		//保持按钮关闭
	     cc_setButtonState("cc_HoldLine_id",Pause_On);
	     cc_setButtonState("cc_Transfer_id",Transfer_Off);  //转移按钮关闭
	     //cc_setButtonState("cc_Meeting_id",Meeting_Off);    //会议按钮关闭
	     cc_setButtonState("cc_Hook_id",Hook_Off);    		//挂机按钮关闭
	     
	     return;
	}
	
	if(state == CallCenter.agent_state_en.Callout)
	{
		cc_setAgentStateText(CallCenter.agent_state_cn.Callout);
	     cc_setButtonState("cc_HoldLine_id",Idle_Off); //关闭置闲,置忙 
	     cc_setButtonState("cc_Hook_id",Hook_Hangup);    //打开挂机
	     return;
	}
	
	if(state == CallCenter.agent_state_en.WaitAnswer)
	{
		cc_setAgentStateText(CallCenter.agent_state_cn.WaitAnswer);
	     return;
	}
	
	if(state == CallCenter.agent_state_en.Ring)
	{
		cc_setAgentStateText(CallCenter.agent_state_cn.Ring);
		cc_setButtonState("cc_Hook_id",Hook_Answer);    //打开挂机
	     return;
	}
	
	if(state == CallCenter.agent_state_en.Talking)
	{
		cc_setAgentStateText(CallCenter.agent_state_cn.Talking);
	     cc_setButtonState("cc_HoldLine_id",Idle_Off); //关闭置闲,置忙 
	     cc_setButtonState("cc_Hook_id",Hook_Hangup);    //打开挂机
	     cc_setButtonState("cc_Hold_id",Hold_On); 		//打开保持按钮
	     cc_setButtonState("cc_Transfer_id",Transfer_On);  //打开转移按钮
	     return;
	}
	
	if(state == CallCenter.agent_state_en.HoldOn)
	{
		cc_setAgentStateText(CallCenter.agent_state_cn.HoldOn);
		cc_setButtonState("cc_Hold_id",CancelHold);
		
		return;
	}
	if(state == CallCenter.agent_state_en.HoldOff)
	{
		cc_setAgentStateText(CallCenter.agent_state_cn.Talking);
		cc_setButtonState("cc_Hold_id",Hold_On);
		
		return;
	}
	if(state == CallCenter.agent_state_en.Disconnect)
	{
		cc_setAgentStateText(CallCenter.agent_state_cn.Disconnect);
		cc_setButtonState("cc_Callout_id",Callout_Off);	 //外呼按钮打开Callout_On
	     cc_setButtonState("cc_Hold_id",Hold_Off); 		//保持按钮关闭
	     cc_setButtonState("cc_HoldLine_id",Idle_Off);
	     cc_setButtonState("cc_Transfer_id",Transfer_Off);  //转移按钮关闭
	     //cc_setButtonState("cc_Meeting_id",Meeting_Off);    //会议按钮关闭
	     cc_setButtonState("cc_Hook_id",Hook_Off);    		//挂机按钮关闭
	     return;
	}
	
}

function cc_ReqAgentRet(ret_obj)
{	
	if(ret_obj.result == "success")
	{
		var req_agent_state = ret_obj.req_agent_state;
		var response_member = ret_obj.response_agents;
		if(req_agent_state == "Idle")
		{
			//transfer
			/*
			var tran_obj = document.getElementById("transfer_agent_id");
			tran_obj.options.length = 0;
			var optionObj = new Option();
			optionObj.text = "==请选择==";
			optionObj.value = "";
			tran_obj.options.add(optionObj);
			var member_array = response_member.split(",");
			for(var x = 0; x < member_array.length; x++)
			{
				var member = member_array[x];
				optionObj = new Option();
                optionObj.text = member.split(":")[1];
                
                optionObj.value = member.split(":")[0];
                tran_obj.options.add(optionObj);
			}
			*/
			var tran_obj = document.getElementById("cc_tranAgentList");
			tran_obj.options.length = 0;
			var optionObj = new Option();
			optionObj.text = "==请选择==";
			optionObj.value = "-1";
			tran_obj.options.add(optionObj);
			var member_array = response_member.split(",");
			for(var x = 0; x < member_array.length; x++)
			{
				var member = member_array[x];
				optionObj = new Option();
                optionObj.text = member.split(":")[1];
                
                optionObj.value = member.split(":")[0];
                tran_obj.options.add(optionObj);
			}
			
			
			return;
		}
		
		
		if(req_agent_state == "IdleExtn")
		{
			alert(response_member);
		}
		
		if(req_agent_state == "Talking")
		{
			/*
			var monitor_obj = document.getElementById("monitor_agent_id");
			//打开对话框,填充下拉列表cc_teamLeaderList
			
			monitor_obj.options.length = 0;
			
			var optionObj = new Option();
			optionObj.text = "==请选择==";
			optionObj.value = "";
			monitor_obj.options.add(optionObj);
			var member_array = response_member.split(",");
			for(var x = 0; x < member_array.length; x++)
			{
				var member = member_array[x];
				optionObj = new Option();
	            optionObj.text = member.split(":")[1];
	            
	            optionObj.value = member.split(":")[0];
	            monitor_obj.options.add(optionObj);
	            //leader_obj.options.add(optionObj);
			}
			*/
			if(CallCenter.teamLeaderType == CallCenter.leader_request_type.Listen)
			{
				document.getElementById("cc_teamLeaderTitle").innerHTML ="座 席 监 听";
			}
			if(CallCenter.teamLeaderType == CallCenter.leader_request_type.Block)
			{
				document.getElementById("cc_teamLeaderTitle").innerHTML ="座 席 拦 截";
			}
			if(CallCenter.teamLeaderType == CallCenter.leader_request_type.Insert)
			{
				document.getElementById("cc_teamLeaderTitle").innerHTML ="座 席 强 插";
			}
			if(CallCenter.teamLeaderType == CallCenter.leader_request_type.Remove)
			{
				document.getElementById("cc_teamLeaderTitle").innerHTML ="座 席 强 拆";
			}
			var leader_obj = document.getElementById("cc_teamLeaderList");
			leader_obj.options.length = 0;
			optionObj = new Option();
			optionObj.text = "==请选择==";
			optionObj.value = "";
			leader_obj.options.add(optionObj);
			for(var x = 0; x < member_array.length; x++)
			{
				var member = member_array[x];
				optionObj = new Option();
	            optionObj.text = member.split(":")[1];
	            
	            optionObj.value = member.split(":")[0];
	           
	            leader_obj.options.add(optionObj);
			}
		}
	}
}



//呼叫
function cc_Callout()
{
	var PhoneNumber = document.getElementById("cc_cust_phone").value;
	if(PhoneNumber == "")
	{
       alert("请输入电话号码!");
       return;
	}
	//                         (主叫号码,被叫号码)
	cc_ctiIframe.ccapi_CallOut(CallCenter.callerNumber,PhoneNumber);
	closeProc("cc_callout_div");
	return;   
}

//摘机
function cc_Answer()
{
	cc_ctiIframe.ccapi_AnswerCall();
}
//挂机
function cc_Hungup()
{
	cc_ctiIframe.ccapi_AgentHangup();
}

//置闲响应
function cc_OnIdle()
{
	cc_ctiIframe.ccapi_AgentSetReady();
}
//置忙响应
function cc_OnPause()
{
	cc_ctiIframe.ccapi_AgentSetPause();
}
//保持
function cc_HoldLine()
{
	ccHoldLineSerial = cc_ctiIframe.ccapi_HoldLine();
	
}
//取消保持
function cc_DisHoldLine()
{
	cc_ctiIframe.ccapi_DisHoldLine(ccHoldLineSerial);
	
	cc_setButtonState("cc_Hold_id",Hold_On);//显示保持按钮
	
}

//电话转移,转移坐席
function cc_ForwardCall()
{
	var agentobj = document.getElementById("cc_tranAgentList").value;
	
	var outPhone = document.getElementById("cc_outPhone").value;
	
	var tran_extension = document.getElementById("cc_extension").value;
	if(agentobj == "-1" && outPhone == "" && tran_extension == "")
    {
        alert("请选择转移要转移的坐席");
        return;
    }
	
	if(agentobj != '-1' && outPhone != ""){
		alert("只能选择一个转移目标!");
		return;
	}
	
	if(agentobj != '-1'){
		
		cc_ctiIframe.ccapi_agentTransfer(agentobj);
		closeProc("cc_TransferPhone");
		return;
	}
	
	if(outPhone != ""){
		cc_ctiIframe.ccapi_outSideTransfer(outPhone);
		closeProc("cc_TransferPhone");
		return;
	}
	
	if(tran_extension != ""){ 
		cc_ctiIframe.ccapi_extensionTransfer(tran_extension);
		closeProc("cc_TransferPhone");
	}
	
    
}

function cc_requestIdleAgent()
{
	cc_ctiIframe.ccapi_requestIdleAgent();
}

function cc_requestIdleExtn()
{
	cc_ctiIframe.ccapi_requestIdleExtn();
}

function cc_requestTalkingAgent()
{
	cc_ctiIframe.ccapi_requestTalkingAgent();
}


function ShowDivProc(event)
{
	if(event == 1)  //转移
	{
		cc_requestIdleAgent();  //测试时,注释了,用下面的代码,正式使用时,注释下面的代码,使用本行代码
//		var obj = new Object();
//		obj.req_agent_state = "Idle";
//		obj.result = "success";
//		obj.response_agents = "1101:1101,1102:1102";
//		cc_ReqAgentRet(obj);
//		showProc('cc_TransferPhone');
		
		//测试获取所有空闲分机
		cc_requestIdleExtn();
		return;
	}
	
	if(event == 3) //外呼
	{
		showProc('cc_callout_div');
		return;
	}
	if(event == 4)  //监听
	{
		//获取通话坐席列表,不返回,回调cc_ReqAgentRet
		CallCenter.teamLeaderType = CallCenter.leader_request_type.Listen;
		//cc_requestTalkingAgent();  测试时,注释了,用下面的代码,正式使用时,注释下面的代码,使用本行代码
		var obj = new Object();
		obj.req_agent_state = "Talking";
		obj.result = "success";
		obj.response_agents = "1101:1101,1102:1102";
		cc_ReqAgentRet(obj);
		showProc('cc_teamLeader');
	}
	//拦截
	if(event == 5)  
	{
		CallCenter.teamLeaderType = CallCenter.leader_request_type.Block;

		
		//cc_requestTalkingAgent();  测试时,注释了,用下面的代码,正式使用时,注释下面的代码,使用本行代码
		var obj = new Object();
		obj.req_agent_state = "Talking";
		obj.result = "success";
		obj.response_agents = "1101:1101,1102:1102";
		cc_ReqAgentRet(obj);
		showProc('cc_teamLeader');
	}
	//强插
	if(event == 6)  
	{
		CallCenter.teamLeaderType = CallCenter.leader_request_type.Insert

		//cc_requestTalkingAgent();  测试时,注释了,用下面的代码,正式使用时,注释下面的代码,使用本行代码
		var obj = new Object();
		obj.req_agent_state = "Talking";
		obj.result = "success";
		obj.response_agents = "1101:1101,1102:1102";
		cc_ReqAgentRet(obj);
		showProc('cc_teamLeader');
	}
	//强拆
	if(event == 7)
	{
		CallCenter.teamLeaderType = CallCenter.leader_request_type.Remove

		//cc_requestTalkingAgent();  测试时,注释了,用下面的代码,正式使用时,注释下面的代码,使用本行代码
		var obj = new Object();
		obj.req_agent_state = "Talking";
		obj.result = "success";
		obj.response_agents = "1101:1101,1102:1102";
		cc_ReqAgentRet(obj);
		showProc('cc_teamLeader');
	}
}

function cc_doTeamLeader()
{
	var listenAgent = document.getElementById("cc_teamLeaderList").value;
	if(listenAgent == "" || listenAgent == null)
    {
    	alert("请选择座席!");
    	return;
    }
	CallCenter.teamLeaderType = 0;
	if(CallCenter.teamLeaderType == CallCenter.leader_request_type.Listen)
	{
		CallCenter.teamLeaderType = 0;
		alert("座 席 监 听:" +listenAgent );
		cc_ctiIframe.ccapi_listenAgent(listenAgent);
		return;
	}
	
	if(CallCenter.teamLeaderType == CallCenter.leader_request_type.Block)
	{
		CallCenter.teamLeaderType = 0;
		alert("座 席 拦 截:" +listenAgent );
		cc_ctiIframe.ccapi_blockAgent(listenAgent);
		return;
	}
	
	if(CallCenter.teamLeaderType == CallCenter.leader_request_type.Insert)
	{
		CallCenter.teamLeaderType = 0;
		alert("座 席 强 插:" +listenAgent );
		cc_ctiIframe.ccapi_forceInsert(listenAgent);
		return;
	}
	
	if(CallCenter.teamLeaderType == CallCenter.leader_request_type.Remove)
	{
		CallCenter.teamLeaderType = 0;
		alert("座 席 强 拆:" +listenAgent );
		cc_ctiIframe.ccapi_forceRemove(listenAgent);
		return;
	}
	
}

function cc_doStopListen(type)
{
	cc_ctiIframe.ccapi_stopListen();
	
	if(type == 1)
	{
		alert("监听结束");
		cc_setButtonState("cc_Listen_id",Listen_On);
	}
	if(type ==2)
	{
		alert("强插结束");
        cc_setButtonState("cc_Insert_id",Insert_On);
	}
}

//监听
function cc_OnListen()
{
	//document.getElementById("cc_teamLeaderTitle").innerHTML ="座 席 监 听";
	cc_ctiIframe.ccapi_listenAgent();
}
//拦截
function cc_OnBlock()
{
	showProc('cc_teamLeader',true,'cc_teamLeaderList','Talking');
	document.getElementById("cc_teamLeaderTitle").innerHTML ="座 席 拦 截";
}
//强插
function cc_ForceInsert()
{
	showProc('cc_teamLeader',true,'cc_teamLeaderList','Talking');
	document.getElementById("cc_teamLeaderTitle").innerHTML ="座 席 强 插";
}
//强拆
function cc_ForceRemove()
{
	showProc('cc_teamLeader',true,'cc_teamLeaderList','Talking');
	document.getElementById("cc_teamLeaderTitle").innerHTML ="座 席 强 拆";
}
实际运用到asp.net页面
<%@ Page Language="C#" AutoEventWireup="True" CodeBehind="Main.aspx.cs" Inherits="Topevery.DUM.GridingManagement.Web.CCMS.Main" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <script runat="server">
        protected override bool HeaderScriptFilter(Topevery.Framework.Web.Configuration.Script val)
        {
            switch (val.Key)
            {
                case "jquery.ui.tabs":
                case "jquery.blockUI":
                case "KeyValueCollection":
                case "ajaxpro2.prototype":
                case "ajaxpro2.core":
                case "ajaxpro2.converter":
                case "ajaxpro2.onloading":
                case "ajaxpro2.assembly.AjaxFunction":
                case "ajaxpro2.assembly.VMFunction":
                    return true;
                default:
                    return base.HeaderScriptFilter(val);
            }
        }
        protected override bool HeaderStyleFilter(Topevery.Framework.Web.Configuration.Style val)
        {
            switch (val.Key)
            {
                case "jquery.ui.tabs":
                case "jquery.blockUI":
                    return true;
                default:
                    return base.HeaderStyleFilter(val);
            }
        }
    </script>

    <style type="text/css">
        .nav {
            background: url(softphone/other/softphone/cti/images/nav.png) no-repeat;
            width: 899px;
            height: 75px;
            position: absolute;
            top: 0px;
            right: 320px;
            z-index: 1000000;
        }

        .left {
            width: 80px;
            float: left;
            margin-left: 50px;
            display: inline;
            margin-top: 8px;
        }

            .left ul {
                width: 80px;
                float: left;
                list-style-type: none;
                margin-left: 25px;
                margin-top: 5px;
            }

            .left li {
                width: 80px;
                line-height: 18px;
                float: left;
                text-align: left;
                font-size: 8pt;
            }

        .right {
            float: right;
            width: 754px;
            height: 60px;
            margin-top: 5px;
        }

            .right ul {
                float: left;
                width: 754px;
                list-style-type: none;
            }

            .right div {
                float: left;
                width: 58px;
                height: 60px;
                margin-left: 3px;
            }

        .l {
            float: left;
            width: 58px;
            height: 60px;
            margin-left: 3px;
        }
    </style>
</head>
<body οnlοad="init()">
    <%--    <script type="text/javascript" src="softphone/json.js"></script>--%>
    <script type="text/javascript" src="softphone/websocket-api.js"></script>
    <script type="text/javascript" src="softphone/dialog.js"></script>
    <!-- class="overflow_y_hidden"-->
    <form id="form1" runat="server" class="TUI-wh100">
        <!-- class="TUI-wh100"-->
        <div id="case-region" class="TUI-main-case-region relative">
            <div id="dialog"></div>
            <!-- 系统加载中的遮罩层 -->
            <div id="MainLoadingDiv" class="MainLoadingDiv">
            </div>
            <!-- 系统加载中进度条 -->
            <div id="LoadingLayer" class="LoadingLayer">
                <div class="loading_content">
                    <span>系统正在加载,请稍等...</span> <b></b>
                </div>
            </div>
            <div id="div_sys_tips" runat="server" class="sys_tips_layer" style="display: none">
                <div class="sys_tips_bg">
                    <b class="sys_tips_head">系统提示</b> <a href="javascript:void(0)" class="close_stl"
                        οnclick='hide_div_sys_tips_content();return false;'></a>
                    <div runat="server" id="div_sys_tips_content" class="sys_tips_content">
                    </div>
                </div>
            </div>
            <div class="TUI-layout-north">
                <div class="TUI-header">
                    <h1 class="TUI-logo TUI-logo-txt">
                        <span class="sys-ico sys-hjzx">呼叫中心管理系统</span>
                    </h1>
                    <div class="TUI-menu">
                        <div id="div_index_menu" runat="server">
                            <!-- 系统主菜单及二级菜单 通过vm输出 -->
                        </div>
                    </div>
                </div>
                <div class="TUI-top-tools">
                    <div class="TUI-user">
                        <a href="#" οnclick="goUserConfig();return false;" title="个人设置"><span class="TUI-ico"></span><%=UserObject.User.UserName %>,你好</a>
                    </div>
                    <ul class="TUI-top-group-btn">

                        <li><span class="TUI-space"></span></li>
                        <li><a hidefocus="hidefocus" href="../SelectSystem2.aspx" id="change_system" title="切换系统"><span class="TUI-ico ico-change-system"></span>切换系统</a></li>
                        <li><span class="TUI-space"></span></li>
                        <li><a hidefocus="hidefocus" href="####" οnclick="javascript:logoutSys();" title="退出系统"><span class="TUI-ico ico-shutdown"></span>退出系统</a></li>
                    </ul>
                </div>

                <!-- 呼叫中心相关 Begin -->
                <div id="divCC_CTI" style="float: left; position: absolute; top: 0px; right: 0px;">
                    <div id="cti-pane-navigation" class="nav" align="left">
                        <div class="left">
                            <ul>
                                <li>坐席人员</li>
                                <li id="userinfo"><%= UserObject.UmUserExt.CenterLoginName %></li>
                                <li id="cc_curState"><strong><font color="red">未连接... </font></strong></li>
                            </ul>
                        </div>
                        <div class="right">
                            <div class="l" id="cc_Hook_id" style="cursor: pointer; ">
                                <a href="#">
                                    <img src="softphone/other/softphone/cti/images/Answer_Off.png" border="0" width="58" height="60" alt="" />
                                </a>
                            </div>
                            <div class="l" id="cc_Hold_id" style="cursor: pointer;">
                                <a href="#">
                                    <img src="softphone/other/softphone/cti/images/HoldLine_Off.png" border="0" width="58" height="60" alt="" />
                                </a>
                            </div>
                            <div class="l" id="cc_Transfer_id" style="cursor: pointer;">
                                <a href="#">
                                    <img src="softphone/other/softphone/cti/images/Transfer_Off.png" border="0" width="58" height="60" alt="" />
                                </a>
                            </div>
                            <!--<div class="l" id="cc_Meeting_id" style="cursor:pointer;"><a href="#"><img src="./other/softphone/cti/images/Meeting_Off.png" border="0" width="58" height="60" alt="" /> </a></div>-->
                            <div class="l" id="cc_HoldLine_id" style="cursor: pointer;">
                                <a href="#">
                                    <img src="softphone/other/softphone/cti/images/Idle_Off.png" border="0" width="58" height="60" alt="" />
                                </a>
                            </div>
                            <div class="l" id="cc_Callout_id" style="cursor: pointer;">
                                <a href="#">
                                    <img src="softphone/other/softphone/cti/images/Callout_Off.png" border="0" width="58" height="60" alt="" />
                                </a>
                            </div>
                            <div class="l" id="cc_Listen_id" style="cursor: pointer;">
                                <a href="#">
                                    <img src="softphone/other/softphone/cti/images/Listen_Off.png" width="58" height="60" border="0" alt="" />
                                </a>
                            </div>
                            <div class="l" id="cc_Block_id" style="cursor: pointer;">
                                <a href="#">
                                    <img src="softphone/other/softphone/cti/images/Block_Off.png" border="0" width="58" height="60" alt="" />
                                </a>
                            </div>
                            <div class="l" id="cc_Insert_id" style="cursor: pointer;">
                                <a href="#">
                                    <img src="softphone/other/softphone/cti/images/ForceInsert_Off.png" border="0" width="58" height="60" alt="" />
                                </a>
                            </div>
                            <div class="l" id="cc_Remove_id" style="cursor: pointer;">
                                <a href="#">
                                    <img src="softphone/other/softphone/cti/images/ForceRemove_Off.png" border="0" width="58" height="60" alt="" />
                                </a>
                            </div>
                            <div class="l" id="cc_Exit_id" style="cursor: pointer;" οnclick="">
                                <a href="#">
                                    <img src="softphone/other/softphone/cti/images/Exit_Off.png" border="0" width="58" height="60" alt="" />
                                </a>
                            </div>
                        </div>

                    </div>
                </div>
                <!-- 呼叫中心相关 End -->
            </div>
            <div class="TUI-layout-center">
                <div class="TUI-content TUI-wh100">
                    <iframe id="frame_main_left" name="frame_main_left" class="TUI-wh100" src="#"
                        frameborder="0" scrolling="no"></iframe>
                </div>
            </div>
            <div class="TUI-layout-south">
                <div class="TUI-footer TUI-home-footer">
                    <div class="system_copyright">
                        <%--业主单位:沁阳县城市管理局 (沁阳县城市管理行政执法局)      --%>
                    </div>
                </div>
            </div>

            <input type="hidden" id="hid_obid" />

            <!-- 呼叫中心相关 Begin -->
            <iframe id="cc_ctiIframe" name="cc_ctiIframe" src="softphone/cti-websocket-api.html" width="100%" height="800" frameborder="0" scrolling="auto"></iframe>
            <!--电话外呼 DIV-->
            <div id="cc_callout_div" style="position: absolute; border: 1px solid #666; z-index: 3000000; visibility: hidden">
                <div style="width: 100%; height: 100%; background: #fff; color: #036; line-height: 150%;">
                    <div style="background: #1E9FFF; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; padding: 3 5 0 5; color: #fff; height: 30px; line-height: 30px;" id="dragDiv">

                        <span style="width: 150px; position: absolute; font-size: 12px;">  呼叫中心</span>

                        <span οnclick="closeProc('cc_callout_div');" style="float: right; cursor: pointer; font-size: 22px;">×</span>

                    </div>
                    <form action="#" method="post">
                        <table width="100%" border="0" align="center">
                            <tr>
                                <td align="center">电话外呼</td>
                            </tr>
                            <tr>
                                <td align="center">电话号码:<input name="cc_cust_phone" type="text" id="cc_cust_phone" size="15" />
                                </td>
                            </tr>
                            <tr>
                                <td align="center">
                                    <input type="button" name="Submit3" οnclick="javascript: CC_CTI.cc_Callout()" value="外拨" />
                                </td>
                            </tr>
                        </table>
                    </form>
                </div>
            </div>
            <!-- message_box -->
            <!-- 电话转移 -->
            <div id="cc_TransferPhone" style="position: absolute; border: 1px solid #666; z-index: 3000000; visibility: hidden">
                <div style="width: 100%; height: 100%; background: #fff; color: #036; line-height: 150%;">
                    <div style="background: #1E9FFF; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; padding: 3 5 0 5; color: #fff; height: 45px; line-height: 45px;" id="dragDiv">

                        <span style="width: 150px; position: absolute; font-size: 12px;">  呼叫中心</span>

                        <span οnclick="closeProc('cc_TransferPhone');" style="float: right; cursor: pointer; font-size: 22px;">×</span>

                    </div>
                    <form action="#" method="post">
                        <table width="100%" border="0" align="center">
                            <tr>
                                <td colspan="2" align="center"><strong>电 话 转 移</strong></td>
                            </tr>
                            <tr>
                                <td align="right">内部座席:                                    </td>
                                <td align="left">
                                    <select name="cc_tranAgentList" id="cc_tranAgentList" style="width: 90px;">
                                    </select></td>
                            </tr>

                            <tr>
                                <td align="right">外部号码:                                    </td>
                                <td align="left">
                                    <input name="cc_outPhone" id="cc_outPhone" type="text" size="15" /></td>
                            </tr>

                            <tr>
                                <td align="right">内部分机:                                    </td>
                                <td align="left">
                                    <input name="cc_extension" id="cc_extension" type="text" size="15" /></td>
                            </tr>

                            <tr>
                                <td colspan="2" align="center">
                                    <input type="button" name="Submit4" οnclick="cc_ForwardCall()" value="确  定" style="width: 85px;" />
                                </td>
                            </tr>
                        </table>
                    </form>
                </div>
            </div>
            <!-- message_box -->
            <div id="cc_teamLeader" style="position: absolute; border: 1px solid #666; z-index: 3000000; visibility: hidden">
                <div style="width: 100%; height: 100%; background: #fff; color: #036; line-height: 150%;">
                    <div style="background: #1E9FFF; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; padding: 3 5 0 5; color: #fff; height: 30px; line-height: 30px;" id="dragDiv">

                        <span style="width: 150px; position: absolute; font-size: 12px;">  呼叫中心</span>

                        <span οnclick="closeProc('cc_teamLeader');" style="float: right; cursor: pointer; font-size: 22px;">×</span>

                    </div>
                    <form action="#" method="post">
                        <table width="100%" border="0" align="center">
                            <tr>
                                <td colspan="2" align="center"><strong>
                                    <div id="cc_teamLeaderTitle"></div>
                                </strong></td>
                            </tr>
                            <tr>
                                <td align="right">内部座席:</td>
                                <td align="left">
                                    <select name="cc_teamLeaderList" id="cc_teamLeaderList" style="width: 90px;"></select>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" align="center">
                                    <input type="button" name="Submit4" οnclick="cc_doTeamLeader()" value="确  定" style="width: 85px;" />
                                </td>
                            </tr>
                        </table>
                    </form>
                </div>
            </div>
            <!-- message_box -->
            <!-- 呼叫中心相关 End -->
        </div>
    </form>
    <script type="text/javascript">
        window.onload = function ()//用window的onload事件,窗体加载完毕的时候
        {
            cc_ctiIframe.FSK(18570144827,123);
        }
        //坐席号和分机号,必须传入字符串 不能是数字
        debugger;
        var calleeAgent = "<%= UserObject.UmUserExt.CenterLoginName %>"+"";
        var callExt = "<%= UserObject.UmUserExt.CenterUserCode %>"+"";
        var userId = "<%=UserObject.UserID.ToString().ToUpper() %>"
        var userName = "<%= UserObject.LoginName %>"
        //#begin 呼叫中心工具条相关JS
        var CC_CTI = {
            initCC_CTI: function () {

                this.loginSys();

                $("#cc_Hook_id").on("click", CC_CTI.hook_Click) //摘机

                $("#cc_Hold_id").on("click", CC_CTI.hold_Click) //保持

                $("#cc_Transfer_id").on("click", CC_CTI.transfer_Click) //连接

                $("#cc_HoldLine_id").on("click", CC_CTI.holdLine_Click) //至闲

                $("#cc_Callout_id").on("click", CC_CTI.callout_Click) //拨号

                $("#cc_Listen_id").on("click", CC_CTI.listen_Click) //监听

                $("#cc_Block_id").on("click", CC_CTI.block_Click) //拦截

                $("#cc_Insert_id").on("click", CC_CTI.insert_Click) //强插

                $("#cc_Remove_id").on("click", CC_CTI.remove_Click) //强拆

                $("#cc_Exit_id").on("click", CC_CTI.exit_Click) //退出
            },
            loginSys: function () {
                $("#cc_curState").empty().html('<strong><font color="red">连线中...</font></strong>');
                document.getElementById("cc_ctiIframe").onload = function () {
                //必须传字符串类型
                    cc_ctiIframe.ccapi_socket_login(calleeAgent, '123456', callExt, CC_CTI.loginSys_callback);
                }
            },
            //摘机
            hook_Click: function () {

            },
            //保持
            hold_Click: function () {

            },
            //连接
            transfer_Click: function () {
                CC_CTI.cc_requestIdleAgent();  //测试时,注释了,用下面的代码,正式使用时,注释下面的代码,使用本行代码
                //		var obj = new Object();
                //		obj.req_agent_state = "Idle";
                //		obj.result = "success";
                //		obj.response_agents = "1101:1101,1102:1102";
                //		cc_ReqAgentRet(obj);
                //		showProc('cc_TransferPhone');

                //测试获取所有空闲分机
                cc_requestIdleExtn();
                return;
            },
            //连接成功或失败的回调
            loginSys_callback: function () {
                if (cc_ctiIframe.socket_ready) {
                    $("#cc_curState").empty().html('<strong>连接成功</strong>');
                }
                else {
                    $("#cc_curState").empty().html('<strong><font color="red">连接失败</font></strong>');
                }
            },
            //至闲
            holdLine_Click: function () {
            },
            //拨号
            callout_Click: function () {
                showProc('cc_callout_div');
            },
            //拨号确定开始呼叫
            cc_Callout: function () {
                var phoneNumber = $("#cc_cust_phone").val();
                if (phoneNumber == "") {
                    alert("请输入电话号码!");
                    return;
                }
                //(主叫号码,被叫号码)
                cc_ctiIframe.ccapi_CallOut(CallCenter.callerNumber, phoneNumber);
                closeProc("cc_callout_div");
                return;
            },
            //监听
            listen_Click: function () {
                //获取通话坐席列表,不返回,回调cc_ReqAgentRet
                CallCenter.teamLeaderType = CallCenter.leader_request_type.Listen;
                CC_CTI.cc_requestTalkingAgent();  //测试时,注释了,用下面的代码,正式使用时,注释下面的代码,使用本行代码
                //var obj = new Object();
                //obj.req_agent_state = "Talking";
                //obj.result = "success";
                //obj.response_agents = "1101:1101,1102:1102";
                //cc_ReqAgentRet(obj);
                //showProc('cc_teamLeader');
            },
            //拦截
            block_Click: function () {
                allCenter.teamLeaderType = CallCenter.leader_request_type.Block;
                CC_CTI.cc_requestTalkingAgent();  //测试时,注释了,用下面的代码,正式使用时,注释下面的代码,使用本行代码

                //var obj = new Object();
                //obj.req_agent_state = "Talking";
                //obj.result = "success";
                //obj.response_agents = "1101:1101,1102:1102";
                //cc_ReqAgentRet(obj);
                //showProc('cc_teamLeader');
            },
            //强插
            insert_Click: function () {
                CallCenter.teamLeaderType = CallCenter.leader_request_type.Insert

                CC_CTI.cc_requestTalkingAgent();  //测试时,注释了,用下面的代码,正式使用时,注释下面的代码,使用本行代码
                //var obj = new Object();
                //obj.req_agent_state = "Talking";
                //obj.result = "success";
                //obj.response_agents = "1101:1101,1102:1102";
                //cc_ReqAgentRet(obj);
                //showProc('cc_teamLeader');
            },
            //强拆
            remove_Click: function () {
                CallCenter.teamLeaderType = CallCenter.leader_request_type.Remove

                CC_CTI.cc_requestTalkingAgent();  //测试时,注释了,用下面的代码,正式使用时,注释下面的代码,使用本行代码
                //var obj = new Object();
                //obj.req_agent_state = "Talking";
                //obj.result = "success";
                //obj.response_agents = "1101:1101,1102:1102";
                //cc_ReqAgentRet(obj);
                //showProc('cc_teamLeader');
            },
            //退出呼叫系统
            exit_Click: function () {
                alert("退出成功!");
            },
            //调用外部代码
            cc_requestIdleAgent: function () {
                cc_ctiIframe.ccapi_requestIdleAgent();
            },
            cc_requestIdleExtn: function () {
                cc_ctiIframe.ccapi_requestIdleExtn();
            },
            cc_requestTalkingAgent: function () {
                cc_ctiIframe.ccapi_requestTalkingAgent();
            },
        }
        //#end 呼叫中心工具条相关JS


        $(document).ready(function () {
            TUILayout("#case-region");

            //初始化呼叫工具条
            CC_CTI.initCC_CTI();
        });

        function logoutSys() {
            if (confirm("退出系统,将同时退出呼叫中心,是否确定退出!")) {
                CC_CTI.exit_Click(); //退出呼叫中心
                window.location.href = "../logout.aspx";
            }
        }

        if (window != window.top) {
            window.top.location.href = window.location.href;
        }

        function TUILayoutBody() {
            TUILayout("#case-region");
        }

        $(document).ready(function () {
            $('.menu').Menu({ loaded: TUILayoutBody });
        });


        function select_map_option_focus(obj) {
            $("#change_system").removeClass("top_toolbar_change");
            $("#change_system").addClass("top_toolbar_change_current");
            $("#selecet_system_layer").show();
        }
        function select_map_option_blur(obj) {
            $("#change_system").removeClass("top_toolbar_change_current");
            $("#change_system").addClass("top_toolbar_change");
            $("#selecet_system_layer").hide();
        }

        function set_sub_frame_width() {
            //            $("#master_double_screen").width(window.screen.width);
            //            $("#left_frame").width(window.screen.width);
        }

        function set_frame_main_right() {
            var jq_frame_main_right = $("#frame_main_right");
            jq_frame_main_right.attr("src", '<%= Topevery.DUM.GridingManagement.Web.Config.MapUrl%>');
            jq_frame_main_right.load(function (evtObj) {
                map = this.contentWindow;
                map.mapSetDefaultElement();
            });
        }

        function goUserConfig() {
            var style = "width=450,height=500,left=100,top=100,status=yes,toolbar=no,menubar=no,location=no,resizable=1";
            var w = window.open("../public/PersonalConfig.aspx", 'process', style);
            w.focus();
        }

        function init() {
            set_frame_main_right();
        }
        function closeLoading() {
            $("#MainLoadingDiv").hide();
            $("#LoadingLayer").hide();
        }
        function openLoading() {
            $("#MainLoadingDiv").show();
            $("#LoadingLayer").show();
        }
    </script>

    <script type="text/javascript">
        function selectAll(obj) {
            var list = $(obj.document).find("input[@type=checkbox]");
            $(obj.document).find("input[@type=checkbox]").attr("checked", obj.checked);
        }
        function selectedLine(obj) {
            $(obj.document).find(".selected_css").removeClass("selected_css");
            $(obj).addClass("selected_css");
        }

        function ShowOp(id) {
            var url = '<%= ResolveUrl("~/OpMis/Info/OpDetail.aspx?userId=") %>' + id + '&rt=' + new Date().getTime();
            window.open(url, "", " top=20,left=20,height=800px,width=1000px,location=no,status=no,toolbar=no,menubar=no,resizable=yes,scrollbars=yes ", "");
        }
    </script>
</body>
</html>


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值