[Asterisk-cvs] asterisk/pbx pbx_config.c,1.63,1.64

kpfleming at lists.digium.com kpfleming at lists.digium.com
Thu Jun 2 22:24:06 CDT 2005


Update of /usr/cvsroot/asterisk/pbx
In directory mongoose.digium.com:/tmp/cvs-serv4866/pbx

Modified Files:
	pbx_config.c 
Log Message:
allow global variables to be reset on reload (defaults to off) (bug #4385)


Index: pbx_config.c
===================================================================
RCS file: /usr/cvsroot/asterisk/pbx/pbx_config.c,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -d -r1.63 -r1.64
--- pbx_config.c	19 May 2005 01:57:19 -0000	1.63
+++ pbx_config.c	3 Jun 2005 02:27:08 -0000	1.64
@@ -44,6 +44,7 @@
 static int static_config = 0;
 static int write_protect_config = 1;
 static int autofallthrough_config = 0;
+static int clearglobalvars_config = 0;
 
 AST_MUTEX_DEFINE_STATIC(save_dialplan_lock);
 
@@ -97,7 +98,8 @@
 
 static char reload_extensions_help[] =
 "Usage: reload extensions.conf without reloading any other modules\n"
-"       This command does not delete global variables\n"
+"       This command does not delete global variables unless\n"
+"       clearglobalvars is set to yes in extensions.conf\n"
 "\n"
 "Example: extensions reload\n";
 
@@ -1636,6 +1638,9 @@
 		autofallthrough_config = ast_true(ast_variable_retrieve(cfg, "general",
 			"autofallthrough"));
 
+		clearglobalvars_config = ast_true(ast_variable_retrieve(cfg, "general", 
+			"clearglobalvars"));
+
 		v = ast_variable_browse(cfg, "globals");
 		while(v) {
 			memset(realvalue, 0, sizeof(realvalue));
@@ -1816,10 +1821,8 @@
 int reload(void)
 {
 	ast_context_destroy(NULL, registrar);
-	/* For martin's global variables, don't clear them on reload */
-#if 0
-	pbx_builtin_clear_globals();
-#endif	
+	if (clearglobalvars_config)
+		pbx_builtin_clear_globals();
 	pbx_load_module();
 	return 0;
 }




More information about the svn-commits mailing list