aboutsummaryrefslogtreecommitdiffstats
path: root/pbx
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2005-12-04 20:40:46 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2005-12-04 20:40:46 +0000
commitcfb1ef47122283b97ab2e05437c47b6e60f7c54f (patch)
tree6f52bce69ee88362d0b801e94372ecc39c5091d2 /pbx
parentdc76ba74df2442efe2e986ee50e13247a263ed81 (diff)
convert most of the option_*'s to a single ast_flags structure. Also, fix some
formatting, remove some unnecessary casts, and other little code cleanups. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@7331 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx')
-rw-r--r--pbx/pbx_config.c22
-rw-r--r--pbx/pbx_dundi.c2
2 files changed, 9 insertions, 15 deletions
diff --git a/pbx/pbx_config.c b/pbx/pbx_config.c
index 1bcb2f515..f9267737a 100644
--- a/pbx/pbx_config.c
+++ b/pbx/pbx_config.c
@@ -1618,23 +1618,17 @@ static int pbx_load_module(void)
cfg = ast_config_load(config);
if (cfg) {
/* Use existing config to populate the PBX table */
- static_config = ast_true(ast_variable_retrieve(cfg, "general",
- "static"));
- write_protect_config = ast_true(ast_variable_retrieve(cfg, "general",
- "writeprotect"));
- autofallthrough_config = ast_true(ast_variable_retrieve(cfg, "general",
- "autofallthrough"));
- clearglobalvars_config = ast_true(ast_variable_retrieve(cfg, "general",
- "clearglobalvars"));
- option_priority_jumping = !ast_false(ast_variable_retrieve(cfg, "general",
- "priorityjumping"));
-
+ static_config = ast_true(ast_variable_retrieve(cfg, "general", "static"));
+ write_protect_config = ast_true(ast_variable_retrieve(cfg, "general", "writeprotect"));
+ autofallthrough_config = ast_true(ast_variable_retrieve(cfg, "general", "autofallthrough"));
+ clearglobalvars_config = ast_true(ast_variable_retrieve(cfg, "general", "clearglobalvars"));
+ ast_set2_flag(&ast_options, !ast_false(ast_variable_retrieve(cfg, "general", "priorityjumping")), AST_OPT_FLAG_PRIORITY_JUMPING);
+
v = ast_variable_browse(cfg, "globals");
- while(v) {
+ for (; v; v = v->next) {
memset(realvalue, 0, sizeof(realvalue));
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);
while(cxt) {
@@ -1736,7 +1730,7 @@ static int pbx_load_module(void)
if (plus)
ipri += atoi(plus);
lastpri = ipri;
- if(!option_dontwarn) {
+ if (!ast_opt_dont_warn) {
if (!strcmp(realext, "_."))
ast_log(LOG_WARNING, "The use of '_.' for an extension is strongly discouraged and can have unexpected behavior. Please use '_X.' instead at line %d\n", v->lineno);
}
diff --git a/pbx/pbx_dundi.c b/pbx/pbx_dundi.c
index 15b15845b..1e5f7446f 100644
--- a/pbx/pbx_dundi.c
+++ b/pbx/pbx_dundi.c
@@ -3912,7 +3912,7 @@ static int dundi_lookup_exec(struct ast_channel *chan, void *data)
break;
}
}
- } else if (option_priority_jumping)
+ } else if (ast_opt_priority_jumping)
ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
LOCAL_USER_REMOVE(u);