aboutsummaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-01-04 18:19:00 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-01-04 18:19:00 +0000
commit978e41649ceea8ba4b9b46edbf78b7ca3a5d25d5 (patch)
tree72b4fa39a0864319c25f146e154e34f5dd24a092 /res
parent71cbaa42d6b05ccef032b2d3db96eaaa37d5cafa (diff)
Add a flag to disable the Background behavior, for AGI users.
This is in a section of code that relates to two other issues, namely issue #14011 and issue #14940), one of which was the behavior of Background when called with a context argument that matched the current context. This fix broke FreePBX, however, in a post-Dial situation. Needless to say, this is an extremely difficult collision of several different issues. While the use of an exception flag is ugly, fixing all of the issues linked is rather difficult (although if someone would like to propose a better solution, we're happy to entertain that suggestion). (closes issue #16434) Reported by: rickead2000 Patches: 20091217__issue16434.diff.txt uploaded by tilghman (license 14) 20091222__issue16434__1.6.1.diff.txt uploaded by tilghman (license 14) Tested by: rickead2000 git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@237405 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r--res/res_agi.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/res/res_agi.c b/res/res_agi.c
index f0da5e2fc..000575762 100644
--- a/res/res_agi.c
+++ b/res/res_agi.c
@@ -1125,7 +1125,7 @@ static int handle_hangup(struct ast_channel *chan, AGI *agi, int argc, char **ar
static int handle_exec(struct ast_channel *chan, AGI *agi, int argc, char **argv)
{
- int res;
+ int res, workaround;
struct ast_app *app;
if (argc < 2)
@@ -1140,7 +1140,13 @@ static int handle_exec(struct ast_channel *chan, AGI *agi, int argc, char **argv
if(!strcasecmp(argv[1], PARK_APP_NAME)) {
ast_masq_park_call(chan, NULL, 0, NULL);
}
+ if (!(workaround = ast_test_flag(chan, AST_FLAG_DISABLE_WORKAROUNDS))) {
+ ast_set_flag(chan, AST_FLAG_DISABLE_WORKAROUNDS);
+ }
res = pbx_exec(chan, app, argc == 2 ? "" : argv[2]);
+ if (!workaround) {
+ ast_clear_flag(chan, AST_FLAG_DISABLE_WORKAROUNDS);
+ }
} else {
ast_log(LOG_WARNING, "Could not find application (%s)\n", argv[1]);
res = -2;