예제 #1
0
 public AgentState(int id, string description, AgentSwitchMode ctiMode, string code, bool agentSelectable, string name = null, bool outboundEnabled = false)
 {
     this.Id                = id;
     this.Description       = description;
     this.SwitchMode        = ctiMode;
     this.Code              = code;
     this.AgentSelectable   = agentSelectable;
     this.IsOutboundEnabled = outboundEnabled;
     this.Name              = name ?? description;
 }
예제 #2
0
        private AgentState getAgentState(AgentStateMessage message)
        {
            AgentSwitchMode switchMode = AgentSwitchMode.NewReason;

            switch (message.State)
            {
            case SwitchAgentState.Available:
                switchMode = AgentSwitchMode.Ready;
                break;

            case SwitchAgentState.Busy:
                switchMode = AgentSwitchMode.NotReady;
                break;

            case SwitchAgentState.HandlingInteraction:
                switchMode = AgentSwitchMode.HandlingInteraction;
                break;

            case SwitchAgentState.LoggedIn:
                switchMode = AgentSwitchMode.LoggedIn;
                break;

            case SwitchAgentState.WrapUp:
                switchMode = AgentSwitchMode.WrapUp;
                break;

            default:
                break;
            }

            // TODO: Better match
            var agentState = InteractionManager.AgentStates.FirstOrDefault(s => s.SwitchMode == switchMode);

            if (agentState == null)
            {
                agentState = StandardAgentStates.Unknown;
            }

            return(agentState);
        }