コード例 #1
0
        ///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);
        }
コード例 #2
0
        ///Tests para probar cuando se corta la llamada y pasa la tecla a reposo
        ///por una sectorización con cambios.
        ///La llamada no tiene canal
        public void ChangeConfig1()
        {
            //Initial configuration
            TlfPosition      tlfTest = new TlfPosition(12);
            CfgEnlaceInterno link    = new CfgEnlaceInterno();

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

            rec.Prefijo       = 2;
            rec.NombreRecurso = "S1";
            rec.Interface     = TipoInterface.TI_Radio;
            link.ListaRecursos.Add(rec);

            tlfTest.Reset(link);

            //Give it an incomplete call, , no channel
            tlfTest._SipCall = SipCallInfo.NewTlfCall(tlfTest.Channels, CORESIP_Priority.CORESIP_PR_NORMAL, null);
            Assert.IsNotNull(tlfTest._SipCall);

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

            //Give it an incomplete call, no channel
            tlfTest._SipCall = SipCallInfo.NewTlfCall(tlfTest.Channels, CORESIP_Priority.CORESIP_PR_NORMAL, null);
            Assert.IsNotNull(tlfTest._SipCall);

            //2.Cambio configuracion Prioridad, literal
            link                   = new CfgEnlaceInterno();
            link.Literal           = "S1_"; //Cambio
            link.TipoEnlaceInterno = "DA";
            link.Prioridad         = 4;     // Cambio
            link.OrigenR2          = "218002";
            rec               = new CfgRecursoEnlaceInterno();
            rec.Prefijo       = 2;
            rec.NombreRecurso = "S1";
            rec.Interface     = TipoInterface.TI_Radio;
            link.ListaRecursos.Add(rec);
            tlfTest.Reset(link);
            //No se corta la llamada
            Assert.IsNotNull(tlfTest._SipCall);

            //Give it an incomplete call, no channel
            tlfTest._SipCall = SipCallInfo.NewTlfCall(tlfTest.Channels, CORESIP_Priority.CORESIP_PR_NORMAL, null);
            Assert.IsNotNull(tlfTest._SipCall);

            //3.Cambio configuracion prefijo recurso, nombre rec
            link                   = new CfgEnlaceInterno();
            link.Literal           = "S1_";
            link.TipoEnlaceInterno = "DA";
            link.Prioridad         = 4;
            link.OrigenR2          = "218002";
            rec               = new CfgRecursoEnlaceInterno();
            rec.Prefijo       = 3;     // Cambio
            rec.NombreRecurso = "S1_"; //Cambio
            rec.Interface     = TipoInterface.TI_Radio;
            link.ListaRecursos.Add(rec);
            tlfTest.Reset(link);
            //No Se corta la llamada
            Assert.IsNotNull(tlfTest._SipCall);
        }
コード例 #3
0
        ///Tests para probar que no se corta la llamada ni cambia de estado
        ///por una sectorización sin cambios
        public void ChangeConfig2()
        {
            //Initial configuration
            TlfPosition      tlfTest = new TlfPosition(12);
            CfgEnlaceInterno link    = new CfgEnlaceInterno();

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

            rec.Prefijo       = 2;
            rec.NombreRecurso = "S1";
            rec.Interface     = TipoInterface.TI_Radio;
            link.ListaRecursos.Add(rec);

            tlfTest.Reset(link);
            //Give it an incomplete call, estado unavailable
            tlfTest._SipCall = SipCallInfo.NewTlfCall(tlfTest.Channels, CORESIP_Priority.CORESIP_PR_NORMAL, null);
            Assert.IsNotNull(tlfTest._SipCall);
            Assert.AreEqual(tlfTest.State, TlfState.Unavailable);

            //1.sin cambios, en estado unavailable
            link                   = new CfgEnlaceInterno();
            link.Literal           = "S1";
            link.TipoEnlaceInterno = "DA";
            link.Prioridad         = 4;
            link.OrigenR2          = "218001";
            rec               = new CfgRecursoEnlaceInterno();
            rec.Prefijo       = 2;
            rec.NombreRecurso = "S1";
            rec.Interface     = TipoInterface.TI_Radio;
            link.ListaRecursos.Add(rec);
            tlfTest.Reset(link);
            //No se corta la llamada
            Assert.IsNotNull(tlfTest._SipCall);
            Assert.AreEqual(tlfTest.State, TlfState.Unavailable);

            //2. Tecla en congestion, no cambia
            tlfTest.State          = TlfState.Congestion;
            link                   = new CfgEnlaceInterno();
            link.Literal           = "S1";
            link.TipoEnlaceInterno = "DA";
            link.Prioridad         = 4;
            link.OrigenR2          = "218001";
            rec               = new CfgRecursoEnlaceInterno();
            rec.Prefijo       = 2;
            rec.NombreRecurso = "S1";
            rec.Interface     = TipoInterface.TI_Radio;
            link.ListaRecursos.Add(rec);
            tlfTest.Reset(link);
            //No se corta la llamada
            Assert.IsNotNull(tlfTest._SipCall);
            Assert.AreEqual(tlfTest.State, TlfState.Congestion);

            //3. Tecla en busy, no cambia
            tlfTest.State          = TlfState.Busy;
            link                   = new CfgEnlaceInterno();
            link.Literal           = "S1";
            link.TipoEnlaceInterno = "DA";
            link.Prioridad         = 4;
            link.OrigenR2          = "218001";
            rec               = new CfgRecursoEnlaceInterno();
            rec.Prefijo       = 2;
            rec.NombreRecurso = "S1";
            rec.Interface     = TipoInterface.TI_Radio;
            link.ListaRecursos.Add(rec);
            tlfTest.Reset(link);
            //No se corta la llamada
            Assert.IsNotNull(tlfTest._SipCall);
            Assert.AreEqual(tlfTest.State, TlfState.Busy);

            //3. Tecla en InProcess, no cambia
            tlfTest.State          = TlfState.InProcess;
            link                   = new CfgEnlaceInterno();
            link.Literal           = "S1";
            link.TipoEnlaceInterno = "DA";
            link.Prioridad         = 4;
            link.OrigenR2          = "218001";
            rec               = new CfgRecursoEnlaceInterno();
            rec.Prefijo       = 2;
            rec.NombreRecurso = "S1";
            rec.Interface     = TipoInterface.TI_Radio;
            link.ListaRecursos.Add(rec);
            tlfTest.Reset(link);
            //No se corta la llamada
            Assert.IsNotNull(tlfTest._SipCall);
            Assert.AreEqual(tlfTest.State, TlfState.InProcess);
        }