FSClient.Broker.init_freeswitch C# (CSharp) Method

init_freeswitch() private method

private init_freeswitch ( ) : void
return void
		private void init_freeswitch() {
			try {//it would be better if this was in the init function but it seems some dll load errors won't be caught if it is.
#if ! NO_FS
				fs_core_init();
#else
				fs_inited = false;
#endif
				if (FreeswitchLoaded != null)
					FreeswitchLoaded(this, null);
				fully_loaded = true;
				Debug.WriteLine("Startup time: " + (DateTime.Now - start_time).TotalSeconds);
			}
			catch (Exception e) {
				while (e.InnerException != null)
					e = e.InnerException;
				MessageBox.Show("Unable to properly init freeswitch core due to:\n" + e.Message + "\n" + e.StackTrace, "Error Starting Freeswitch Core", MessageBoxButton.OK, MessageBoxImage.Error);
				fs_inited = false;
				Environment.Exit(-1);

			}
#if ! NO_FS
			DelayedFunction.DelayedCall("SofiaProfileCheck", sofia.sofia_profile_check, 100);

			//Lets try to reload devices after FSClient has spun up just to make sure everything is inited.
			DelayedFunction.DelayedCall("ReloadAudioDevices", quiet_reload_audio_devices, 2000);
			DelayedFunction.DelayedCall("ReloadAudioDevices2", quiet_reload_audio_devices, 5000);
			DelayedFunction.DelayedCall("ReloadAudioDevices3", quiet_reload_audio_devices, 20000);
#endif
		}