aboutsummaryrefslogtreecommitdiffstats
path: root/pbx
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-06-03 02:27:08 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-06-03 02:27:08 +0000
commit61e53e40334989017613a7bb938152fd2ecc43f6 (patch)
treebf153fdf6af058c3d8a1a22ae2beaf8a6b5dfb2c /pbx
parent787c08a3fc686be8c47f4dda38e234ff1fdfb3ca (diff)
allow global variables to be reset on reload (defaults to off) (bug #4385)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5825 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx')
-rwxr-xr-xpbx/pbx_config.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/pbx/pbx_config.c b/pbx/pbx_config.c
index 8aa523c5a..4b53dfa39 100755
--- a/pbx/pbx_config.c
+++ b/pbx/pbx_config.c
@@ -44,6 +44,7 @@ static char *registrar = "pbx_config";
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 context_remove_ignorepat_help[] =
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 @@ static int pbx_load_module(void)
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 load_module(void)
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;
}