diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-06-03 22:08:56 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-06-03 22:08:56 +0000 |
commit | 3fcad05e85659cafbf71fb4f6a7d77f130225d3a (patch) | |
tree | 679d8f3f86c6689b49e99412548fdf48f27c0f72 /res/res_agi.c | |
parent | 4b7d389118a8405481c29a8ad70ae3ab82aff08f (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 'res/res_agi.c')
-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 ffc82cea8..e3841aa42 100644 --- a/res/res_agi.c +++ b/res/res_agi.c @@ -1474,7 +1474,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; |