Exemplo n.º 1
0
        private static TlfNet CreateIpNet(string number, Scv scv)
        {
            TlfNet net = new TlfNet();

            net.Id = "Net_ATS_IP_" + scv.Id;

            Rs <GwTlfRs> rs = Top.Registry.GetRs <GwTlfRs>(number);
            string       ScvIp;

            if (rs.Content == null)
            {
                //Si el recurso no tiene contenido actualizado, la IP es de los datos de configuración (principal)
                string id;
                ScvIp = scv.GetProxyIp(out id);
                if (rs.IsUnreferenced)
                {
                    //Para que recién creado por defecto aparezca sin aspa, le añado un recurso
                    GwTlfRs proxyRs = new GwTlfRs();
                    proxyRs.GwIp = ScvIp;
                    rs.Reset(null, proxyRs);
                }
            }
            else
            {
                //Utilizo los datos del recurso (actualizado con el activo)
                ScvIp = ((GwTlfRs)rs.Content).GwIp;
            }
            SipLine line = new SipLine(rs, ScvIp, true);

            net.Lines.Add(line);
            net.RsTypes.Add(new RsIdxType(net.Lines.Count - 1, 0, TipoInterface.TI_IP_PROXY));
            net.Routes.Add(0);
            return(net);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Crea los objetos SCV en base a los nuevos datos de configuración recibidos
        /// </summary>
        private void CreateChildrenObjects()
        {
            //delete old SCVs
            _MiScv = null;
            _OtrosScv.Clear();

            //create SCVs
            CreateScvs();
        }
Exemplo n.º 3
0
        private void CreateScvs()
        {
            //delete old SCVs
            _MiScv = null;
            _OtrosScv.Clear();
            foreach (NumeracionATS scvAts in _SystemCfg.PlanNumeracionATS)
            {
                if (scvAts.CentralPropia)
                {
                    _MiScv = new Scv(scvAts);
                    _MiScv.ProxyStateChange += OnProxyStateChangeCfg;
                }
                //Esta protección es porque pueden llegar de configuración SCV sin rango y sin nombre
                else if (scvAts.Central.Length > 0)
                {
                    _OtrosScv.Add(scvAts.Central, new Scv(scvAts));
                }
            }

            foreach (DireccionamientoIP obj in _SystemCfg.PlanDireccionamientoIP)
            {
                if ((obj.TipoHost == Tipo_Elemento_HW.TEH_EXTERNO_TELEFONIA) && obj.EsCentralIP)
                {
                    if (obj.Interno)
                    {
                        if (_MiScv == null)
                        {
                            _MiScv = new Scv(obj);  // No debería entrar aquí
                        }
                        else
                        {
                            _MiScv.SetIpData(obj);
                        }
                    }
                    else
                    {
                        Scv outScv;
                        if (!_OtrosScv.TryGetValue(obj.IdHost, out outScv))
                        {
                            _OtrosScv.Add(obj.IdHost, new Scv(obj)); // No debería entrar aquí
                        }
                        else
                        {
                            outScv.SetIpData(obj);
                        }
                    }
                }
            }
        }
Exemplo n.º 4
0
 private void ClearChildrenObjects()
 {
     _MiScv = null;
     _OtrosScv.Clear();
 }