diff options
author | Richard Mudgett <rmudgett@digium.com> | 2013-06-21 22:39:27 +0000 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2013-06-21 22:39:27 +0000 |
commit | 1267c91315f6850483022b4535beadbc0069b22e (patch) | |
tree | 17236bfa946838220112a3d80fb86913f0b70aa8 /include/asterisk | |
parent | c14cdede125902fb5c59c92745ae10d6c1e57d33 (diff) |
Extract a useful routine from the softmix bridge technology.
* Extract a useful routine from the softmix bridge technology for other
technologies. Make other technologies use it if they can.
* Made native and 1-1 bridges write to all parties if the bridge channel
writing the frame into the bridge is NULL. Softmix will also do the same
for frame types that make sense.
* Tweak the bridge write routine return value meaning and adjust the
bridge technologies to match.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@392514 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk')
-rw-r--r-- | include/asterisk/bridging.h | 16 | ||||
-rw-r--r-- | include/asterisk/bridging_technology.h | 6 |
2 files changed, 20 insertions, 2 deletions
diff --git a/include/asterisk/bridging.h b/include/asterisk/bridging.h index 3f817f4f1..850245827 100644 --- a/include/asterisk/bridging.h +++ b/include/asterisk/bridging.h @@ -1065,6 +1065,22 @@ void ast_bridge_update_linkedids(struct ast_bridge *bridge, struct ast_bridge_ch void ast_bridge_update_accountcodes(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel, struct ast_bridge_channel *swap); /*! + * \brief Queue the given frame to everyone else. + * \since 12.0.0 + * + * \param bridge What bridge to distribute frame. + * \param bridge_channel Channel to optionally not pass frame to. (NULL to pass to everyone) + * \param frame Frame to pass. + * + * \note This is intended to be called by bridge hooks and + * bridge technologies. + * + * \retval 0 Frame written to at least one channel. + * \retval -1 Frame written to no channels. + */ +int ast_bridge_queue_everyone_else(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel, struct ast_frame *frame); + +/*! * \brief Write a frame to the specified bridge_channel. * \since 12.0.0 * diff --git a/include/asterisk/bridging_technology.h b/include/asterisk/bridging_technology.h index 33bdf2584..bc4326384 100644 --- a/include/asterisk/bridging_technology.h +++ b/include/asterisk/bridging_technology.h @@ -124,8 +124,10 @@ struct ast_bridge_technology { /*! * \brief Write a frame into the bridging technology instance for a bridge. * - * \retval 0 on success - * \retval -1 on failure + * \note The bridge must be tolerant of bridge_channel being NULL. + * + * \retval 0 Frame accepted into the bridge. + * \retval -1 Frame needs to be deferred. * * \note On entry, bridge is already locked. */ |