Exemplo n.º 1
0
        private void OnFinished(object sender)
        {
            if ((_State == IntrusionState.On) && (_AssociateCall.CallId >= 0))
            {
                SipAgent.SendInfo(_AssociateCall.CallId, INTRUSION_COMPLETED);
            }

            _Conference = null;
            Dispose();
        }
Exemplo n.º 2
0
        private bool MakeIntrusion()
        {
            List <TlfPosition> activeCalls = Top.Tlf.ActiveCalls;

            Debug.Assert(activeCalls.Count == 1);

            if ((Top.Cfg.Permissions & Permissions.Intruded) != Permissions.Intruded)
            {
                return(false);
            }

            foreach (TlfPosition tlf in activeCalls)
            {
                if (tlf.EfectivePriority == CORESIP_Priority.CORESIP_PR_EMERGENCY)
                {
                    return(false);
                }

                switch (tlf.State)
                {
                case TlfState.In:                                               // Ocurre cuando hemos aceptado la llamada pero todavía no tenemos ack
                case TlfState.RemoteIn:
                case TlfState.InPrio:
                case TlfState.Out:
                case TlfState.Congestion:
                case TlfState.OutOfService:
                case TlfState.Busy:
                    return(false);
                }
            }

            TlfPosition actTlf;

            //Protección para un caso visto en pruebas
            if (activeCalls.Count > 0)
            {
                actTlf = activeCalls[0];
            }
            else
            {
                _Logger.Error("ERROR intruyendo, no active call");
                return(false);
            }

            _Conference              = new TlfConference();
            _Conference.MemberAdded += OnMemberAdded;
            _Conference.Finished    += OnFinished;
            _OwnConference           = true;

            try
            {
                _Conference.TryAddExisting(actTlf);

                _State = IntrusionState.InProgress;
                Top.Tlf.ActivityChanged -= OnActivityChanged;
            }
            catch (Exception ex)
            {
                _Logger.Error("ERROR intruyendo " + actTlf.Literal, ex);
                return(false);
            }

            return(true);
        }