aboutsummaryrefslogtreecommitdiffstats
path: root/main/asterisk.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-06-03 22:08:56 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-06-03 22:08:56 +0000
commit3fcad05e85659cafbf71fb4f6a7d77f130225d3a (patch)
tree679d8f3f86c6689b49e99412548fdf48f27c0f72 /main/asterisk.c
parent4b7d389118a8405481c29a8ad70ae3ab82aff08f (diff)
Merged revisions 120171 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r120171 | tilghman | 2008-06-03 17:05:16 -0500 (Tue, 03 Jun 2008) | 5 lines Move compatibility options into asterisk.conf, default them to on for upgrades, and off for new installations. This includes the translation from pipes to commas for pbx_realtime and the EXEC command for AGI, as well as the change to the Set application not to support multiple variables at once. ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@120172 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/asterisk.c')
-rw-r--r--main/asterisk.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/main/asterisk.c b/main/asterisk.c
index 1c76558f5..d67d7f0da 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -155,6 +155,7 @@ int daemon(int, int); /* defined in libresolv of all places */
/*! @{ */
struct ast_flags ast_options = { AST_DEFAULT_OPTIONS };
+struct ast_flags ast_compat = { 7 };
int option_verbose; /*!< Verbosity level */
int option_debug; /*!< Debug level */
@@ -2760,6 +2761,20 @@ static void ast_readconfig(void)
#endif
}
}
+ for (v = ast_variable_browse(cfg, "compat"); v; v = v->next) {
+ float version;
+ if (sscanf(v->value, "%f", &version) != 1) {
+ ast_log(LOG_WARNING, "Compatibility version for option '%s' is not a number: '%s'\n", v->name, v->value);
+ continue;
+ }
+ if (!strcasecmp(v->name, "app_set")) {
+ ast_set2_flag(&ast_compat, version < 1.5 ? 1 : 0, AST_COMPAT_APP_SET);
+ } else if (!strcasecmp(v->name, "res_agi")) {
+ ast_set2_flag(&ast_compat, version < 1.5 ? 1 : 0, AST_COMPAT_DELIM_RES_AGI);
+ } else if (!strcasecmp(v->name, "pbx_realtime")) {
+ ast_set2_flag(&ast_compat, version < 1.5 ? 1 : 0, AST_COMPAT_DELIM_PBX_REALTIME);
+ }
+ }
ast_config_destroy(cfg);
}