/*
/// <summary>
/// 坐席登录
/// </summary>
/// <param name="serverIP">服务IP地址</param>
/// <param name="serverPort">服务端口号</param>
/// <param name="agentID">坐席工号</param>
/// <param name="groupID">技能组号</param>
/// <param name="extPhone">分机号码</param>
/// <returns></returns>
*/
function OCX_AgentLogin(serverIP, serverPort, agentID, groupID, extPhone)
{
    try {
        var bl= window.external.WebCall_AgentLogin(serverIP, serverPort, agentID, groupID);
        return bl;
    }
    catch (e) {
    return false;
    }
}


/*
/// <summary>
/// 坐席退出
/// </summary>
/// <returns></returns>
*/
function OCX_AgentLogOut() {
    try {
        var bl = window.external.WebCall_AgentLogOut();
        return bl;
    }
    catch (e) {
        return false;
    }
}


/*
/// <summary>
/// 坐席外呼
/// </summary>
/// <param name="calltype">呼叫类型</param>
/// <param name="callerNum">主叫号码</param>
/// <param name="calledNum">被叫号码</param>
/// <returns>true 外呼成功 ; false 外呼失败</returns>
*/
function OCX_CallOut(calltype, callerNum, calledNum) {
    try {
        var bl = window.external.WebCall_CallOut(calltype, callerNum, calledNum);
        return bl;
    }
    catch (e) {
        return false;
    }
}


/*
/// <summary>
/// 置忙
/// </summary>
/// <returns></returns>
*/
function OCX_SetBusy() {
    try {
        var bl = window.external.WebCall_SetBusy();
        return bl;
    }
    catch (e) {
        return false;
    }
}


/*
/// <summary>
/// 置闲
/// </summary>
/// <returns></returns>
*/
function OCX_SetFree() {
    try {
        var bl = window.external.WebCall_SetFree();
        return bl;
    }
    catch (e) {
        return false;
    }
}


/*
/// <summary>
/// 保持
/// </summary>
/// <returns></returns>
*/
function OCX_Hold() {
    try {
        var bl = window.external.WebCall_Hold();
        return bl;
    }
    catch (e) {
        return false;
    }
}

/*
/// <summary>
/// 接回
/// </summary>
/// <returns></returns>
*/
function OCX_UnHold() {
    try {
        var bl = window.external.WebCall_UnHold();
        return bl;
    }
    catch (e) {
        return false;
    }
}


/*
/// <summary>
/// 挂机
/// </summary>
/// <returns></returns>
*/
function OCX_Hangup() {
    try {
        var bl = window.external.WebCall_Hangup();
        return bl;
    }
    catch (e) {
        return false;
    }
}



/*
/// <summary>
/// 转移到电话
/// </summary>
/// <param name="phone">转移号码</param>
/// <returns>转移结果</returns>
*/
function OCX_TransferToPhone(phone) {
    try {
        var bl = window.external.WebCall_TransferToPhone(phone);
        return bl;
    }
    catch (e) {
        return false;
    }
}


/*
/// <summary>
/// 咨询到电话
/// </summary>
/// <param name="phone">咨询号码</param>
/// <returns>咨询结果</returns>
*/
function OCX_Consult(phone) {
    try {
        var bl = window.external.WebCall_Consult(phone);
        return bl;
    }
    catch (e) {
        return false;
    }
}


/*
/// <summary>
/// 三方通话
/// </summary>
/// <param name="phone">电话号码</param>
/// <returns>三方通话结果</returns>
*/
function OCX_ThirdParty(phone) {
    try {
        var bl = window.external.WebCall_ThirdParty(phone);
        return bl;
    }
    catch (e) {
        return false;
    }
}


/*
/// <summary>
/// 转回IVR
/// </summary>
/// <param name="ivrID">IVR编号</param>
/// <param name="dataParam">数据参数</param>
/// <returns>结果</returns>
*/
function OCX_TransferToIVR(ivrID, dataParam) {
    try {
        var bl = window.external.WebCall_TransferToIVR(ivrID, dataParam);
        return bl;
    }
    catch (e) {
        return false;
    }
}

/*
/// <summary>
/// 订阅数据
/// </summary>
/// <param name="type">订阅类型</param>
/// 0坐席状态 1线路状态 2 空闲坐席列表 3.忙坐席列表 4.来电振铃坐席列表 5 通话坐席列表 
/// 6 外线排队数目 7 指定座席组中座席的状态 8 指定坐席组外线排队的数量 9 指定呼叫任务所占用的外线数量
/// <param name="dataParam">数据参数</param>
/// <returns>结果</returns>
*/
function OCX_SubscribeData(type, dataParam) {
    try {
        var bl = window.external.WebCall_SubscribeData(type, dataParam);
        return bl;
    }
    catch (e) {
        return false;
    }
}

/*
/// <summary>
/// 取消订阅数据
/// </summary>
/// <param name="type">订阅类型</param>
/// 0坐席状态 1线路状态 2 空闲坐席列表 3.忙坐席列表 4.来电振铃坐席列表 5 通话坐席列表 
/// 6 外线排队数目 7 指定座席组中座席的状态 8 指定坐席组外线排队的数量 9 指定呼叫任务所占用的外线数量
/// <param name="dataParam">数据参数</param>
/// <returns>结果</returns>
*/
function OCX_CancelSubscribeData(type, dataParam) {
    try {
        var bl = window.external.WebCall_CancelSubscribeData(type, dataParam);
        return bl;
    }
    catch (e) {
        return false;
    }
}

/*
/// <summary>
/// 强制指定坐席状态 
/// </summary>
/// 
/// <param name="agentcode">坐席工号</param>
/// <param name="state">坐席状态</param>
/// <returns>结果</returns>
*/
function OCX_ForceAgentState(agentcode, state) {
    try {
        var bl = window.external.WebCall_ForceAgentState(agentcode, state);
        return bl;
    }
    catch (e) {
        return false;
    }
}