Exemplo n.º 1
0
        public override bool Equals(object obj)
        {
            bool b = base.Equals(obj);

            if (b)
            {
                if (obj != null && obj is AgentLineControl)
                {
                    AgentLineControl alc = obj as AgentLineControl;
                    if (!(alc.agentid == this.agentid && alc.agentstate == this.agentstate && alc.callcentercall.Equals(this.callcentercall)))
                    {
                        b = false;
                    }
                }
            }
            return(b);
        }
Exemplo n.º 2
0
 public AgentLineControl GetAgentLineControl(AgentLineControl ag)
 {
     AgentLineControl lControl = ag;
     log.Debug("Received GetAgentLineControl: " + ag.ToString());
     if (Global.cacheMgr != null)
     {
         if (Global.cacheMgr.Contains(ag.directoryNumber))
         {
             log.Debug("This agent is in cache: " + ag.directoryNumber);
             lControl = (AgentLineControl)Global.cacheMgr.GetData(ag.directoryNumber);
             int compteur = 0;
             while (lControl.Equals(ag) && compteur <= int.Parse(WebConfigurationManager.AppSettings.Get("LineControlServerTimeOut")))
             {
                 Thread.Sleep(int.Parse(WebConfigurationManager.AppSettings.Get("LineControlServerSleepTime")));
                 lControl = (AgentLineControl)Global.cacheMgr.GetData(ag.directoryNumber);
                 compteur++;
             }
         }
     }
     else
     {
         log.Debug("Cache Manager is null");
     }
     log.Debug("Return AgentLineControl: " + lControl.ToString());
     return lControl;
 }
Exemplo n.º 3
0
 public bool SetAgentLineControl(string extension, string agentid, AgentState state, CallCenterCall ccc)
 {
     bool success = false;
     try
     {
         if (Global.cacheMgr != null)
         {
             log.Debug("Adding or update agentlinecontrol: " + extension + state.ToString());
             if (Global.cacheMgr.Contains(extension) && Global.cacheMgr.GetData(extension) is AgentLineControl)
             {
                 AgentLineControl currentAgentLineControl = ((AgentLineControl)Global.cacheMgr.GetData(extension));
                 currentAgentLineControl.agentstate = state;
                 currentAgentLineControl.callcentercall = ccc;
                 Global.cacheMgr.Add(extension, currentAgentLineControl);
             }
             else
             {
                 AgentLineControl alc = new AgentLineControl();
                 LineControl lc = ((LineControl)Global.cacheMgr.GetData(extension));
                 alc.agentid = agentid;
                 alc.agentstate = state;
                 alc.callcentercall = ccc;
                 alc.directoryNumber = lc.directoryNumber;
                 alc.doNotDisturb = lc.doNotDisturb;
                 alc.forward = lc.forward;
                 alc.lineControlConnection = lc.lineControlConnection;
                 alc.mwiOn = lc.mwiOn;
                 alc.status = lc.status;
                 alc.monitored = lc.monitored;
                 Global.cacheMgr.Add(extension, alc);
             }
             success = true;
         }
         return success;
     }
     catch (Exception e)
     {
         log.Error("Error while setting agentlinecontrol : " + e.Message);
         return success;
     }
 }