예제 #1
0
 public void Update(int callId, string localId, string remoteId, SipChannel ch, SipRemote remote, SipLine line)
 {
     _Id       = callId;
     _LocalId  = localId;
     _RemoteId = remoteId;
     _Ch       = ch;
     _Remote   = remote;
     _Line     = line;
 }
예제 #2
0
        private SipCallInfo(int callId, string localId, string remoteId, CORESIP_Priority priority, CORESIP_CallType type, SipChannel ch, SipRemote remote, SipLine line)
        {
            _Id       = callId;
            _LocalId  = localId;
            _RemoteId = remoteId;
            _Priority = priority;
            _Ch       = ch;
            _Remote   = remote;
            _Line     = line;

            switch (type)
            {
            case CORESIP_CallType.CORESIP_CALL_MONITORING:
            case CORESIP_CallType.CORESIP_CALL_GG_MONITORING:
            case CORESIP_CallType.CORESIP_CALL_AG_MONITORING:
                _Monitoring = true;
                break;
            }
        }
        ///Tests para probar cuando se corta la llamada y pasa la tecla a reposo
        ///por una sectorización con cambios.
        ///Hay una llamada con canal, pero sin callId
        public void ChangeConfig3()
        {
            //Initial configuration
            TlfPosition      tlfTest = new TlfPosition(12);
            CfgEnlaceInterno link    = new CfgEnlaceInterno();

            link.Literal           = "BL";
            link.TipoEnlaceInterno = "DA";
            link.Prioridad         = 4;
            link.OrigenR2          = "218001";
            CfgRecursoEnlaceInterno rec = new CfgRecursoEnlaceInterno();

            rec.Prefijo       = 2;
            rec.NombreRecurso = "prubl";
            rec.Interface     = TipoInterface.TI_BL;
            link.ListaRecursos.Add(rec);

            tlfTest.Reset(link);

            //Give it an incomplete call, no callID
            tlfTest._SipCall = SipCallInfo.NewTlfCall(tlfTest.Channels, CORESIP_Priority.CORESIP_PR_NORMAL, null);
            SipRemote remote = new SipRemote(rec.NombreRecurso);

            tlfTest._SipCall.Update(-1, link.OrigenR2, rec.NombreRecurso, tlfTest.Channels[0], remote, tlfTest.Channels[0].ListLines[0]);
            Assert.IsNotNull(tlfTest._SipCall);

            //1.Cambio configuracion origen R2
            link                   = new CfgEnlaceInterno();
            link.Literal           = "BL";
            link.TipoEnlaceInterno = "DA";
            link.Prioridad         = 4;
            link.OrigenR2          = "218002"; // Cambio
            rec               = new CfgRecursoEnlaceInterno();
            rec.Prefijo       = 2;
            rec.NombreRecurso = "prubl";
            rec.Interface     = TipoInterface.TI_BL;
            link.ListaRecursos.Add(rec);
            tlfTest.Reset(link);
            //Se corta la llamada
            Assert.IsNull(tlfTest._SipCall);

            //Give it an incomplete call, no callID
            tlfTest._SipCall = SipCallInfo.NewTlfCall(tlfTest.Channels, CORESIP_Priority.CORESIP_PR_NORMAL, null);
            remote           = new SipRemote(rec.NombreRecurso);
            tlfTest._SipCall.Update(-1, link.OrigenR2, rec.NombreRecurso, tlfTest.Channels[0], remote, tlfTest.Channels[0].ListLines[0]);
            tlfTest.State = TlfState.Busy;

            //2.Cambio configuracion Prioridad, literal
            link                   = new CfgEnlaceInterno();
            link.Literal           = "BL_"; //Cambio
            link.TipoEnlaceInterno = "DA";
            link.Prioridad         = 3;     // Cambio
            link.OrigenR2          = "218002";
            rec               = new CfgRecursoEnlaceInterno();
            rec.Prefijo       = 2;
            rec.NombreRecurso = "prubl";
            rec.Interface     = TipoInterface.TI_BL;
            link.ListaRecursos.Add(rec);
            tlfTest.Reset(link);
            //Se corta la llamada porque no esta disponible la linea
            Assert.IsNull(tlfTest._SipCall);
            Assert.AreEqual(tlfTest.State, TlfState.Unavailable);

            //Give it an incomplete call, no channel
            tlfTest._SipCall = SipCallInfo.NewTlfCall(tlfTest.Channels, CORESIP_Priority.CORESIP_PR_NORMAL, null);
            remote           = new SipRemote(rec.NombreRecurso);
            tlfTest._SipCall.Update(-1, link.OrigenR2, rec.NombreRecurso, tlfTest.Channels[0], remote, tlfTest.Channels[0].ListLines[0]);
            tlfTest.State = TlfState.Busy;
            Assert.IsNotNull(tlfTest._SipCall);

            //3.Cambio configuracion prefijo recurso, nombre rec
            link                   = new CfgEnlaceInterno();
            link.Literal           = "BL_";
            link.TipoEnlaceInterno = "DA";
            link.Prioridad         = 3;
            link.OrigenR2          = "218002";
            rec               = new CfgRecursoEnlaceInterno();
            rec.Prefijo       = 0;         // Cambio
            rec.NombreRecurso = "S4_SCV2"; //Cambio
            rec.Interface     = TipoInterface.TI_Radio;
            link.ListaRecursos.Add(rec);
            tlfTest.Reset(link);
            //Se corta la llamada
            Assert.IsNull(tlfTest._SipCall);
        }