81,091
社区成员
发帖
与我相关
我的任务
分享
switch (EventCode) {
case 0: //显示信息
//strDisp = "EventCode=" + EventCode + ",EventData=" + EventData;
//document.frmDemo.txtOcxInfo.value=strDisp;
break;
case 1: //1:表示座席员状态发生变化
document.ut_atocx.UidSelected=myUid;
myStatus=document.ut_atocx.UidCall_Status;
mySeatStatus=document.ut_atocx.UidStatus;//UidStatus=05座席被选中
if(mySeatStatus=="05")
{
if(myStatus=="01" && EventData==myUid)
{
intrvl=0;
for(nTimes=0;nTimes<2;nTimes++)
{
intrvl += 1000;
setTimeout("document.getElementById('AgentCk').style.backgroundColor=('red');",intrvl);
intrvl += 1000;
setTimeout("document.getElementById('AgentCk').style.backgroundColor=('ButtonFace');",intrvl);
}
}
}
switch (myStatus) {
case "01":
strStatus = " 空闲 ";
caller = "";
called = "";
document.frmDemo.txtOcxInfo.value="";
break;
case "02":
strStatus = " 摘机 ";
caller = document.ut_atocx.UidCall_Caller;
called = document.ut_atocx.UidCall_Called;
callid = document.ut_atocx.UidCall_CallId;
document.frmDemo.txtOcxInfo.value="状态="+strStatus+";主叫="+caller+";被叫="+called+";呼叫编号="+callid;
break;
case "03":
strStatus = " 振铃 ";
caller = document.ut_atocx.UidCall_Caller;
called = document.ut_atocx.UidCall_Called;
callid = document.ut_atocx.UidCall_CallId;
document.frmDemo.txtOcxInfo.value="状态="+strStatus+";主叫="+caller+";被叫="+called+";呼叫编号="+callid;
break;
case "04":
strStatus = " 回铃 ";
caller = document.ut_atocx.UidCall_Caller;
called = document.ut_atocx.UidCall_Called;
callid = document.ut_atocx.UidCall_CallId;
document.frmDemo.txtOcxInfo.value="状态="+strStatus+";主叫="+caller+";被叫="+called+";呼叫编号="+callid;
break;
case "05":
strStatus = " 连接 ";
var dir_value = document.ut_atocx.ExtDirection();
caller = document.ut_atocx.UidCall_Caller;
called = document.ut_atocx.UidCall_Called;
callid = document.ut_atocx.UidCall_CallId;
document.frmDemo.txtOcxInfo.value="状态="+strStatus+";主叫="+caller+";被叫="+called+";呼叫编号="+callid+";呼叫方向="+dir_value;
break;
case "06":
strStatus = " 断开 ";
pSeat=0;
document.frmDemo.txtOcxInfo.value="";
break;
case "07":
strStatus = " 其他 ";
break;
case "08":
strStatus = " 转移 ";
break;
default:
strStatus = " 未知 ";
break;
}
break;
case 2: //表示座席员呼叫状态发生变化,EventData 表示座席员工号
break;
case 3: //3:表示外线状态发生变化,EventData 表示外线号码
break;
case 5: //5:表示其它座席传来消息,EventData 表示消息内容
break;
case 6: //6:表示有用户呼入信息:应用程序依靠此消息弹出用户资料,EventData 表示分机号
caller = document.ut_atocx.UidCall_Caller;
window.open("Popup.htm?caller="+caller,"_blank","left = 0,top=0,width = 200,height =
200,scrollbars=yes,toolbar=yes,menubar=yes,location=yes,resizable=no,status=yes");
break;
}
}
//-->
</script>
<script language="javascript" event="onReceiveCTIEventChanged(sender,EventCode,EventData)" for="ut_atocx">
<!--
ut_atocx_ATMsgEvent(sender,EventCode,EventData);
//-->
</script>
<style type="text/css">
#Text1
{
height: 433px;
width: 770px;
}
#txtOcxInfo
{
height: 437px;
width: 772px;
}
.style1
{
width: 107px;
font-size: x-small;
}
.style2
{
width: 156px;
}
.style3
{
width: 171px;
}
.style4
{
width: 79px;
font-size: x-small;
}
.style5
{
font-size: x-small;
}
.style6
{
font-size: x-small;
font-weight: bold;
}
.style7
{
font-size: large;
}
</style>
</head>
<body>
<form name="frmDemo" id="frmDemo" action="">
<table width="764" height="653">
<tr>
<td height="30" valign="top"> <div align="center" class="style7">呼叫中心v400版ATClient.OCX控件演示 </div></td>
</tr>
<tr>
<td height="19" valign="top"> <span class="style6">设置CTI服务器</span> </td>
</tr>
<tr>
<td height="28"><table style="width: 563px">
<tr>
<td class="style2"> <span class="style5">CTI服务器地址:</span> </td>
<td class="style3"><input type="text" name="txtIP" value="168.168.1.56" size="20" /></td>
<td width="102"><input name="btnConnect" onclick="Connect_CTI()" type="button" value="连接CTI服务器" /></td>
<td width="141"><input name="btnDisConnect" onclick ="DisConnect_CTI()" type="button" value="断开CTI服务器" /></td>
</tr>
</table> </td>
</tr>
<tr>
<td height="21"> <span class="style6">坐席登录</span> </td>
</tr>
<tr>
<td height="32" valign="top"><table style="width: 776px">
<tr>
<td class="style1">坐席员工号:</td>
<td width="143"><input type="text" name="txtOPID" value="8005" size="20" /></td>
<td width="53" class="style5">密 码:</td>
<td width="91"><input type="text" name="txtPassword" value='1' size='12' /></td>
<td class="style4">分机号:</td>
<td width="97"><input type="text" name="txtExt" value='8005' size='12' /></td>
<td width="81"><input name="btnLogin" onclick="client_login()" type="button" value="座席登入" /></td>
<td width="107"><input name="btnLogout" onclick="client_logout()" type="button" value="座席登出" /></td>
</tr>
</table></td>
</tr>
<tr>
<td height="23" valign="top"><table width="284">
<tr>
<td><input type="text" name="txtTel" value='' size='12' /></td>
<td><input name="btnPlaceCall" onclick="Tel_PlaceCall()" type="button" value="呼叫电话"/></td>
<td><input name="btnHoldCall" onclick="Tel_HoldCall()" type="button" value="保持呼叫"/></td>
<td><input name="btnRetrCall" onclick="Tel_RetrCall()" type="button" value="恢复呼叫"/></td>
<td><input name="btnSetBusy" onclick="Tel_SetBusy()" type="button" value="座席置忙"/></td>
<td><input name="btnSetNoBusy" onclick="Tel_SetNoBusy()" type="button" value="取消置忙"/></td>
<td><input name="btnAfterWorking" onclick="Tel_AfterWorking()" type="button" value="事后处理"/></td>
<td><input name="btnNoAfterWorking" onclick="Tel_NoAfterWorking()" type="button" value="取消事后处理"/></td>
<td><input name="btnPickup" onclick="Tel_Pickup()" type="button" value="摘机"/></td>
<td><input name="btnHangup" onclick="Tel_Hangup()" type="button" value="挂机"/></td>
</tr>
</table></td>
</tr>
<tr>
<td height="23" valign="top"><table width="284">
<tr>
<td> <input name="AgentCk" id="AgentCk"
type="button" value="坐席被选中提示" /></td>
<td><input name="btnSetLeave" onclick="Tel_SetLeave()" type="button" value="座席离席"/></td>
<td><input name="btnSetNoLeavel" onclick="Tel_SetNoLeave()" type="button" value="取消离席"/></td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table></td>
</tr>
<tr>
<td height="31" valign="top"><table width="614">
<tr>
<td width="81"><input name="btnTransCall" onClick="Tel_TransCall()" type="button" value="转接电话到"/></td>
<td width="84"><input type="text" name="txtTranTel" value='' size='12' /></td>
<td width="81"><input name="btnConference" onClick="Tel_Con()" type="button" value="建立内线会议"/></td>
<td width="84"><input type="text" name="txtConfTel" value='' size='12' /></td>
<td width="89"><input name="btnTranIvr" onClick="Tel_TransIVR()" type="button" value="转入IVR流程"/></td>
<td width="167"><input type="text" name="txtIvrFlow" value='' size='20' /></td>
<td width="167"><input type="text" name="txtIvrNode" value='' size='5' /></td>
</tr>
</table></td>
</tr>
<tr>
<td width="244" height="438" valign="top">
<input name="txtOcxInfo" value='' type="text" size='20'
style="height: 432px; width: 774px"/></td>
</tr>
</table>
</form>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<meta content="text/html; charset=gb2312" http-equiv="Content-Type"/>
<title>ATOCX 通用控件演示</title>
<link rel="stylesheet" type="text/css" href="style.css" />
<OBJECT id="ut_atocx" style="VISIBILITY: hidden" height="1" width="1" classid="clsid:990B8AEB-48C9-4099-A43F-EEC361843F18">
<PARAM NAME="_Version" VALUE="65536">
<PARAM NAME="_ExtentX" VALUE="26">
<PARAM NAME="_ExtentY" VALUE="26">
<PARAM NAME="_StockProps" VALUE="0">
</OBJECT>
<script type="text/javascript" language="JavaScript">
<!--
var isConnect_CTI = 0;
var myUid,myPwd,myExt,myGroup="0",myStatus=0,mySeatStatus=0;
var callid;
var pSeat=0;//标识座席是否已经被选中
var htm_str = new Array();
var i=0;
// 控件处理函数
//连接CTI服务器
function Connect_CTI()
{
var strIP;
strIP=document.frmDemo.txtIP.value;
document.ut_atocx.ATConnect(strIP,1589);
alert('连接成功!');
return true;
}
//断开与CTI服务器的连接
function DisConnect_CTI()
{
document.ut_atocx.ATDisconnect();
return false;
}
//坐席靠工号登录
function client_login()
{
myUid=document.frmDemo.txtOPID.value;
myPwd = document.frmDemo.txtPassword.value;
if (myPwd == "") myPwd = "";
myExt=document.frmDemo.txtExt.value;
document.ut_atocx.ATLogin(myUid,myPwd,myExt,"0"); //工号,密码,分机号
var Result = document.ut_atocx.ATCommandResult(); //获取登录结果
if(Result == "OK")
{
isConnect_CTI=1;
alert("连接成功!");
}
else if (Result == "ERROR_UID")
{
alert("Local:登录失败,请检查工号是否正确!");
}
else if (Result == "ERROR_PWD")
{
alert("Local:登录失败,请检查密码是否正确!");
}
else if (Result == "ERROR_REP")
{
alert("Local:对不起,该帐号正在使用!");
}
else if (Result == "FAIL")
{
alert("Local:登录失败,请检查工号或密码是否正确!");
}
else if (Result == "ERROR_EXT_USED")
{
alert("Local:登录失败,分机已被使用!");
}
else
{
alert("Local:登录失败,请检查 CTI Server 是否运行正常!");
}
document.frmDemo.txtOcxInfo.value = Result;
//return false;
}
//坐席退出登录
function client_logout()
{
document.ut_atocx.ATLogout(myUid);
document.ut_atocx.ATDisconnect();
alert("坐席成功退出");
return false;
}
//电话操作部分
//发起呼叫
function Tel_PlaceCall()
{
var strTelnum;
if (document.frmDemo.txtTel.value=="")
{
alert("被叫号码不能为空!");
return false;
}
if (isConnect_CTI==0)
{
alert("请先连接CTI服务器!");
return false;
}
strTelnum=document.frmDemo.txtTel.value
document.ut_atocx.ATPlaceCall(myUid,strTelnum);//工号,要呼叫的电话号码
return true;
}
//保持呼叫,让对方听音乐
function Tel_HoldCall()
{
if (isConnect_CTI==0)
{
alert("请先连接CTI服务器!");
return false;
}
document.ut_atocx.ATHoldCall(myUid);
return true;
}
//恢复呼叫
function Tel_RetrCall()
{
if (isConnect_CTI==0)
{
alert("请先连接CTI服务器!");
return false;
}
document.ut_atocx.ATRetriveCall(myUid,"");
return true;
}
//座席置忙,因暂时离开座位或处理别的事情而不想接电话
function Tel_SetBusy()
{
if (isConnect_CTI==0)
{
alert("请先连接CTI服务器!");
return false;
}
document.ut_atocx.ATSetBusy(myUid,1,"");
return true;
}
//取消置忙
function Tel_SetNoBusy()
{
if (isConnect_CTI==0)
{
alert("请先连接CTI服务器!");
return false;
}
document.ut_atocx.ATSetBusy(myUid,0,"");
return true;
}
//座席离席
function Tel_SetLeave()
{
if (isConnect_CTI==0)
{
alert("请先连接CTI服务器!");
return false;
}
document.ut_atocx.ATSetLeaveSeat(myUid,1,"");
return true;
}
//取消离席
function Tel_SetNoLeave()
{
if (isConnect_CTI==0)
{
alert("请先连接CTI服务器!");
return false;
}
document.ut_atocx.ATSetLeaveSeat(myUid,0,"");
return true;
}
//事后处理,同坐席置忙
function Tel_AfterWorking()
{
if (isConnect_CTI==0)
{
alert("请先连接CTI服务器!");
return false;
}
document.ut_atocx.ATSetAfterWorking(myUid,1,"");
}
//取消事后处理
function Tel_NoAfterWorking()
{
if (isConnect_CTI==0)
{
alert("请先连接CTI服务器!");
return false;
}
document.ut_atocx.ATSetAfterWorking(myUid,0,"");
}
//转接电话,将电话转到别的坐席
function Tel_TransCall()
{
if (isConnect_CTI==0)
{
alert("请先连接CTI服务器!");
return false;
}
if (document.frmDemo.txtTranTel.value=="")
{
alert("请输入要转接的座席号码!");
return false;
}
strDestSeatid=document.frmDemo.txtTranTel.value;
document.ut_atocx.ATTranCall(myExt, strDestSeatid);//myExt本坐席的分机号,strDestSeatid要转的目的分机号
return true;
}
//建立内线会议,正在通话的时候,要把其他某一个坐席邀请入通话中
function Tel_Con()
{
if (isConnect_CTI==0)
{
alert("请先连接CTI服务器!");
return false;
}
if(document.frmDemo.txtConfTel.value != "")
{
strDestSeatid=document.frmDemo.txtConfTel.value;
document.ut_atocx.ATConf_est(myExt ,strDestSeatid);//myExt本坐席的分机号 ,strDestSeatid邀请的目的分机号
return true;
}
alert("请输入要开会的座席序号!");
return false;
}
//转ivr,满意度调查的时候用
function Tel_TransIVR()
{
var caller, called, callid;
var strNowStatus;
if (isConnect_CTI==0)
{
alert("请先连接CTI服务器!");
return false;
}
if (document.frmDemo.txtIvrFlow.value=="")
{
alert("请输入流程文件名!");
return false;
}
var strFlowFile=document.frmDemo.txtIvrFlow.value;
if (document.frmDemo.txtIvrNode.value=="")
{
alert("请输入流程文件节点!");
return false;
}
var strIVRNode=document.frmDemo.txtIvrNode.value
document.ut_atocx.UidSelected=myUid;
strNowStatus=document.ut_atocx.UidCall_Status;
if(strNowStatus=="05") //这里先判断座席电话是否处于连接中,否则不进入
{
caller = document.ut_atocx.UidCall_Caller;
called = document.ut_atocx.UidCall_Called;
callid = document.ut_atocx.UidCall_CallId;
var strIVRInfo = caller + "|" + called + "|" + callid;
tranivr = "AC_SWITCHIVR;EXT=" + myExt + ";IVRFILE=" + strFlowFile + ";NODE=" + strIVRNode + ";IVRMSG="+strIVRInfo+";";
ret=document.ut_atocx.ATTranCall_toIVR(myUid,0,"",tranivr);
if(ret==1)//1:转接IVR成功 其他:失败
{
return;
}
else
{
MessageBox.Show("IVR端口全忙,转接失败!");
}
return;
}
else
alert("座席必须在通话状态才能转IVR!");
}
//软摘机
function Tel_Pickup()
{
if (isConnect_CTI==0)
{
alert("请先连接CTI服务器!");
return false;
}
document.ut_atocx.ATAnswer(myUid,callid);
return true;
}
//软挂机
function Tel_Hangup()
{
if (isConnect_CTI==0)
{
alert("请先连接CTI服务器!");
return false;
}
document.ut_atocx.ATHangup(myUid,callid);
return true;
}
//控件消息
function ut_atocx_ATMsgEvent(sender, EventCode, EventData)
{
var caller, called, call_trunk;
var monitor_form_is_on = true;
caller = "";
called = "";
call_trunk = "";
var seat_status;
var strDisp, strPrompt;
var caller_code, ext_code, in_out_call;
var strStatus, lbl_name;
var rc;