summaryrefslogtreecommitdiff
path: root/include/asterisk/bridge.h
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2013-08-16 20:48:13 +0000
committerRichard Mudgett <rmudgett@digium.com>2013-08-16 20:48:13 +0000
commit35b9c6a660236e23e6b9102cc641ab11e967a25a (patch)
treeaa2856e4d3e9b1352296d4bfdff2af8a005e4835 /include/asterisk/bridge.h
parent6399836f9b14ce180d2c15985cf59b23fdceb07b (diff)
Fix CLI "bridge kick <bridge> <channel>" to check if the bridge needs dissolving.
SIP/foo -- Local;1==Local;2 -- .... -- Local;1==Local;2 -- SIP/bar Kick a ;1 channel and the chain toward SIP/foo goes away. Kick a ;2 channel and the chain toward SIP/bar goes away. This can leave a local channel chain between the kicked ;1 and ;2 channels that are orphaned until you manually request one of those channels to hangup or request the bridge to dissolve. * Added ast_bridge_kick() as a companion to ast_bridge_remove(). The functional difference is that ast_bridge_kick() may dissolve the bridge as a result of the channel leaving the bridge. * Made CLI "bridge kick <bridge> <channel>" use ast_bridge_kick() instead of ast_bridge_remove() so the bridge can dissolve if needed. * Renamed bridge_channel_handle_hangup() to ast_bridge_channel_kick() and made it accessible to other files. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396877 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/bridge.h')
-rw-r--r--include/asterisk/bridge.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/include/asterisk/bridge.h b/include/asterisk/bridge.h
index 973490769..9522962bc 100644
--- a/include/asterisk/bridge.h
+++ b/include/asterisk/bridge.h
@@ -563,6 +563,37 @@ int ast_bridge_depart(struct ast_channel *chan);
int ast_bridge_remove(struct ast_bridge *bridge, struct ast_channel *chan);
/*!
+ * \brief Kick a channel from a bridge
+ *
+ * \param bridge Bridge that the channel is to be kicked from
+ * \param chan Channel to kick
+ *
+ * \retval 0 on success
+ * \retval -1 on failure
+ *
+ * Example usage:
+ *
+ * \code
+ * ast_bridge_kick(bridge, chan);
+ * \endcode
+ *
+ * \details
+ * This kicks the channel pointed to by the chan pointer from
+ * the bridge pointed to by the bridge pointer and requests that
+ * it be hung up. Control over the channel will NOT be given to
+ * the calling thread.
+ *
+ * \note The functional difference between ast_bridge_kick() and
+ * ast_bridge_remove() is that the bridge may dissolve as a
+ * result of the channel being kicked.
+ *
+ * \note This API call can be used on channels that were added
+ * to the bridge using both ast_bridge_join and
+ * ast_bridge_impart.
+ */
+int ast_bridge_kick(struct ast_bridge *bridge, struct ast_channel *chan);
+
+/*!
* \brief Merge two bridges together
*
* \param dst_bridge Destination bridge of merge.