[asterisk-commits] mjordan: branch 12 r397690 - /branches/12/main/bridge_channel.c

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


Author: mjordan
Date: Mon Aug 26 18:38:11 2013
New Revision: 397690

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

Modified:
    branches/12/main/bridge_channel.c

Modified: branches/12/main/bridge_channel.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/main/bridge_channel.c?view=diff&rev=397690&r1=397689&r2=397690
==============================================================================
--- branches/12/main/bridge_channel.c (original)
+++ branches/12/main/bridge_channel.c Mon Aug 26 18:38:11 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