summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMatthew Jordan <mjordan@digium.com>2012-01-13 16:48:06 +0000
committerMatthew Jordan <mjordan@digium.com>2012-01-13 16:48:06 +0000
commita8276fe8efbca7e14862c469c0c95df71b506947 (patch)
tree8f777b718c107a4ba51c9f9fe93e347545e64ad2 /include
parent19a976108479e82e6d6d9eadae2e7cc20a98a0ac (diff)
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
Diffstat (limited to 'include')
-rw-r--r--include/asterisk/bridging.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/asterisk/bridging.h b/include/asterisk/bridging.h
index 54137b028..3c117b7cd 100644
--- a/include/asterisk/bridging.h
+++ b/include/asterisk/bridging.h
@@ -156,6 +156,8 @@ struct ast_bridge_channel {
int fds[4];
/*! Bit to indicate whether the channel is suspended from the bridge or not */
unsigned int suspended:1;
+ /*! Bit to indicate if a imparted channel is allowed to get hungup after leaving the bridge by the bridging core. */
+ unsigned int allow_impart_hangup:1;
/*! Features structure for features that are specific to this channel */
struct ast_bridge_features *features;
/*! Technology optimization parameters used by bridging technologies capable of
@@ -339,6 +341,7 @@ enum ast_bridge_channel_state ast_bridge_join(struct ast_bridge *bridge,
* \param chan Channel to impart
* \param swap Channel to swap out if swapping
* \param features Bridge features structure
+ * \param allow_hangup Indicates if the bridge thread should manage hanging up of the channel or not.
*
* \retval 0 on success
* \retval -1 on failure
@@ -346,7 +349,7 @@ enum ast_bridge_channel_state ast_bridge_join(struct ast_bridge *bridge,
* Example usage:
*
* \code
- * ast_bridge_impart(bridge, chan, NULL, NULL);
+ * ast_bridge_impart(bridge, chan, NULL, NULL, 0);
* \endcode
*
* This adds a channel pointed to by the chan pointer to the bridge pointed to by
@@ -360,7 +363,7 @@ enum ast_bridge_channel_state ast_bridge_join(struct ast_bridge *bridge,
* If channel specific features are enabled a pointer to the features structure
* can be specified in the features parameter.
*/
-int ast_bridge_impart(struct ast_bridge *bridge, struct ast_channel *chan, struct ast_channel *swap, struct ast_bridge_features *features);
+int ast_bridge_impart(struct ast_bridge *bridge, struct ast_channel *chan, struct ast_channel *swap, struct ast_bridge_features *features, int allow_hangup);
/*! \brief Depart a channel from a bridge
*