Beispiel #1
0
        private void UpdateAgentStatus(AgentState status)
        {
            try
            {
                Logger.Instance.LogMessage(Logger.LoggerFiles.DuoLogger5, string.Format("UpdateAgentStatus. {0} To {1}", _agentPreviouState, _agentCurrentState), Logger.LogLevel.Info);

                new SwitchOnType <AgentState>(status)
                .Case <AgentAcw>(ac =>
                {
                    OnAgentStatusUpdating();
                    ArdsHandler.ResourceStatusChangeACW(UserAuth, CallSessionId);
                    OnAgentStatusUpdated();
                })
                .Case <AgentBreak>(asc =>
                {
                    OnAgentStatusUpdating();
                    ArdsHandler.ResourceStatusChangeBreak(UserAuth, CallSessionId);
                    OnAgentStatusUpdated();
                })
                .Case <AgentBusy>(conf =>
                {
                    OnAgentStatusUpdating();
                    ArdsHandler.ResourceStatusChangeBusy(UserAuth, CallSessionId);
                    OnAgentStatusUpdated();
                })
                .Case <AgentIdle>(cont =>
                {
                    OnAgentStatusUpdating();
                    var reply = ArdsHandler.SendStatusChangeRequestIdel(UserAuth, CallSessionId);
                    BreakRequsetHandle(reply.Command);
                    OnAgentStatusUpdated();
                });
                //.Case<AgentInitiate>(disc => SetDisconnectDialPad())
                //.Case<AgentOffline>(spotTrade => SetHoldDialPad())
                //.Default<AgentState>(t => DisableRingtone());
            }
            catch (Exception exception)
            {
                Logger.Instance.LogMessage(Logger.LoggerFiles.DuoDefault, "UpdateAgentStatus", exception, Logger.LogLevel.Error);
                OnAgentStatusUpdated();
            }
        }
Beispiel #2
0
 private void ChangeUI(AgentState state)
 {
     try
     {
         new ComMethods.SwitchOnType <AgentState>(state)
         .Case <AgentInitiate>(initiate =>
         {
             UiState.InInitiateState();
         })
         .Case <AgentIdle>(i =>
         {
             UiState.InIdleState();
             ResoursHandler.SendStatusChangeRequestIdel(Auth, CallSessionId);
         })
         .Case <AgentBusy>(b =>
         {
             UiState.InCallRingingState();      // (CallDirection);
             if (CallDirection == CallDirection.Incoming)
             {
                 ResoursHandler.ResourceStatusChangeBusy(Auth, CallSessionId);
             }
         })
         .Case <AgentAcw>(b =>
         {
             UiState.InAcwState();
             ResoursHandler.ResourceStatusChangeAcw(Auth, CallSessionId);
         })
         .Case <AgentBreak>(b =>
         {
             UiState.InBreakState();
             ResoursHandler.ResourceStatusChangeBreak(Auth, CallSessionId);
         })
         .Case <AgentOffline>(b => UiState.InOfflineState())
         .Default <AgentState>(t => UiState.InOfflineState());
     }
     catch (Exception exception)
     {
         Logger.Instance.LogMessage(Logger.LoggerFiles.DuoDefault, "Agent ChangeUI", exception, Logger.LogLevel.Error);
     }
 }
Beispiel #3
0
 public Agent()
 {
     AgentCurrentMode   = new AgentMode();
     AgentPreviousMode  = new AgentMode();
     _agentCurrentState = new AgentInitiate();
 }