[svn-commits] pcadach: branch pcadach/chan_h323-live r40666 - /team/pcadach/chan_h323-live/...

svn-commits at lists.digium.com svn-commits at lists.digium.com
Sun Aug 20 11:53:08 MST 2006


Author: pcadach
Date: Sun Aug 20 13:53:07 2006
New Revision: 40666

URL: http://svn.digium.com/view/asterisk?rev=40666&view=rev
Log:
Handle configuration reloads more carefully

Modified:
    team/pcadach/chan_h323-live/channels/chan_h323.c

Modified: team/pcadach/chan_h323-live/channels/chan_h323.c
URL: http://svn.digium.com/view/asterisk/team/pcadach/chan_h323-live/channels/chan_h323.c?rev=40666&r1=40665&r2=40666&view=diff
==============================================================================
--- team/pcadach/chan_h323-live/channels/chan_h323.c (original)
+++ team/pcadach/chan_h323-live/channels/chan_h323.c Sun Aug 20 13:53:07 2006
@@ -1715,12 +1715,13 @@
 {
 	pthread_attr_t attr;
 	/* If we're supposed to be stopped -- stay stopped */
-	if (monitor_thread == AST_PTHREADT_STOP) {
-		return 0;
-	}
 	if (ast_mutex_lock(&monlock)) {
 		ast_log(LOG_WARNING, "Unable to lock monitor\n");
 		return -1;
+	}
+	if (monitor_thread == AST_PTHREADT_STOP) {
+		ast_mutex_unlock(&monlock);
+		return 0;
 	}
 	if (monitor_thread == pthread_self()) {
 		ast_mutex_unlock(&monlock);
@@ -2103,13 +2104,20 @@
 	if (!h323_end_point_exist()) {
 	       h323_end_point_create();        
 	}
-	h323debug = 0;
 	memset(&bindaddr, 0, sizeof(bindaddr));
 	memset(&global_options, 0, sizeof(global_options));
 	global_options.dtmfcodec = 101;
 	global_options.dtmfmode = H323_DTMF_RFC2833;
 	global_options.capability = GLOBAL_CAPABILITY;
 	global_options.bridge = 1;		/* Do native bridging by default */
+	strncpy(default_context, "default", sizeof(default_context) - 1);
+	h323_signalling_port = 1720;
+	gatekeeper_disable = 1;
+	gatekeeper_discover = 0;
+	usingGk = 0;
+	gkroute = 0;
+	userbyalias = 1;
+	tos = 0;
 
 	/* Copy the default jb config over global_jbconf */
 	memcpy(&global_jbconf, &default_jbconf, sizeof(struct ast_jb_conf));
@@ -2231,6 +2239,7 @@
 	ast_config_destroy(cfg);
 
 	/* Register our H.323 aliases if any*/
+	ast_mutex_lock(&aliasl.lock);
 	while (alias) {		
 		if (h323_set_alias(alias)) {
 			ast_log(LOG_ERROR, "Alias %s rejected by endpoint\n", alias->name);
@@ -2238,6 +2247,7 @@
 		}	
 		alias = alias->next;
 	}
+	ast_mutex_unlock(&aliasl.lock);
 
 	return 0;
 }
@@ -2322,7 +2332,6 @@
 	delete_aliases();
 	prune_peers();
 	reload_config();
-	restart_monitor();
 	return 0;
 }
 
@@ -2411,6 +2420,7 @@
 	ast_mutex_init(&userl.lock);
 	ast_mutex_init(&peerl.lock);
 	ast_mutex_init(&aliasl.lock);
+	h323debug = 0;
 	sched = sched_context_create();
 	if (!sched) {
 		ast_log(LOG_WARNING, "Unable to create schedule context\n");



More information about the svn-commits mailing list