summaryrefslogtreecommitdiff
path: root/res
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 /res
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 'res')
-rw-r--r--res/res_agi.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/res/res_agi.c b/res/res_agi.c
index 57cf128da..952c28c27 100644
--- a/res/res_agi.c
+++ b/res/res_agi.c
@@ -1456,7 +1456,23 @@ static int handle_exec(struct ast_channel *chan, AGI *agi, int argc, char **argv
ast_verb(3, "AGI Script Executing Application: (%s) Options: (%s)\n", argv[1], argv[2]);
if ((app = pbx_findapp(argv[1]))) {
- res = pbx_exec(chan, app, argv[2]);
+ if (ast_compat_res_agi && !ast_strlen_zero(argv[2])) {
+ char *compat = alloca(strlen(argv[2]) * 2 + 1), *cptr, *vptr;
+ for (cptr = compat, vptr = argv[2]; *vptr; vptr++) {
+ if (*vptr == ',') {
+ *cptr++ = '\\';
+ *cptr++ = ',';
+ } else if (*vptr == '|') {
+ *cptr++ = ',';
+ } else {
+ *cptr++ = *vptr;
+ }
+ }
+ *cptr = '\0';
+ res = pbx_exec(chan, app, compat);
+ } else {
+ res = pbx_exec(chan, app, argv[2]);
+ }
} else {
ast_log(LOG_WARNING, "Could not find application (%s)\n", argv[1]);
res = -2;