From: Richard Mudgett Date: Mon, 25 Jun 2012 15:57:28 +0000 (+0000) Subject: Fix Bridge application occasionally returning to the wrong location. X-Git-Tag: 1.8.15.0-rc1~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dd1390e777bd28f2f9f657948e1abe8aad08777e;p=thirdparty%2Fasterisk.git Fix Bridge application occasionally returning to the wrong location. * Fix do_bridge_masquerade() getting the resume location from the zombie channel. The code must not touch a clone channel after it has masqueraded it. The clone channel has become a zombie and is starting to hangup. (closes issue ASTERISK-19985) Reported by: jamicque Patches: jira_asterisk_19985_v1.8.patch (license #5621) patch uploaded by rmudgett Tested by: jamicque git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@369327 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/features.c b/main/features.c index 2e11e128c7..b684b8bcff 100644 --- a/main/features.c +++ b/main/features.c @@ -6813,8 +6813,15 @@ static char *handle_features_reload(struct ast_cli_entry *e, int cmd, struct ast */ static int do_bridge_masquerade(struct ast_channel *chan, struct ast_channel *tmpchan) { + const char *context; + const char *exten; + int priority; + ast_moh_stop(chan); ast_channel_lock_both(chan, tmpchan); + context = ast_strdupa(chan->context); + exten = ast_strdupa(chan->exten); + priority = chan->priority; ast_setstate(tmpchan, chan->_state); tmpchan->readformat = chan->readformat; tmpchan->writeformat = chan->writeformat; @@ -6828,7 +6835,7 @@ static int do_bridge_masquerade(struct ast_channel *chan, struct ast_channel *tm ast_do_masquerade(tmpchan); /* when returning from bridge, the channel will continue at the next priority */ - ast_explicit_goto(tmpchan, chan->context, chan->exten, chan->priority + 1); + ast_explicit_goto(tmpchan, context, exten, priority + 1); return 0; }