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 /res | |
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 'res')
-rw-r--r-- | res/res_agi.c | 18 |
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; |