diff options
author | Jonathan Rose <jrose@digium.com> | 2014-08-15 17:08:49 +0000 |
---|---|---|
committer | Jonathan Rose <jrose@digium.com> | 2014-08-15 17:08:49 +0000 |
commit | 2c013ae774b9748f5f9c8d9eb7ad0067f372e71b (patch) | |
tree | 0f16f2d32fc7eabc0f3ac2aa3af429eb91afcedb /main/channel.c | |
parent | 544e092b2db48c59a0f22e4a64ad307d91e585f3 (diff) |
Bridging: Fix a behavioral change when checking if a channel is leaving a bridge
r420934 introduced some failures in the test suite. Upon investigating, it was
discovered that differences in the way we were evaluating whether a channel was in
the process of leaving a bridge were causing some reinvites not to occur (mostly
reinvites back to Asterisk when ending a call). This patch fixes that behavioral
change.
ASTERISK-24027 #close
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/3910/
........
Merged revisions 421186 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@421187 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/channel.c')
-rw-r--r-- | main/channel.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/main/channel.c b/main/channel.c index 287ed305e..8e9f13dc9 100644 --- a/main/channel.c +++ b/main/channel.c @@ -10217,12 +10217,14 @@ int ast_channel_is_leaving_bridge(struct ast_channel *chan) { int hangup_flags = ast_channel_softhangup_internal_flag(chan); int hangup_test = hangup_flags & AST_SOFTHANGUP_ASYNCGOTO; + int unbridge = ast_channel_unbridged(chan); - /* This function should only return true if only the ASYNCGOTO - * is set. It should false if any other flag is set or if the - * ASYNCGOTO flag is not set. + /* This function should only return true if either the unbridged flag or + * the ASYNCGOTO soft hangup flag is set and when no other soft hangup + * flags are set. Any other soft hangup flags being set should make it + * return false. */ - return (hangup_test && (hangup_test == hangup_flags)); + return ((hangup_test || unbridge) && (hangup_test == hangup_flags)); } struct ast_channel *ast_channel_bridge_peer(struct ast_channel *chan) |