Exemple #1
0
        private void LoadConfiguration()
        {
            var errors = SipServerConfigurationSection.LoadSection();

            if (errors.Count > 0)
            {
                // log errors!

                try
                {
                    var name    = SipServerConfigurationSection.GetSection().FilePath;
                    var oldName = name + ".old";
                    File.Delete(oldName);
                    File.Move(name, oldName);
                    File.Delete(name);

                    var errors2 = SipServerConfigurationSection.LoadSection();
                    if (errors2.Count > 0)
                    {
                        throw errors2[0];
                    }
                }
                catch (Exception ex)
                {
                    throw new InvalidProgramException(@"Can not restore .config file", ex);
                }
            }
        }
Exemple #2
0
        private void ConfigurationMonitor_Changed(object sender, EventArgs e)
        {
            var errors = SipServerConfigurationSection.LoadSection();

            if (errors.Count > 0)
            {
                // log errors!
            }
            else
            {
                var configuration = SipServerConfigurationSection.GetSection();

                Tracer.Configure(configuration.TracingPath, configuration.IsTracingEnabled);

                wcfService.AdministratorPassword = configuration.AdministratorPassword;
                restapi.AdministratorPassword    = configuration.AdministratorPassword;

                if (adUsers != null)
                {
                    adUsers.Group = configuration.ActiveDirectoryGroup;
                }

                authorization.IsEnabled = configuration.IsAuthorizationEnabled;

                trunkManager.Clear();
                Initializer.ConfigureVoipProviders(trunkManager, configuration);

                Initializer.ConfigureMras(mras, configuration);

                httpServer.WwwPath = configuration.WwwPath;

                transportLayer.ChangeSettings(configuration.WebSocketResponseFrame);

                proxyServerTU.IsOfficeSIPFiletransferEnabled = configuration.IsOfficeSIPFiletransferEnabled;
            }
        }