aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorrmudgett <rmudgett@f38db490-d61c-443f-a65b-d21fe96a405b>2010-11-22 18:46:26 +0000
committerrmudgett <rmudgett@f38db490-d61c-443f-a65b-d21fe96a405b>2010-11-22 18:46:26 +0000
commit32709b9aed7f32780208227d2947f132f9774daf (patch)
tree493ca6dc24159c6f8d1b6651cbba0e999bb09b3e /apps
parent48b428d5f8b1f11810ff9ef10dfabb5a07a9f927 (diff)
The channel redirect function (CLI or AMI) hangs up the call instead of redirecting the call.
To recreate the problem: 1) Party A calls Party B 2) Invoke CLI "channel redirect" command to redirect channel call leg associated with A. 3) All associated channels are hung up. Note that if the CLI command were done on the channel call leg associated with B it works. This regression was a result of the fix for issue #16946 (https://reviewboard.asterisk.org/r/740/). The regression affects all features that use an async goto to execute the dialplan because of an external event: Channel redirect, AMI redirect, SIP REFER, and FAX detection. The struct ast_channel._softhangup code is a mess. The variable is used for several purposes that do not necessarily result in the call being hung up. I have added doxygen comments to describe how the various _softhangup bits are used. I have corrected all the places where the variable was tested in a non-bit oriented manner. The primary fix is the new AST_CONTROL_END_OF_Q frame. It acts as a weak hangup request so the soft hangup requests that do not normally result in a hangup do not hangup. JIRA SWP-2470 JIRA SWP-2489 (closes issue #18171) Reported by: SantaFox (closes issue #18185) Reported by: kwemheuer (closes issue #18211) Reported by: zahir_koradia (closes issue #18230) Reported by: vmarrone (closes issue #18299) Reported by: mbrevda (closes issue #18322) Reported by: nerbos Review: https://reviewboard.asterisk.org/r/1013/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@295790 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r--apps/app_macro.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/apps/app_macro.c b/apps/app_macro.c
index 5586f24e5..c591135e9 100644
--- a/apps/app_macro.c
+++ b/apps/app_macro.c
@@ -501,20 +501,20 @@ static int _macro_exec(struct ast_channel *chan, void *data, int exclusive)
}
if (!strcasecmp(chan->context, fullmacro)) {
+ const char *offsets;
+
/* If we're leaving the macro normally, restore original information */
chan->priority = oldpriority;
ast_copy_string(chan->context, oldcontext, sizeof(chan->context));
- if (!(chan->_softhangup & AST_SOFTHANGUP_ASYNCGOTO)) {
- /* Copy the extension, so long as we're not in softhangup, where we could be given an asyncgoto */
- const char *offsets;
- ast_copy_string(chan->exten, oldexten, sizeof(chan->exten));
- if ((offsets = pbx_builtin_getvar_helper(chan, "MACRO_OFFSET"))) {
- /* Handle macro offset if it's set by checking the availability of step n + offset + 1, otherwise continue
- normally if there is any problem */
- if (sscanf(offsets, "%30d", &offset) == 1) {
- if (ast_exists_extension(chan, chan->context, chan->exten, chan->priority + offset + 1, chan->cid.cid_num)) {
- chan->priority += offset;
- }
+ ast_copy_string(chan->exten, oldexten, sizeof(chan->exten));
+ if ((offsets = pbx_builtin_getvar_helper(chan, "MACRO_OFFSET"))) {
+ /* Handle macro offset if it's set by checking the availability of step n + offset + 1, otherwise continue
+ normally if there is any problem */
+ if (sscanf(offsets, "%30d", &offset) == 1) {
+ if (ast_exists_extension(chan, chan->context, chan->exten,
+ chan->priority + offset + 1,
+ chan->cid.cid_num)) {
+ chan->priority += offset;
}
}
}