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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Dec 11 10:02:17 CST 2007


Author: file
Date: Tue Dec 11 10:02:17 2007
New Revision: 92304

URL: http://svn.digium.com/view/asterisk?view=rev&rev=92304
Log:
One minor change to allow bridge merging to work when a channel is imparted and a merge happens before the thread starts.

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=92304&r1=92303&r2=92304
==============================================================================
--- team/file/bridging/main/bridging.c (original)
+++ team/file/bridging/main/bridging.c Tue Dec 11 10:02:17 2007
@@ -781,6 +781,15 @@
 
 	ast_mutex_lock(&bridge->lock);
 
+	/* In the time between being imparted and this thread starting it is possible for our actual bridge to have changed, let's see if this is true... */
+	if (bridge_channel->state == AST_BRIDGE_CHANNEL_STATE_MERGE) {
+		struct ast_bridge *old_bridge = bridge;
+		bridge = bridge_channel->chan->bridge;
+		ast_mutex_unlock(&old_bridge->lock);
+		ast_atomic_fetchadd_int(&old_bridge->num, -1);
+		ast_mutex_lock(&bridge->lock);
+	}
+
 	bridge_channel->chan->bridge = bridge;
 
 	state = bridge_channel_join(bridge, bridge_channel);




More information about the asterisk-commits mailing list