Allow globals in extensions.conf to reference previous variables

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1255 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Spencer
2003-08-03 18:33:50 +00:00
parent 1d0858f08e
commit e707a89e63
2 changed files with 28 additions and 23 deletions

View File

@@ -1538,6 +1538,7 @@ static int pbx_load_module(void)
char *cxt, *ext, *pri, *appl, *data, *tc, *cidmatch;
struct ast_context *con;
char *start, *end;
char realvalue[256] = "";
cfg = ast_load(config);
if (cfg) {
@@ -1548,7 +1549,8 @@ static int pbx_load_module(void)
"writeprotect"));
v = ast_variable_browse(cfg, "globals");
while(v) {
pbx_builtin_setvar_helper(NULL, v->name, v->value);
pbx_substitute_variables_helper(NULL, v->value, realvalue, sizeof(realvalue) - 1);
pbx_builtin_setvar_helper(NULL, v->name, realvalue);
v = v->next;
}
cxt = ast_category_browse(cfg, NULL);