[asterisk-commits] file: branch file/bridging r159894 - /team/file/bridging/main/bridging.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Nov 30 12:14:38 CST 2008


Author: file
Date: Sun Nov 30 12:14:38 2008
New Revision: 159894

URL: http://svn.digium.com/view/asterisk?view=rev&rev=159894
Log:
Do dissolve checking when leaving the bridge so that if something outside the bridging core (like a feature) ends the call the bridge will dissolve.

Modified:
    team/file/bridging/main/bridging.c

Modified: team/file/bridging/main/bridging.c
URL: http://svn.digium.com/view/asterisk/team/file/bridging/main/bridging.c?view=diff&rev=159894&r1=159893&r2=159894
==============================================================================
--- team/file/bridging/main/bridging.c (original)
+++ team/file/bridging/main/bridging.c Sun Nov 30 12:14:38 2008
@@ -260,8 +260,6 @@
 		if (!frame || (frame->frametype == AST_FRAME_CONTROL && frame->subclass == AST_CONTROL_HANGUP)) {
 			/* Signal the thread that is handling the bridged channel that it should be ended */
 			bridge_change_state(bridge_channel, AST_BRIDGE_CHANNEL_STATE_END);
-			/* Perform bridge dissolving stuff if needed */
-			bridge_check_dissolve(bridge, bridge_channel);
 		} else if (frame->frametype == AST_FRAME_CONTROL && frame->subclass == AST_CONTROL_ANSWER) {
 			ast_debug(1, "Dropping answer frame from bridge channel %p\n", bridge_channel);
 		} else {
@@ -837,6 +835,11 @@
 		}
 	}
 
+	/* See if we need to dissolve the bridge itself if they hung up */
+	if (bridge_channel->state == AST_BRIDGE_CHANNEL_STATE_END) {
+		bridge_check_dissolve(bridge_channel->bridge, bridge_channel);
+	}
+
 	/* Tell the bridge technology we are leaving so they tear us down */
 	if (bridge_channel->bridge->technology->leave) {
 		ast_debug(1, "Giving bridge technology %s notification that %p is leaving bridge %p\n", bridge_channel->bridge->technology->name, bridge_channel, bridge_channel->bridge);
@@ -1330,8 +1333,6 @@
 {
 	/* This is very simple, we basically change the state on the bridge channel to end and the core takes care of the rest */
 	bridge_channel->state = AST_BRIDGE_CHANNEL_STATE_END;
-	/* See if the bridge needs to dissolve away */
-	bridge_check_dissolve(bridge, bridge_channel);
 	return 0;
 }
 




More information about the asterisk-commits mailing list