summaryrefslogtreecommitdiff
path: root/main/features.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2012-06-25 16:07:02 +0000
committerRichard Mudgett <rmudgett@digium.com>2012-06-25 16:07:02 +0000
commitd0fda07d74b0e73ea563e3b90361faf5f20965e3 (patch)
tree0043045afeb8ff131e8bf44056d5d18790d440d1 /main/features.c
parent453e01725de7d16f538ca928065fcee3a6d0e650 (diff)
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 ........ Merged revisions 369327 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 369328 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369329 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/features.c')
-rw-r--r--main/features.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/main/features.c b/main/features.c
index 45e792f10..fbeaa7572 100644
--- a/main/features.c
+++ b/main/features.c
@@ -7138,8 +7138,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(ast_channel_context(chan));
+ exten = ast_strdupa(ast_channel_exten(chan));
+ priority = ast_channel_priority(chan);
ast_setstate(tmpchan, ast_channel_state(chan));
ast_format_copy(ast_channel_readformat(tmpchan), ast_channel_readformat(chan));
ast_format_copy(ast_channel_writeformat(tmpchan), ast_channel_writeformat(chan));
@@ -7153,7 +7160,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, ast_channel_context(chan), ast_channel_exten(chan), ast_channel_priority(chan) + 1);
+ ast_explicit_goto(tmpchan, context, exten, priority + 1);
return 0;
}