summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2008-06-03 22:05:16 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2008-06-03 22:05:16 +0000
commit76506b7baa23b192b35313b41d00fd153567369e (patch)
tree1128255ba26efd55114897a12cea38a75f674c31 /main
parent5866b0dfe81e8aec98bf7691cfe7001cd0b54bc2 (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: https://origsvn.digium.com/svn/asterisk/trunk@120171 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main')
-rw-r--r--main/asterisk.c15
-rw-r--r--main/pbx.c4
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;