예제 #1
0
        public ACDResponse Login(string agentId, string pwd, string extension)
        {
            string token = "";

            token = ACDService.AgentLogin(agentId, extension, pwd);
            return(new ACDResponse(token, true));
        }
예제 #2
0
 public QueueStatistics[] GetAgentQueueStatistics(string token, string extension)
 {
     QueueStatistics[] ast = null;
     if (ValidateACDToken(token, extension))
     {
         log.Debug("Get agent statistics: " + ACDService.GetAgentIdFromToken(token));
         ast = ACDService.GetQueueStatistics(ACDService.GetAgentIdFromToken(token));
     }
     return(ast);
 }
예제 #3
0
        public ACDResponse SetAgentState(string token, string extension, ushort reasoncode, ushort state)
        {
            bool success = false;

            if (ValidateACDToken(token, extension))
            {
                log.Debug("Set agent state: " + ACDService.GetAgentIdFromToken(token));
                success = ACDService.ChangeAgentState(ACDService.GetAgentIdFromToken(token), ACDService.GetExtensionFromToken(token), ACDService.GetPwdFromToken(token), reasoncode, state);
            }
            return(new ACDResponse(ACDService.UpdateToken(token), success));
        }
예제 #4
0
        public ACDResponse Logoff(string token, string extension)
        {
            bool success = false;

            if (ValidateACDToken(token, extension))
            {
                log.Debug("Logoff agent: " + ACDService.GetAgentIdFromToken(token));
                success = ACDService.AgentLogoff(ACDService.GetAgentIdFromToken(token), ACDService.GetExtensionFromToken(token), ACDService.GetPwdFromToken(token));
            }
            return(new ACDResponse(ACDService.UpdateToken(token), success));
        }
예제 #5
0
        private bool ValidateACDToken(string token, string extension)
        {
            bool isValid = false;

            log.Debug("Validate acd token: " + token);
            try
            {
                isValid = ACDService.Validate(token, extension);
            }
            catch (AuthenticationExpiredException aee)
            {
                log.Error("ACD Token is invalid: token as expired");
                throw aee;
            }
            catch (AuthenticationMismatchException ame)
            {
                log.Error("ACD Token is invalid: token does not match dn");
                throw ame;
            }
            log.Debug("ACD Token is valid: " + isValid.ToString());
            return(isValid);
        }
예제 #6
0
 public ReasonCode[] GetNotReadyReasonCodes()
 {
     return(ACDService.GetNotReadyReasonCodes());
 }
예제 #7
0
 public ReasonCode[] GetLogoffReasonCodes()
 {
     return(ACDService.GetLogoffReasonCodes());
 }