[asterisk-commits] jrose: trunk r421195 - in /trunk: ./ main/channel.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Aug 15 12:26:16 CDT 2014


Author: jrose
Date: Fri Aug 15 12:26:12 2014
New Revision: 421195

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=421195
Log:
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
........

Merged revisions 421187 from http://svn.asterisk.org/svn/asterisk/branches/13

Modified:
    trunk/   (props changed)
    trunk/main/channel.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-13-merged' - no diff available.

Modified: trunk/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/channel.c?view=diff&rev=421195&r1=421194&r2=421195
==============================================================================
--- trunk/main/channel.c (original)
+++ trunk/main/channel.c Fri Aug 15 12:26:12 2014
@@ -10217,12 +10217,14 @@
 {
 	int hangup_flags = ast_channel_softhangup_internal_flag(chan);
 	int hangup_test = hangup_flags & AST_SOFTHANGUP_ASYNCGOTO;
-
-	/* 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.
+	int unbridge = ast_channel_unbridged(chan);
+
+	/* 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)




More information about the asterisk-commits mailing list