diff options
author | Richard Mudgett <rmudgett@digium.com> | 2015-01-22 19:30:12 +0000 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2015-01-22 19:30:12 +0000 |
commit | 9bff4eeca3d1fe1d10217b62d326c3907af09e00 (patch) | |
tree | e2634acc0439d25099e12990c9ee7b193c59c41a /include/asterisk/bridge.h | |
parent | e67ca431ee2addffd9e23c895ef170f2dc79bfb6 (diff) |
Bridge core: Pass a ref with the swap channel when joining a bridge.
When code imparts a channel into a bridge to swap with another channel, a
ref needs to be held on the swap channel to ensure that it cannot
dissapear before finding it in the bridge.
* The ast_bridge_join() swap channel parameter now always steals a ref for
the swap channel. This is the only change to the bridge framework's
public API semantics.
* bridge_channel_internal_join() now requires the bridge_channel->swap
channel to pass in a ref.
ASTERISK-24649
Reported by: John Bigelow
Review: https://reviewboard.asterisk.org/r/4354/
........
Merged revisions 430975 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430976 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/bridge.h')
-rw-r--r-- | include/asterisk/bridge.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/include/asterisk/bridge.h b/include/asterisk/bridge.h index ccfb541b9..fecca1dd2 100644 --- a/include/asterisk/bridge.h +++ b/include/asterisk/bridge.h @@ -444,15 +444,19 @@ enum ast_bridge_join_flags { }; /*! - * \brief Join (blocking) a channel to a bridge + * \brief Join a channel to a bridge (blocking) * * \param bridge Bridge to join * \param chan Channel to join - * \param swap Channel to swap out if swapping + * \param swap Channel to swap out if swapping (A channel reference is stolen.) * \param features Bridge features structure * \param tech_args Optional Bridging tech optimization parameters for this channel. * \param flags defined by enum ast_bridge_join_flags. * + * \note The passed in swap channel is always unreffed on return. It is not a + * good idea to access the swap channel on return or for the caller to keep a + * reference to it. + * * \note Absolutely _NO_ locks should be held before calling * this function since it blocks. * @@ -495,7 +499,7 @@ enum ast_bridge_impart_flags { }; /*! - * \brief Impart (non-blocking) a channel onto a bridge + * \brief Impart a channel to a bridge (non-blocking) * * \param bridge Bridge to impart on * \param chan Channel to impart (The channel reference is stolen if impart successful.) |