/*/// <summary>
        /// 取保持结果事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="blres"></param>
        /// <param name="strres"></param>*/
function EvtUnHold(blres, strres) {
    WriteFileLogs(1, "iframeocx.aspx", "EvtUnHold");
    if (blres == "True") {
        parent.document.getElementById("spanServerRes").innerHTML = "坐席接回成功";
        parent.setLinkStatus("True");
        parent.Form_setWinfromenble("True", "false", "false", "false", "True", "True", "True", "false", "false", "false");
        parent.setAgentStatus("忙");
    }
    else {
        parent.document.getElementById("spanServerRes").innerHTML = "坐席接回失败：" + strres;
        //parent.Form_setWinfromenble("false", "True", "false", "True", "false", "false", "True", "false", "false", "True");
    }
}

/*/// <summary>
/// 转移电话结果事件
/// </summary>
/// <param name="sender"></param>
/// <param name="blres"></param>
/// <param name="strres"></param>*/
function EvtTransferToPhone(blres, strres) {
    WriteFileLogs(1, "iframeocx.aspx", "EvtTransferToPhone");
    if (blres == "True") {
        parent.document.getElementById("spanServerRes").innerHTML = "坐席转移电话成功";
        parent.Form_setWinfromenble("false", "false", "false", "false", "false", "false", "false", "false", "false", "false");
    }
    else {
        parent.document.getElementById("spanServerRes").innerHTML = "坐席转移电话失败：" + strres;
        //parent.Form_setWinfromenble("false", "True", "false", "True", "false", "false", "True", "false", "false", "True");
    }
}

/*/// <summary>
/// 转IVR结果事件
/// </summary>
/// <param name="sender"></param>
/// <param name="blres"></param>
/// <param name="strres"></param>*/
function EvtTransferToIVR(blres, strres) {
    WriteFileLogs(1, "iframeocx.aspx", "EvtTransferToIVR");
    if (blres == "True") {
        parent.document.getElementById("spanServerRes").innerHTML = "坐席转IVR成功";
        parent.Form_setWinfromenble("false", "false", "false", "false", "false", "false", "false", "false", "false", "false");
    }
    else {
        parent.document.getElementById("spanServerRes").innerHTML = "坐席转IVR失败：" + strres;
        //parent.Form_setWinfromenble("false", "True", "false", "True", "false", "false", "True", "false", "false", "True");
    }
}

/*/// <summary>
/// 三方通话结果事件
/// </summary>
/// <param name="sender"></param>
/// <param name="blres"></param>
/// <param name="strres"></param>*/
function EvtThirdParty(blres, strres) {
    WriteFileLogs(1, "iframeocx.aspx", "EvtThirdParty");
    if (blres == "True") {
        parent.document.getElementById("spanServerRes").innerHTML = "坐席三方通话成功";
        parent.Form_setWinfromenble("True", "false", "false", "false", "false", "false", "false", "false", "false", "false");
    }
    else {
        parent.document.getElementById("spanServerRes").innerHTML = "坐席三方通话失败：" + strres;
        //parent.Form_setWinfromenble("false", "True", "false", "True", "false", "false", "True", "false", "false", "True");
    }
}

/*/// <summary>
/// 获取指定坐席状态结果通知事件
/// </summary>
/// <param name="sender"></param>
/// <param name="agentid"></param>
/// <param name="strres"></param>*/
function EvtAgentState(agentid, strres) {
    WriteFileLogs(1, "iframeocx.aspx", "EvtAgentState---agentid=" + agentid + "---" + strres);
    try {
        //parent.IframeSetAgentState(agentid.strres);
        parent.window.frames["frame_zxjkgl"].GetState(agentid, strres);
    }
    catch (e) {
    }
}

/*/// <summary>
/// 坐席置闲结果事件
/// </summary>
/// <param name="sender"></param>
/// <param name="blres"></param>
/// <param name="strres"></param>*/
function EvtSetFree(blres, strres) {
    WriteFileLogs(1, "iframeocx.aspx", "EvtSetFree");
    if (blres == "True") {
        parent.document.getElementById("spanServerRes").innerHTML = "坐席置闲成功";
        parent.setLinkStatus("True");
        parent.Form_setWinfromenble("false", "True", "True", "false", "false", "false", "false", "false", "false", "True");
        parent.setAgentStatus("空闲");
    }
    else {
        parent.document.getElementById("spanServerRes").innerHTML = "坐席置闲失败：" + strres;
        //parent.Form_setWinfromenble("false", "True", "True", "false", "false", "false", "false", "false", "false", "True");
    }
}

/*/// <summary>
/// 坐席置忙结果事件
/// </summary>
/// <param name="sender"></param>
/// <param name="blres"></param>
/// <param name="strres"></param>*/
function EvtSetBusy(blres, strres) {
    WriteFileLogs(1, "iframeocx.aspx", "EvtSetBusy");
    if (blres == "True") {
        parent.document.getElementById("spanServerRes").innerHTML = "坐席置忙成功";
        parent.setLinkStatus("True");
        parent.Form_setWinfromenble("false", "false", "false", "True", "false", "false", "false", "false", "false", "True");
        parent.setAgentStatus("忙");
    }
    else {
        parent.document.getElementById("spanServerRes").innerHTML = "坐席置忙失败：" + strres;
        //parent.Form_setWinfromenble("false", "True", "false", "True", "false", "false", "false", "false", "false", "True");
    }
}

/*/// <summary>
/// 电话保持结果事件
/// </summary>
/// <param name="sender"></param>
/// <param name="blres"></param>
/// <param name="strres"></param>*/
function EvtHold(blres, strres) {
    WriteFileLogs(1, "iframeocx.aspx", "EvtHold");
    if (blres == "True") {
        parent.document.getElementById("spanServerRes").innerHTML = "坐席保持成功";
        parent.setLinkStatus("True");
        parent.Form_setWinfromenble("True", "false", "false", "false", "false", "false", "false", "True", "false", "True");
        parent.setAgentStatus("忙");
    }
    else {
        parent.document.getElementById("spanServerRes").innerHTML = "坐席保持失败：" + strres;
        //parent.Form_setWinfromenble("false", "True", "false", "True", "false", "false", "false", "True", "false", "True");
    }
}

/*/// <summary>
/// 挂机结果事件
/// </summary>
/// <param name="sender"></param>
/// <param name="blres"></param>
/// <param name="strres"></param>*/
function EvtHangup(blres, strres) {
    WriteFileLogs(1, "iframeocx.aspx", "EvtHangup");
    if (blres == "True") {
        parent.document.getElementById("spanServerRes").innerHTML = "坐席挂机成功";
        parent.setLinkStatus("false");
        parent.Form_setWinfromenble("false", "True", "false", "True", "false", "false", "false", "True", "false", "True");
        parent.setAgentStatus("离席");
    }
    else {
        parent.document.getElementById("spanServerRes").innerHTML = "坐席挂机失败：" + strres;
        parent.Form_setWinfromenble("false", "True", "false", "True", "false", "false", "false", "True", "false", "True");
    }
}

/*/// <summary>
/// 咨询磋商结果事件
/// </summary>
/// <param name="sender"></param>
/// <param name="blres"></param>
/// <param name="strres"></param>*/
function EvtConsult(blres, strres) {
    WriteFileLogs(1, "iframeocx.aspx", "EvtConsult");
}

/*/// <summary>
/// 坐席外呼结果事件
/// </summary>
/// <param name="sender"></param>
/// <param name="blres"></param>
/// <param name="strres"></param>*/
function EvtCallOut(blres, strres) {
    WriteFileLogs(1, "iframeocx.aspx", "EvtCallOut");
    if (blres == "True") {
        parent.document.getElementById("spanServerRes").innerHTML = "坐席外呼成功";
        parent.Form_setWinfromenble("True", "false", "false", "false", "false", "false", "false", "false", "false", "false");
        parent.setAgentStatus("忙");
    }
    else {
        parent.document.getElementById("spanServerRes").innerHTML = "坐席外呼失败：" + strres;
        //parent.Form_setWinfromenble("false", "True", "false", "True", "false", "false", "false", "True", "false", "True");
    }
}

/*/// <summary>
/// 坐席登出结果事件
/// </summary>
/// <param name="sender"></param>
/// <param name="blres"></param>
/// <param name="strres"></param>*/
function EvtAgentLogout(blres, strres) {
    WriteFileLogs(1, "iframeocx.aspx", "EvtAgentLogout");
    if (blres == "True") {
        parent.document.getElementById("spanServerRes").innerHTML = "坐席签出成功";
        parent.setLinkStatus("false");
        parent.Form_setWinfromenble("false", "false", "false", "false", "false", "false", "false", "false", "True", "false");
        parent.setAgentStatus("离席");
    }
    else {
        parent.document.getElementById("spanServerRes").innerHTML = "坐席签出失败：" + strres;
        //parent.Form_setWinfromenble("false", "false", "false", "false", "false", "false", "false", "false", "True", "false");
    }
}

/*/// <summary>
/// 坐席登录结果事件
/// </summary>
/// <param name="sender"></param>
/// <param name="blres"></param>
/// <param name="strres"></param>*/
function EvtAgentLogin(blres, strres) {
    WriteFileLogs(1, "iframeocx.aspx", "EvtAgentLogin");
    if (blres == "True") {
        parent.document.getElementById("spanServerRes").innerHTML = "坐席签入成功";
        parent.setLinkStatus("True");
        parent.Form_setWinfromenble("false", "True", "True", "false", "false", "false", "false", "false", "false", "True");
        parent.setAgentStatus("空闲");
    }
    else {
        parent.document.getElementById("spanServerRes").innerHTML = "坐席签入失败：" + strres;
        parent.setLinkStatus("false");
        parent.Form_setWinfromenble("false", "false", "false", "false", "false", "false", "false", "false", "True", "false");
        parent.setAgentStatus("未签入");
    }
}

/*/// <summary>
/// 挂机事件
/// </summary>
/// <param name="sender"></param>*/
function EvtTelephoneHangup() {
    WriteFileLogs(1, "iframeocx.aspx", "EvtTelephoneHangup");
    if (blres == "True") {
        parent.document.getElementById("spanServerRes").innerHTML = "坐席挂机成功";
        parent.setLinkStatus("True");
        parent.Form_setWinfromenble("false", "True", "True", "false", "false", "false", "false", "false", "false", "True");
        parent.setAgentStatus("空闲");
    }
    else {
        parent.document.getElementById("spanServerRes").innerHTML = "坐席挂机失败：" + strres;
        parent.setLinkStatus("false");
        parent.Form_setWinfromenble("True", "True", "True", "false", "false", "false", "True", "false", "false", "True");
    }
}

/*/// <summary>
/// 服务状态改变事件
/// </summary>
/// <param name="sender"></param>
/// <param name="serverState"></param>*/
function EvtServerStateChange(serverState) {
    WriteFileLogs(1, "iframeocx.aspx", "EvtServerStateChange:" + serverState);
    var strstate = String(serverState);
    if (strstate.toLowerCase() == "true") {
        parent.document.getElementById("spanServerRes").innerHTML = "签入成功";
        parent.setLinkStatus("True");
        parent.setAgentStatus("空闲");
        parent.Form_setWinfromenble("false", "True", "True", "false", "false", "false", "false", "false", "false", "True");
    }
    else {
        parent.document.getElementById("spanServerRes").innerHTML = "未签入";
        parent.setLinkStatus("false");
        parent.setAgentStatus("未签入");
        parent.Form_setWinfromenble("false", "false", "false", "false", "false", "false", "false", "false", "True", "false");
    }
}

/*/// <summary>
/// 坐席状态改变事件
/// </summary>
/// <param name="sender"></param>
/// <param name="agentState"></param>*/
function EvtAgentStateChange(agentState) {
    WriteFileLogs(1, "iframeocx.aspx", "EvtAgentStateChange:" + agentState);
    switch (agentState) {
        case "-1":
            parent.document.getElementById("spanServerRes").innerHTML = "未知状态...";
            parent.setLinkStatus("false");
            parent.setAgentStatus("离席");
            parent.Form_setWinfromenble("false", "false", "false", "false", "false", "false", "false", "false", "True", "false");
            break;
        case "0":
            /*
            parent.document.getElementById("spanServerRes").innerHTML = "线路空闲";
            parent.setLinkStatus("True");
            parent.setAgentStatus("空闲");
            parent.Form_setWinfromenble("false", "True", "True", "false", "false", "false", "false", "false", "false", "True");
            parent.document.getElementById("divCustomerState").style.display = "none";
            parent.document.getElementById("spanCustomerState").innerHTML = "";
            */
            break;
        case "1":
            parent.document.getElementById("spanServerRes").innerHTML = "震铃";
            parent.setLinkStatus("True");
            parent.setAgentStatus("忙");
            parent.Form_setWinfromenble("false", "false", "false", "True", "false", "false", "false", "false", "false", "false");
            break;
        case "2":
            parent.document.getElementById("spanServerRes").innerHTML = "拨号";
            parent.setLinkStatus("True");
            parent.setAgentStatus("忙");
            parent.Form_setWinfromenble("false", "false", "false", "True", "false", "false", "false", "false", "false", "false");
            try {
                parent.becallout = true;
            }
            catch (e) { }
            break;
        case "3":
            parent.document.getElementById("spanServerRes").innerHTML = "通话中";
            parent.setLinkStatus("True");
            parent.setAgentStatus("忙");
            parent.Form_setWinfromenble("True", "false", "false", "false", "True", "True", "True", "false", "false", "false");
            try {
                parent.SetCallState(true);
            }
            catch (e) { }
            try {
                //如果是来电，更新来电通话开始时间
                if (parent.becallcome) {
                    parent.telajaxopt("../telmanage/ajax/telrecords.ashx?action=zhaijiEvent&callid=" + parent.document.getElementById("CallHjbh").value); //更新摘机事件  
                }
                if (parent.becallout) {
                    if (parent.CallOutRecordIsWrite == false) {
                        parent.CallOutRecordIsWrite = true;
                        parent.addCallOutInfo();
                    }
                    else {
                        parent.telajaxopt("../telmanage/ajax/telrecords.ashx?action=zhaijiEvent&callid=" + parent.document.getElementById("CallHjbh").value); //更新摘机事件 
                    }
                }
                setTimeout("parent.UpdateRecPath()", 1000);
            }
            catch (e) { }
            break;
        case "4":
            //保持
            parent.document.getElementById("spanServerRes").innerHTML = "坐席保持成功";
            parent.setLinkStatus("True");
            parent.Form_setWinfromenble("True", "false", "false", "false", "false", "false", "false", "True", "false", "True");
            parent.setAgentStatus("忙");
            /*
            parent.document.getElementById("spanServerRes").innerHTML = "话后处理";
            parent.setLinkStatus("True");
            parent.setAgentStatus("忙");
            parent.Form_setWinfromenble("false", "false", "false", "True", "false", "false", "false", "false", "false", "True");
            parent.telajaxopt("../telmanage/ajax/telrecords.ashx?action=guajiEvent&callid=" + parent.document.getElementById("CallHjbh").value); //更新挂机事件
            */
            break;
        case "5":
            //保持下拨号
            parent.document.getElementById("spanServerRes").innerHTML = "保持下拨号";
            parent.setLinkStatus("True");
            parent.Form_setWinfromenble("True", "false", "false", "false", "false", "false", "false", "True", "false", "True");
            parent.setAgentStatus("忙");
            /*
            parent.document.getElementById("spanServerRes").innerHTML = "置闲成功";
            parent.setLinkStatus("True");
            parent.setAgentStatus("空闲");
            parent.Form_setWinfromenble("false", "false", "false", "false", "false", "false", "false", "false", "false", "false");
            parent.document.getElementById("divCustomerState").style.display = "none";
            parent.document.getElementById("spanCustomerState").innerHTML = "";
            */
            break;
        case "6":
            //保持下通话
            parent.document.getElementById("spanServerRes").innerHTML = "保持下通话";
            parent.setLinkStatus("True");
            parent.Form_setWinfromenble("True", "false", "false", "false", "false", "false", "false", "True", "false", "True");
            parent.setAgentStatus("忙");
            break;
        case "7":
            //挂机
            /*
            parent.document.getElementById("spanServerRes").innerHTML = "注销";
            parent.setLinkStatus("false");
            parent.setAgentStatus("离席");
            parent.Form_setWinfromenble("false", "false", "false", "false", "false", "false", "false", "false", "false", "True");
            */
            break;
        case "8":
            //摘机
            parent.document.getElementById("spanServerRes").innerHTML = "摘机";
            parent.setLinkStatus("True");
            parent.setAgentStatus("忙");
            parent.Form_setWinfromenble("false", "false", "false", "True", "false", "false", "false", "false", "false", "false");
            try {
                parent.becallout = true;
            }
            catch (e) { }
            break;
        case "9":
            //咨询
            break;
        case "10":
            //转移
            break;
        case "11":
            //取保持
            break;
        case "12":
            //三方
            break;
        case "13":
            //会议
            break;
        case "14":
            //监听
            break;
        case "15":
            //强插
            break;
        case "16":
            //拦截
            break;
        case "-200":
            parent.document.getElementById("spanServerRes").innerHTML = "离席";
            parent.setLinkStatus("false");
            parent.setAgentStatus("离席");
            parent.Form_setWinfromenble("false", "false", "false", "false", "false", "false", "false", "false", "True", "false");
            break;
        case "-201":
            parent.document.getElementById("spanServerRes").innerHTML = "登录";
            parent.setLinkStatus("false");
            parent.setAgentStatus("离席");
            parent.Form_setWinfromenble("false", "false", "false", "false", "false", "false", "false", "false", "True", "false");
            break;
        case "-202":
            parent.document.getElementById("spanServerRes").innerHTML = "置闲";
            parent.setLinkStatus("True");
            parent.Form_setWinfromenble("false", "True", "True", "false", "false", "false", "false", "false", "false", "True");
            parent.setAgentStatus("空闲");
            break;
        case "-203":
            parent.document.getElementById("spanServerRes").innerHTML = "话务忙";
            parent.setLinkStatus("True");
            parent.setAgentStatus("忙");
            parent.Form_setWinfromenble("True", "false", "false", "false", "True", "True", "True", "false", "false", "false");
            break;
        case "-204":
            parent.document.getElementById("spanServerRes").innerHTML = "人工忙";
            parent.setLinkStatus("True");
            parent.Form_setWinfromenble("false", "false", "false", "True", "false", "false", "false", "false", "false", "True");
            parent.setAgentStatus("忙");
            break;
        case "-205":
            parent.document.getElementById("spanServerRes").innerHTML = "话后处理";
            parent.setLinkStatus("True");
            parent.setAgentStatus("忙");
            parent.Form_setWinfromenble("false", "false", "false", "True", "false", "false", "false", "false", "false", "True");
            var appid = "";
            try {
                //appid = parent.GetAPPID();
            }
            catch (e) { }
            parent.telajaxopt("../telmanage/ajax/telrecords.ashx?action=guajiEvent&callid=" + parent.document.getElementById("CallHjbh").value + "&appid=" + appid); //更新挂机事件

            try {
                if (parent.rgmstate) {
                    //人工忙时不自动置闲
                }
                else {
                    setTimeout("parent.AgentFree()", 1000 * 10);
                }
            }
            catch (e) { }

            try {
                parent.becallout = false;
                parent.becallcome = false;
                parent.CallOutRecordIsWrite = false;
            }
            catch (e) { }
            break;
        case "-206":
            parent.document.getElementById("spanServerRes").innerHTML = "被锁定分配";
            parent.setLinkStatus("True");
            parent.Form_setWinfromenble("false", "false", "false", "True", "false", "false", "false", "false", "false", "True");
            parent.setAgentStatus("忙");
            break;
        case "-207":
            parent.document.getElementById("spanServerRes").innerHTML = "强置忙";
            parent.setLinkStatus("True");
            parent.Form_setWinfromenble("false", "false", "false", "True", "false", "false", "false", "false", "false", "True");
            parent.setAgentStatus("忙");
            break;
        case "-208":
            parent.document.getElementById("spanServerRes").innerHTML = "置闲";
            parent.setLinkStatus("True");
            parent.Form_setWinfromenble("false", "True", "True", "false", "false", "false", "false", "false", "false", "True");
            parent.setAgentStatus("空闲");
            break;
        case "-209":
            parent.document.getElementById("spanServerRes").innerHTML = "业务锁定";
            parent.setLinkStatus("True");
            parent.Form_setWinfromenble("false", "false", "false", "True", "false", "false", "false", "false", "false", "True");
            parent.setAgentStatus("忙");
            break;
        case "81":
            parent.document.getElementById("spanServerRes").innerHTML = "等待操作";
            parent.setLinkStatus("True");
            parent.setAgentStatus("忙");
            parent.Form_setWinfromenble("false", "True", "false", "false", "false", "false", "false", "false", "false", "false");
            break;
        case "82":
            parent.document.getElementById("spanServerRes").innerHTML = "断开连接";
            parent.setLinkStatus("True");
            parent.setAgentStatus("空闲");
            parent.document.getElementById("divCustomerState").style.display = "none";
            parent.document.getElementById("spanCustomerState").innerHTML = "";
            parent.Form_setWinfromenble("false", "false", "True", "false", "false", "false", "false", "false", "false", "false");
            //20170814去掉
            //parent.telajaxopt("../telmanage/ajax/telrecords.ashx?action=guajiEvent&callid=" + parent.document.getElementById("CallHjbh").value); //更新挂机事件
            break;
        case "83":
            parent.document.getElementById("spanServerRes").innerHTML = "震铃";
            parent.setLinkStatus("True");
            parent.setAgentStatus("忙");
            parent.Form_setWinfromenble("false", "false", "false", "True", "false", "false", "false", "false", "false", "false");
            //parent.telajaxopt("../telmanage/ajax/telrecords.ashx?action=guajiEvent&callid=" + parent.document.getElementById("CallHjbh").value); //更新挂机事件
            break;
        case "84":
            parent.document.getElementById("spanServerRes").innerHTML = "置忙";
            parent.setLinkStatus("True");
            parent.setAgentStatus("忙");
            parent.Form_setWinfromenble("false", "false", "false", "True", "false", "false", "false", "false", "false", "false");
            //parent.telajaxopt("../telmanage/ajax/telrecords.ashx?action=guajiEvent&callid=" + parent.document.getElementById("CallHjbh").value); //更新挂机事件
            break;
        case "100":
            //呼入者状态
            parent.document.getElementById("divCustomerState").style.display = "none";
            parent.document.getElementById("spanCustomerState").innerHTML = "";
            break;
        case "101":
            //呼入者状态--播放坐席工号
            parent.document.getElementById("divCustomerState").style.display = "block";
            parent.document.getElementById("spanCustomerState").innerHTML = "呼入客户播放坐席工号中...";
            break;
        case "102":
            //呼入者状态--通话中
            parent.document.getElementById("divCustomerState").style.display = "block";
            parent.document.getElementById("spanCustomerState").innerHTML = "呼入客户通话中...";
            break;
        default:
            //parent.document.getElementById("spanServerRes").innerHTML = "忙";
            //parent.setLinkStatus("True");
            //parent.setAgentStatus("忙");
            //parent.Form_setWinfromenble("false", "false", "false", "True", "false", "false", "false", "false", "false", "True");
            break;
    }
}

/*/// <summary>
/// 来电弹屏事件
/// </summary>
/// <param name="sender"></param>
/// <param name="callerNum"></param>
/// <param name="callID"></param>
/// <param name="dataParam"></param>*/
function EvtCallComming(callerNum, callID, calltype, dataParam, callednum) {
    WriteFileLogs(1, "iframeocx.aspx", "EvtCallComming");
    try {
        var userid = parent.document.getElementById("txtAgentId").value;
        var usercode = parent.document.getElementById("lblAgentCode").innerHTML;
        var username = parent.document.getElementById("lblAgentName").innerHTML;
        var extnumber = parent.document.getElementById("lblAgentExt").innerHTML;
        //获取呼叫编号
        //var callid = parent.telajaxopt("../telmanage/ajax/telrecords.ashx?action=getCallIdByPhone&telphone=" + callerNum);
        parent.document.getElementById("CallHjbh").value = callID;
        username = encodeURI(username);
        parent.telajaxopt("../telmanage/ajax/telrecords.ashx?action=zhenlingEvent&callid=" + callID + "&userid=" + userid + "&usercode=" + usercode + "&username=" + username + "&extnumber" + extnumber + "&callernum=" + callerNum);   //更新摘机事件
    } catch (e) {
        alert(e.Message);
    }
    parent.Form_callCommingCaller(callerNum, callID, callednum);
}

/*/// <summary>
/// 外呼振铃
/// </summary>
/// <param name="sender"></param>
/// <param name="callerNum">来电号码</param>
/// <param name="callID">呼叫编号</param>
/// <param name="dataParam">任务Id</param>*/
function EvtCallOutRing(callerNum, callID, dataParam) {
    WriteFileLogs(1, "iframeocx.aspx", "EvtCallOutRing");
    try {
        //alert("外呼振铃：" + callerNum + ":" + callID + ":" + dataParam);
    } catch (e) {

    }
}

/*/// <summary>
/// 录音通知事件
/// </summary>
/// <param name="sender"></param>
/// <param name="path">path</param>
/// <param name="callID">呼叫编号</param>
/// <param name="dataParam">任务Id</param>*/
function EvtRecordInfo(path, callID, dataParam) {
    callID = parent.document.getElementById("CallHjbh").value;
    WriteFileLogs(1, "iframeocx.aspx", "EvtRecordInfo: path=" + path + ";callID:" + callID + ";dataParam=" + dataParam);
    try {
        //alert("外呼振铃：" + callerNum + ":" + callID + ":" + dataParam);
        parent.telajaxopt("../telmanage/ajax/telrecords.ashx?action=luyinEvent&callid=" + callID + "&path=" + path);  //录音开始事件
        //Form_setWinfromenble("True", "false", "false", "false", "True", "True", "True", "false", "false", "false");
        parent.telajaxopt("../telmanage/ajax/telrecords.ashx?action=guajiEvent&callid=" + parent.document.getElementById("CallHjbh").value); //更新挂机事件
    } catch (e) {

    }
}

/*-----------------------------------------------------------*/
//var ismonitoring = false;//是否开启监控
/*/// <summary>
/// 订阅数据改变通知事件
/// </summary>
/// <param name="sender"></param>
/// <param name="type"></param>
/// <param name="data1"></param>
/// <param name="data2"></param>
/// <param name="substr"></param>*/
function EvtSubscribeDataChanged(type, data1, data2, substr) {
    WriteFileLogs(1, "iframeocx.aspx", "EvtSubscribeDataChanged--type(" + type + ")--data1(" + data1 + ")--data2(" + data2 + ")--substr(" + substr + ")");
    if (parent.document.getElementById("ismonitoring").value == "false")
        return false;
    try {
        switch (type) {
            case "0":
                //坐席状态
                parent.window.frames["frame_zxjkgl"].GetState(data1, substr);
                //document.getElementById("frame_zxjkgl").GetState(data1, substr);
                break;
            case "1":
                //线路状态
                if (substr == "5") {
                    parent.window.frames["frame_zxjkgl"].GetState(data1, "9");
                }
                break;
            case "2":
                //空闲坐席
                break;
            case "3":
                //忙
                break;
            case "4":
                //来电振铃
                if (substr != "") {
                    var arr = substr.split('|');
                    for (var i = 0; i < arr.length; i++) {
                        parent.window.frames["frame_zxjkgl"].GetState(arr[i].split(',')[0], "9");
                    }
                }
                break;
            case "5":
                //通话中
                break;
            default:
                break;
        }
    } catch (e) {
        WriteFileLogs(1, "iframeocx.aspx-javascript", "EvtSubscribeDataChanged:" + e.Message);
    }
}

/*/// <summary>
/// <summary>
/// 强制坐席状态结果通知事件
/// </summary>
/// <param name="sender"></param>
/// <param name="blres"></param>
/// <param name="callid"></param>
/// <param name="strres"></param>*/
function EvtForceAgentState(blres, callid, strres) {
    callID = parent.document.getElementById("CallHjbh").value;
    WriteFileLogs(1, "iframeocx.aspx", "EvtForceAgentState--blres(" + blres + ")--callid(" + callid + ")--strres(" + strres + ")");
    if (parent.document.getElementById("ismonitoring").value == "false")
        return false;
    if (blres == "True") {
        parent.document.getElementById("spanServerRes").innerHTML = "强制坐席状态成功";
    }
    else {
        parent.document.getElementById("spanServerRes").innerHTML = "强制坐席状态失败：" + strres;
    }
}
/*/// <summary>
/// 监控获取坐席状态事件
/// </summary>
/// <param name="sender"></param>
/// <param name="agentid"></param>
/// <param name="agentext"></param>
/// <param name="groupid"></param>
/// <param name="agentstate">0=离席、1=登录、2=置闲、3=话务忙、4=人工忙、5=话后忙、6=被锁定分配、7=强置忙、8=强置闲</param>*/
function EvtOnAgentState(agentid, agentext, groupid, agentstate) {
    WriteFileLogs(1, "iframeocx.aspx", "EvtOnAgentState--agentid(" + agentid + ")--agentext(" + agentext + ")--agentstate(" + agentstate + ")--groupid(" + groupid + ")");
    if (parent.document.getElementById("ismonitoring").value == "false")
        return false;
    try {
        parent.window.frames["frame_zxjkgl"].GetState(agentid, agentstate);
    } catch (e) {
        WriteFileLogs(1, "iframeocx.aspx-javascript", "EvtOnAgentState:" + e.Message);
    }
}

//------------------------------------------------------------------------会议相关
/*/// <summary>
/// <summary>
/// 创建会议事件
/// </summary>
/// <param name="sender"></param>
/// <param name="blres"></param> 
/// <param name="strres"></param>*/
function EvtOnCreateConference(blres, strres) {
    WriteFileLogs(1, "iframeocx.aspx", "EvtOnCreateConference--blres(" + blres + ")-- strres(" + strres + ")");
    try {
        parent.window.frames["frame_hwgl_phonehy"].OptOnCreateConference(blres, strres);
    } catch (e) {
        WriteFileLogs(1, "iframeocx.aspx-javascript", "EvtOnCreateConference:" + e.Message);
    }
}
/*/// <summary>
/// <summary>
/// 删除会议事件
/// </summary>
/// <param name="sender"></param>
/// <param name="blres"></param> 
/// <param name="strres"></param>*/
function EvtOnDeleteConference(blres, strres) {
    WriteFileLogs(1, "iframeocx.aspx", "EvtOnDeleteConference--blres(" + blres + ")-- strres(" + strres + ")");
    try {
        parent.window.frames["frame_hwgl_phonehy"].OptOnDeleteConference(blres, strres);
    } catch (e) {
        WriteFileLogs(1, "iframeocx.aspx-javascript", "EvtOnDeleteConference:" + e.Message);
    }
}
/*/// <summary>
/// <summary>
/// 加入会议事件
/// </summary>
/// <param name="sender"></param>
/// <param name="blres"></param> 
/// <param name="strres"></param>*/
function EvtOnAddMemberToConference(blres, strres) {
    WriteFileLogs(1, "iframeocx.aspx", "EvtOnAddMemberToConference--blres(" + blres + ")-- strres(" + strres + ")");
    try {
        parent.window.frames["frame_hwgl_phonehy"].OptOnAddMemberToConference(blres, strres);
    } catch (e) {
        WriteFileLogs(1, "iframeocx.aspx-javascript", "EvtOnAddMemberToConference:" + e.Message);
    }
}
/*/// <summary>
/// <summary>
/// 踢出会议事件
/// </summary>
/// <param name="sender"></param>
/// <param name="blres"></param> 
/// <param name="strres"></param>*/
function EvtOnRemoveMemberFromConference(blres, strres) {
    WriteFileLogs(1, "iframeocx.aspx", "EvtOnRemoveMemberFromConference--blres(" + blres + ")-- strres(" + strres + ")");
    try {
        parent.window.frames["frame_hwgl_phonehy"].OptOnRemoveMemberFromConference(blres, strres);
    } catch (e) {
        WriteFileLogs(1, "iframeocx.aspx-javascript", "EvtOnRemoveMemberFromConference:" + e.Message);
    }
}
/*/// <summary>
/// <summary>
/// 静音会议事件
/// </summary>
/// <param name="sender"></param>
/// <param name="blres"></param> 
/// <param name="strres"></param>*/
function EvtOnMuteMemberInConference(blres, strres) {
    WriteFileLogs(1, "iframeocx.aspx", "EvtOnMuteMemberInConference--blres(" + blres + ")-- strres(" + strres + ")");
    try {
        parent.window.frames["frame_hwgl_phonehy"].OptOnMuteMemberInConference(blres, strres);
    } catch (e) {
        WriteFileLogs(1, "iframeocx.aspx-javascript", "EvtOnMuteMemberInConference:" + e.Message);
    }
}
/*/// <summary>
/// <summary>
/// 取消静音会议事件
/// </summary>
/// <param name="sender"></param>
/// <param name="blres"></param> 
/// <param name="strres"></param>*/
function EvtOnUnMuteMemberInConference(blres, strres) {
    WriteFileLogs(1, "iframeocx.aspx", "EvtOnUnMuteMemberInConference--blres(" + blres + ")-- strres(" + strres + ")");
    try {
        parent.window.frames["frame_hwgl_phonehy"].OptOnUnMuteMemberInConference(blres, strres);
    } catch (e) {
        WriteFileLogs(1, "iframeocx.aspx-javascript", "EvtOnUnMuteMemberInConference:" + e.Message);
    }
} 