summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2013-07-03 20:41:00 +0000
committerMark Michelson <mmichelson@digium.com>2013-07-03 20:41:00 +0000
commit0f725bd5d9646dc04db390b94e6c1a5ece9bf628 (patch)
tree72a06063b17503ac2b7f0bc4493fc1bc36248aa7 /main
parentdbc588b02f0da1caffc53faffd0a91b8f3047907 (diff)
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. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393586 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main')
-rw-r--r--main/bridging.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/main/bridging.c b/main/bridging.c
index 2dc2ec124..dc84c41ce 100644
--- a/main/bridging.c
+++ b/main/bridging.c
@@ -710,6 +710,9 @@ static int bridge_channel_push(struct ast_bridge_channel *bridge_channel)
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 @@ static int bridge_channel_push(struct ast_bridge_channel *bridge_channel)
pbx_builtin_setvar_helper(bridge_channel->chan, "BLINDTRANSFER", NULL);
bridge->reconfigured = 1;
- ast_bridge_publish_enter(bridge, bridge_channel->chan);
return 0;
}