/// <summary> /// Handler to receive new configuration /// Avoid to re-create account if its data haven't changed /// </summary> /// <param name="sender"></param> private void OnConfigChanged(object sender) { string idEquipo; string newProxy = Top.Cfg.GetProxyIp(out idEquipo); List <AccountDataSip> NewAccDataList = new List <AccountDataSip>(); foreach (StrNumeroAbonado num in Top.Cfg.HostAddresses) { if (num.Prefijo == Cd40Cfg.ATS_DST) { NewAccDataList.Add(new AccountDataSip(num)); } } if (_ProxyIP != newProxy) { // If proxy has changed all accounts are created again SipAgent.DestroyAccounts(); AccDataList = new List <AccountDataSip>(NewAccDataList); _ProxyIP = newProxy; foreach (AccountDataSip data in AccDataList) { if ((_ProxyIP == null) || (_ProxyIP.Length == 0)) { SipAgent.CreateAccount(data.NumeroAbonado); } else { SipAgent.CreateAccountAndRegisterInProxy(data.NumeroAbonado, _ProxyIP, Settings.Default.ExpireInProxy, data.NumeroAbonado, data.NumeroAbonado, data.IdAgrupacion); } } } else { SynchronizeAccountsList(NewAccDataList); } // JCAM. 20170324 // Incorporar las direcciones de los grabadores en la configuración // y hacer que el módulo de grabación se entere del cambio de configuración AsignacionUsuariosTV tv = Top.Cfg.GetUserTv(Top.Cfg.MainId); if (tv != null) { SipAgent.PictRecordingCfg(tv.IpGrabador1, tv.IpGrabador2, tv.RtspPort); } }