[asterisk-commits] mjordan: trunk r397691 - in /trunk: ./ main/bridge_channel.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Aug 26 18:48:58 CDT 2013


Author: mjordan
Date: Mon Aug 26 18:48:56 2013
New Revision: 397691

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=397691
Log:
Better handle clearing the OUTGOING flag when a channel leaves a bridge

When a channel with the OUTGOING flag leaves a bridge, and it will survive
being pulled from the bridge (either because it will execute dialplan,
go into another bridge, or live in a friendly autoloop), we have to clear
the OUTGOING flag. This is the signal to the CDR engine that this channel
is no longer a second class citizen, i.e., it is not "dialed".

The soft hangup flags are only half the picture. If a channel is being
moved from one bridge to another, the soft hangup flags aren't set; however,
the state of the bridge_channel will not be hung up. Since the channel does
not have one of the two hang up states, that implies that the channel is
still technically alive.

This patch modifies the check so that it checks both the soft hangup flags
as well as the bridge_channel state. If either suggests that the channel
is going to persist, we clear the OUTGOING flag.
........

Merged revisions 397690 from http://svn.asterisk.org/svn/asterisk/branches/12

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

Propchange: trunk/
------------------------------------------------------------------------------
--- branch-12-merged (original)
+++ branch-12-merged Mon Aug 26 18:48:56 2013
@@ -1,1 +1,1 @@
-/branches/12:1-397673
+/branches/12:1-397673,397690

Modified: trunk/main/bridge_channel.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/bridge_channel.c?view=diff&rev=397691&r1=397690&r2=397691
==============================================================================
--- trunk/main/bridge_channel.c (original)
+++ trunk/main/bridge_channel.c Mon Aug 26 18:48:56 2013
@@ -1527,8 +1527,9 @@
 	 * outgoing channel, clear the outgoing flag.
 	 */
 	if (ast_test_flag(ast_channel_flags(bridge_channel->chan), AST_FLAG_OUTGOING)
-			&& (ast_channel_softhangup_internal_flag(bridge_channel->chan) &
-				(AST_SOFTHANGUP_ASYNCGOTO | AST_SOFTHANGUP_UNBRIDGE))) {
+			&& (ast_channel_softhangup_internal_flag(bridge_channel->chan) & (AST_SOFTHANGUP_ASYNCGOTO | AST_SOFTHANGUP_UNBRIDGE)
+			    || bridge_channel->state == BRIDGE_CHANNEL_STATE_WAIT)) {
+		ast_debug(2, "Channel %s will survive this bridge; clearing outgoing (dialed) flag\n", ast_channel_name(bridge_channel->chan));
 		ast_clear_flag(ast_channel_flags(bridge_channel->chan), AST_FLAG_OUTGOING);
 	}
 




More information about the asterisk-commits mailing list