Ejemplo n.º 1
0
 internal StartMonitoringSessionAsyncResult(MonitoringChannel channel, Agent agentToMonitor, AcdSupervisorSession session, AsyncCallback userCallback, object state)
     : base(userCallback, state)
 {
     _session        = session;
     _agentToMonitor = agentToMonitor;
     _channel        = channel;
 }
Ejemplo n.º 2
0
        private void HandleIncomingInstantMessagingCalls(object sender, CallReceivedEventArgs <InstantMessagingCall> args)
        {
            if (_matchMakerState == MatchMakerState.Started)
            {
                AcdSupervisorSession supervisorSession = null;

                Configuration.Supervisors.ForEach(sup =>
                {
                    if (SipUriCompare.Equals(sup.SignInAddress, args.RemoteParticipant.Uri))
                    {
                        supervisorSession = new AcdSupervisorSession(this, sup, _logger);
                        supervisorSession.StateChanged += this.OnSupervisorSessionStateChanged;
                        lock (_syncRoot)
                        {
                            _sessions.Add(supervisorSession);
                        }
                        supervisorSession.HandleSupervisorInitialCall(args.Call);
                        return;
                    }
                });

                if (null == supervisorSession)
                {
                    args.Call.Decline();
                }
            }
            else
            {
                args.Call.Decline();
            }
        }
Ejemplo n.º 3
0
        private void OnSupervisorSessionStateChanged(object sender, SupervisorSessionStateChangedEventArgs e)
        {
            AcdSupervisorSession session = sender as AcdSupervisorSession;

            switch (e.NewState)
            {
            case SupervisorSessionState.Terminating:
                lock (_syncRoot)
                {
                    _sessions.Remove(session);
                }
                break;

            case SupervisorSessionState.Terminated:
                session.StateChanged -= this.OnSupervisorSessionStateChanged;
                break;
            }
        }
Ejemplo n.º 4
0
 internal ShutDownAsyncResult(AcdSupervisorSession session, AsyncCallback userCallback, object state) : base(userCallback, state)
 {
     _supervisorSession = session;
 }