[svn-commits] mmichelson: trunk r393586 - /trunk/main/bridging.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Jul 3 15:41:02 CDT 2013


Author: mmichelson
Date: Wed Jul  3 15:41:00 2013
New Revision: 393586

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=393586
Log:
Publish a bridge enter before pulling on a push-and-swap operation.

Prior to this patch, the order of procedures on a bridge push was

* Add new bridge channel to bridge's array.
* Pull the swap channel out of the bridge
* Publish a bridge enter event.

The problem is that when the swap channel was pulled from the bridge,
a bridge leave event would be published. The bridge snapshot
published during the bridge leave showed the new channel that had
been added to the bridge, but there had been no bridge enter event
for that channel.

The fix provided here was to change the order a bit

* Add new bridge channel to bridge's array.
* Publish bridge enter event.
* Pull the swap channel out of the bridge.

This makes it so that the bridge snapshots during the stasis
events are accurate.


Modified:
    trunk/main/bridging.c

Modified: trunk/main/bridging.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/bridging.c?view=diff&rev=393586&r1=393585&r2=393586
==============================================================================
--- trunk/main/bridging.c (original)
+++ trunk/main/bridging.c Wed Jul  3 15:41:00 2013
@@ -710,6 +710,9 @@
 	bridge_channel->just_joined = 1;
 	AST_LIST_INSERT_TAIL(&bridge->channels, bridge_channel, entry);
 	++bridge->num_channels;
+
+	ast_bridge_publish_enter(bridge, bridge_channel->chan);
+
 	if (!bridge_channel->suspended) {
 		++bridge->num_active;
 	}
@@ -722,7 +725,6 @@
 	pbx_builtin_setvar_helper(bridge_channel->chan, "BLINDTRANSFER", NULL);
 
 	bridge->reconfigured = 1;
-	ast_bridge_publish_enter(bridge, bridge_channel->chan);
 	return 0;
 }
 




More information about the svn-commits mailing list