[asterisk-commits] oej: branch oej/earl-grey-sip2cause-configurable-1.8 r377207 - in /team/oej/e...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Dec 4 09:38:29 CST 2012


Author: oej
Date: Tue Dec  4 09:38:25 2012
New Revision: 377207

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=377207
Log:
Handle SIP reload too. Seems to be a Good Thing (TM)


Modified:
    team/oej/earl-grey-sip2cause-configurable-1.8/channels/chan_sip.c
    team/oej/earl-grey-sip2cause-configurable-1.8/channels/sip/sip2cause.c

Modified: team/oej/earl-grey-sip2cause-configurable-1.8/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/earl-grey-sip2cause-configurable-1.8/channels/chan_sip.c?view=diff&rev=377207&r1=377206&r2=377207
==============================================================================
--- team/oej/earl-grey-sip2cause-configurable-1.8/channels/chan_sip.c (original)
+++ team/oej/earl-grey-sip2cause-configurable-1.8/channels/chan_sip.c Tue Dec  4 09:38:25 2012
@@ -29399,10 +29399,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);
 	}
@@ -31327,7 +31328,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-1.8/channels/sip/sip2cause.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/earl-grey-sip2cause-configurable-1.8/channels/sip/sip2cause.c?view=diff&rev=377207&r1=377206&r2=377207
==============================================================================
--- team/oej/earl-grey-sip2cause-configurable-1.8/channels/sip/sip2cause.c (original)
+++ team/oej/earl-grey-sip2cause-configurable-1.8/channels/sip/sip2cause.c Tue Dec  4 09:38:25 2012
@@ -247,6 +247,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 asterisk-commits mailing list