[svn-commits] oej: branch oej/earl-grey-sip2cause-configurable-trunk r377208 - in /team/oej...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Dec 4 09:41:44 CST 2012


Author: oej
Date: Tue Dec  4 09:41:39 2012
New Revision: 377208

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=377208
Log:
Supporting reloads properly seems like a Good Idea (TM)(R)(C)

Even though not doing it may be a bit more fun. But who wanna have fun?

Modified:
    team/oej/earl-grey-sip2cause-configurable-trunk/   (props changed)
    team/oej/earl-grey-sip2cause-configurable-trunk/channels/chan_sip.c
    team/oej/earl-grey-sip2cause-configurable-trunk/channels/sip/sip2cause.c

Propchange: team/oej/earl-grey-sip2cause-configurable-trunk/
------------------------------------------------------------------------------
--- automerge (original)
+++ automerge Tue Dec  4 09:41:39 2012
@@ -1,1 +1,1 @@
-*
+REALLY dangerous stuff.

Modified: team/oej/earl-grey-sip2cause-configurable-trunk/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/earl-grey-sip2cause-configurable-trunk/channels/chan_sip.c?view=diff&rev=377208&r1=377207&r2=377208
==============================================================================
--- team/oej/earl-grey-sip2cause-configurable-trunk/channels/chan_sip.c (original)
+++ team/oej/earl-grey-sip2cause-configurable-trunk/channels/chan_sip.c Tue Dec  4 09:41:39 2012
@@ -32056,10 +32056,11 @@
 	if ((sip2cause = ast_config_load(sip2cause_config, config_flags)) == CONFIG_STATUS_FILEINVALID) {
 		ast_log(LOG_ERROR, "Contents of %s are invalid and cannot be parsed.\n", sip2cause_config);
 		sip2cause = NULL;
+		sip2cause_init();	/* Initialize standard settings */
 	} else {
-		if(sip2cause != NULL) {
-			private_sip2cause = sip2cause_load(sip2cause);
-		}
+		sip2cause_free();	/* If it's a reload, free existing settings */
+		sip2cause_init();	/* Initialize standard settings */
+		private_sip2cause = sip2cause_load(sip2cause);
 		/* Now clean up */
 		ast_config_destroy(sip2cause);
 	}
@@ -34036,7 +34037,6 @@
 	sip_reloadreason = CHANNEL_MODULE_LOAD;
 
 	can_parse_xml = sip_is_xml_parsable();
-	sip2cause_init();
 	if (reload_config(sip_reloadreason)) {	/* Load the configuration from sip.conf */
 		return AST_MODULE_LOAD_DECLINE;
 	}

Modified: team/oej/earl-grey-sip2cause-configurable-trunk/channels/sip/sip2cause.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/earl-grey-sip2cause-configurable-trunk/channels/sip/sip2cause.c?view=diff&rev=377208&r1=377207&r2=377208
==============================================================================
--- team/oej/earl-grey-sip2cause-configurable-trunk/channels/sip/sip2cause.c (original)
+++ team/oej/earl-grey-sip2cause-configurable-trunk/channels/sip/sip2cause.c Tue Dec  4 09:41:39 2012
@@ -242,6 +242,9 @@
 	int number=0;
 
 	ast_debug(2, "AST sip2cause configuration parser");
+	if (!s2c_config) {
+		return 0;
+	}
 	for (v = ast_variable_browse(s2c_config, "sip2cause"); v; v = v->next) {
 		ast_debug(1, "====> SIP2cause ::: Name %s Value %s \n", v->name, v->value);
 		respcode = 42;




More information about the svn-commits mailing list