/// 置闲完成后触发事件
        /// <summary>
        /// 置闲完成后触发事件
        /// </summary>
        /// <param name="callback"></param>
        private void AfterToReadyCallBack(Action <object> callback, string name)
        {
            //当前状态
            PhoneStatus cur = HollyContactHelper.ConvertPhoneStatus(HollyContactHelper.Instance.GetCurStatus());

            //判断是异步触发还是同步触发
            if (cur != PhoneStatus.PS03_置闲)
            {
                HollyContactHelper.Instance.ToReady();
                //注册事件,当状态有cur变成【PS03_置闲】时触发
                AfterActionEventManage.RegisterOnceAfterActionEvent1(cur, PhoneStatus.PS03_置闲, callback, null, "置闲完成后触发事件-" + name);
            }
            else
            {
                callback(null);
            }
        }
Example #2
0
        /// 签入之后自动转休息
        /// <summary>
        /// 签入之后自动转休息
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void AxUniSoftPhone_OnStatusChange(object sender, EventArgs e)
        {
            var pre = HollyContactHelper.ConvertPhoneStatus(HollyContactHelper.Instance.GetPreStatus());
            var cur = HollyContactHelper.ConvertPhoneStatus(HollyContactHelper.Instance.GetCurStatus());

            if ((pre == PhoneStatus.PS01_就绪 || pre == PhoneStatus.PS02_签出) && cur == PhoneStatus.PS04_置忙)
            {
                //签入成功,要自动休息。设置置忙到置闲,设置置闲到休息
                HollyContactHelper.Instance.SetReady();
                HollyContactHelper.Instance.RestStart(BusyStatus.BS0_自动);
            }
            else if ((pre == PhoneStatus.PS01_就绪 || pre == PhoneStatus.PS02_签出) && cur == PhoneStatus.PS03_置闲)
            {
                //签入成功,要自动休息。从置闲转到休息
                HollyContactHelper.Instance.RestStart(BusyStatus.BS0_自动);
            }
        }
        /// 状态变化事件
        /// <summary>
        /// 状态变化事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void AxUniSoftPhone_OnStatusChange(object sender, EventArgs e)
        {
            Loger.Log4Net.Info("[事件][AxUniSoftPhone_OnStatusChange] 状态变化事件");

            PhoneStatus pre = HollyContactHelper.ConvertPhoneStatus(HollyContactHelper.Instance.GetPreStatus());
            PhoneStatus cur = HollyContactHelper.ConvertPhoneStatus(HollyContactHelper.Instance.GetCurStatus());

            //优先级从高到低
            //更新客服状态表
            UpdatAgentDBAsync(HollyContactHelper.ConvertAgentState(cur));
            //操作完成事件触发
            AfterActionEventManage.ActionEvent(pre, cur);
            //设置界面
            SetMainStatus(cur);
            //设置状态条
            ShowStatusTool(cur, HollyContactHelper.ConvertAgentState(cur));
        }