public static IList <Exception> LoadSection()
        {
            var newSection = new SipServerConfigurationSection();

            newSection.Load();

            var errors = newSection.ListErrors();

            if (errors.Count == 0)
            {
                System.Threading.Interlocked.Exchange <SipServerConfigurationSection>(ref section, newSection);
            }

            return(errors);
        }
예제 #2
0
        public WCFService(SipServerConfigurationSection configuration, EnhancedPresence1 enhancedPresence, TrunkManager trunkManager, Accountx accounts, IUserz userz)
        {
            this.accounts = accounts;

            this.userz = userz;
            this.userz.Reset += IUsers_Reloaded;
            this.userz.Added += IUsers_Added;
            this.userz.Updated += IUsers_Updated;
            this.userz.Removed += IUsers_Removed;

            this.enhancedPresence = enhancedPresence;
            this.enhancedPresence.AvailabilityChanged += AvailabilityChanged;

            this.trunkManager = trunkManager;
            this.trunkManager.TrunkUpdated += TrunkUpdated;

            this.serviceAddress = configuration.WcfServiceAddress;
            //this.domainName = configuration.DomainName;
            this.validator = new CustomUserNamePasswordValidator(@"administrator", configuration.AdministratorPassword);
        }
예제 #3
0
		public static void ConfigureVoipProviders(TrunkManager trunkManager, SipServerConfigurationSection configuration)
		{
			foreach (var provider in configuration.VoipProviders)
			{
				trunkManager.Clear();

				trunkManager.Add(
					new Trunk(
						provider.DisplayName,
						provider.ServerHostname,
						provider.Username,
						provider.Protocol.ToTransport(),
						provider.LocalEndpoint,
						provider.OutboundProxyHostname,
						provider.AuthenticationId,
						provider.Password,
						provider.ForwardIncomingCallTo,
						provider.RestoreAfterErrorTimeout));

				break; // one voip provider only!
			}
		}
예제 #4
0
		public static void ConfigureMras(Mras.Mras1 mras, SipServerConfigurationSection configuration)
		{
			mras.SetKeys(configuration.TurnServers.Key1, configuration.TurnServers.Key2);
			mras.ClearServers();
			foreach (TurnServerConfigurationElement server in configuration.TurnServers)
			{
				if (string.Compare(server.Location, "internet", true) == 0)
					mras.AddInternetServer(server.Fqdn, server.TcpPort, server.UdpPort);
				else
					mras.AddIntranetServer(server.Fqdn, server.TcpPort, server.UdpPort);
			}
		}
        public static IList<Exception> LoadSection()
        {
            var newSection = new SipServerConfigurationSection();
            newSection.Load();

            var errors = newSection.ListErrors();

            if (errors.Count == 0)
                System.Threading.Interlocked.Exchange<SipServerConfigurationSection>(ref section, newSection);

            return errors;
        }