Fix crash from bridge channel hangup race condition in ConfBridge

This patch addresses two issues in ConfBridge and the channel bridge layer:
1. It fixes a race condition wherein the bridge channel could be hung up
2. It removes the deadlock avoidance from the bridging layer and makes the
   bridge_pvt an ao2 ref counted object

Patch by David Vossel (mjordan was merely the commit monkey)

(issue ASTERISK-18988)
(closes issue ASTERISK-18885)
Reported by: Dmitry Melekhov
Tested by: Matt Jordan
Patches: chan_bridge_cleanup_v.diff uploaded by David Vossel (license 5628)

(closes issue ASTERISK-19100)
Reported by: Matt Jordan
Tested by: Matt Jordan

Review: https://reviewboard.asterisk.org/r/1654/
........

Merged revisions 350550 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350551 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Matthew Jordan
2012-01-13 16:48:06 +00:00
parent 19a9761084
commit a8276fe8ef
5 changed files with 44 additions and 73 deletions

View File

@@ -123,7 +123,7 @@ static int feature_blind_transfer(struct ast_bridge *bridge, struct ast_bridge_c
}
/* This is sort of the fun part. We impart the above channel onto the bridge, and have it take our place. */
ast_bridge_impart(bridge, chan, bridge_channel->chan, NULL);
ast_bridge_impart(bridge, chan, bridge_channel->chan, NULL, 1);
return 0;
}
@@ -200,7 +200,7 @@ static int feature_attended_transfer(struct ast_bridge *bridge, struct ast_bridg
ast_bridge_features_set_flag(&called_features, AST_BRIDGE_FLAG_DISSOLVE);
/* This is how this is going down, we are imparting the channel we called above into this bridge first */
ast_bridge_impart(attended_bridge, chan, NULL, &called_features);
ast_bridge_impart(attended_bridge, chan, NULL, &called_features, 1);
/* Before we join setup a features structure with the hangup option, just in case they want to use DTMF */
ast_bridge_features_init(&caller_features);
@@ -222,9 +222,9 @@ static int feature_attended_transfer(struct ast_bridge *bridge, struct ast_bridg
/* If the user wants to turn this into a threeway transfer then do so, otherwise they take our place */
if (attended_bridge_result == AST_BRIDGE_CHANNEL_STATE_DEPART) {
/* We want to impart them upon the bridge and just have us return to it as normal */
ast_bridge_impart(bridge, chan, NULL, NULL);
ast_bridge_impart(bridge, chan, NULL, NULL, 1);
} else {
ast_bridge_impart(bridge, chan, bridge_channel->chan, NULL);
ast_bridge_impart(bridge, chan, bridge_channel->chan, NULL, 1);
}
} else {
ast_stream_and_wait(bridge_channel->chan, "beeperr", AST_DIGIT_ANY);