[Asterisk-code-review] bridge channel.c: Ignore role setup failure in channel push. (asterisk[13])

Richard Mudgett asteriskteam at digium.com
Fri Apr 15 20:10:32 CDT 2016


Richard Mudgett has uploaded a new change for review.

  https://gerrit.asterisk.org/2627

Change subject: bridge_channel.c: Ignore role setup failure in channel push.
......................................................................

bridge_channel.c: Ignore role setup failure in channel push.

We have to setup the channel roles after the bridge class push is called
because the push may have set roles on the incoming channel.  Since we
have already partially pushed the channel into the bridge and reversing
what we have already done could be problematic, the only thing we can do
is press on to complete pushing the channel into the bridge.

* Ignore any channel role setup after pushing the channel into a bridge.
The channel may behave incorrectly in the bridge but we have already
suffered an allocation failure.

Change-Id: I08a97082b729052ee65cdca6bb730cf1289ede00
---
M main/bridge_channel.c
1 file changed, 3 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/27/2627/1

diff --git a/main/bridge_channel.c b/main/bridge_channel.c
index c9262a8..e45ad17 100644
--- a/main/bridge_channel.c
+++ b/main/bridge_channel.c
@@ -2117,13 +2117,14 @@
 	if (bridge->dissolved
 		|| bridge_channel->state != BRIDGE_CHANNEL_STATE_WAIT
 		|| (swap && swap->state != BRIDGE_CHANNEL_STATE_WAIT)
-		|| bridge->v_table->push(bridge, bridge_channel, swap)
-		|| ast_bridge_channel_establish_roles(bridge_channel)) {
+		|| bridge->v_table->push(bridge, bridge_channel, swap)) {
 		ast_debug(1, "Bridge %s: pushing %p(%s) into bridge failed\n",
 			bridge->uniqueid, bridge_channel, ast_channel_name(bridge_channel->chan));
 		return -1;
 	}
 
+	ast_bridge_channel_establish_roles(bridge_channel);
+
 	if (swap) {
 		int dissolve = ast_test_flag(&bridge->feature_flags, AST_BRIDGE_FLAG_DISSOLVE_EMPTY);
 

-- 
To view, visit https://gerrit.asterisk.org/2627
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I08a97082b729052ee65cdca6bb730cf1289ede00
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>



More information about the asterisk-code-review mailing list