diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-06-03 22:05:16 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-06-03 22:05:16 +0000 |
commit | 0a568addd81eb9e0b3346b47ba749a14e6cdb742 (patch) | |
tree | 1128255ba26efd55114897a12cea38a75f674c31 /main | |
parent | ae5d47ddbdd14184563996190e84b68e54ddb3f4 (diff) |
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/trunk@120171 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r-- | main/asterisk.c | 15 | ||||
-rw-r--r-- | main/pbx.c | 4 |
2 files changed, 19 insertions, 0 deletions
diff --git a/main/asterisk.c b/main/asterisk.c index a5683c745..7d3079938 100644 --- a/main/asterisk.c +++ b/main/asterisk.c @@ -156,6 +156,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 */ @@ -2774,6 +2775,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); } diff --git a/main/pbx.c b/main/pbx.c index a18d29e9a..2b0ee7603 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -7856,6 +7856,10 @@ int pbx_builtin_setvar(struct ast_channel *chan, void *data) { char *name, *value, *mydata; + if (ast_compat_app_set) { + return pbx_builtin_setvar_multiple(chan, data); + } + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "Set requires one variable name/value pair.\n"); return 0; |