Esempio n. 1
0
 internal StartMonitoringSessionAsyncResult(MonitoringChannel channel, Agent agentToMonitor, AcdSupervisorSession session, AsyncCallback userCallback, object state)
     : base(userCallback, state)
 {
     _session        = session;
     _agentToMonitor = agentToMonitor;
     _channel        = channel;
 }
Esempio 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();
            }
        }
Esempio 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;
            }
        }
Esempio n. 4
0
 internal ShutDownAsyncResult(AcdSupervisorSession session, AsyncCallback userCallback, object state) : base(userCallback, state)
 {
     _supervisorSession = session;
 }