diff options
author | Kinsey Moore <kmoore@digium.com> | 2013-06-10 13:07:11 +0000 |
---|---|---|
committer | Kinsey Moore <kmoore@digium.com> | 2013-06-10 13:07:11 +0000 |
commit | a5bbc790e7ee1417bc03f5c529a73f2604a58cdb (patch) | |
tree | 4ae804770c499e8068bc04c4b896d9a8c0447715 /include/asterisk | |
parent | 0cec7dcdcd4ce053bfb27849e5bd90b181151182 (diff) |
Stasis-HTTP: Flesh out bridge-related capabilities
This adds support for Stasis applications to receive bridge-related
messages when the application shows interest in a given bridge.
To supplement this work and test it, this also adds support for the
following bridge-related Stasis-HTTP functionality:
* GET stasis/bridges
* GET stasis/bridges/{bridgeId}
* POST stasis/bridges
* DELETE stasis/bridges/{bridgeId}
* POST stasis/bridges/{bridgeId}/addChannel
* POST stasis/bridges/{bridgeId}/removeChannel
Review: https://reviewboard.asterisk.org/r/2572/
(closes issue ASTERISK-21711)
(closes issue ASTERISK-21621)
(closes issue ASTERISK-21622)
(closes issue ASTERISK-21623)
(closes issue ASTERISK-21624)
(closes issue ASTERISK-21625)
(closes issue ASTERISK-21626)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391199 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk')
-rw-r--r-- | include/asterisk/stasis_app.h | 50 | ||||
-rw-r--r-- | include/asterisk/stasis_bridging.h | 12 |
2 files changed, 62 insertions, 0 deletions
diff --git a/include/asterisk/stasis_app.h b/include/asterisk/stasis_app.h index 27b3502f3..3eed47e35 100644 --- a/include/asterisk/stasis_app.h +++ b/include/asterisk/stasis_app.h @@ -187,6 +187,56 @@ int stasis_app_control_queue_control(struct stasis_app_control *control, enum ast_control_frame_type frame_type); /*! + * \brief Create a bridge of the specified type. + * + * \param type The type of bridge to be created + * + * \return New bridge. + * \return \c NULL on error. + */ +struct ast_bridge *stasis_app_bridge_create(const char *type); + +/*! + * \brief Returns the bridge with the given id. + * \param bridge_id Uniqueid of the bridge. + * \return NULL bridge not created by a Stasis application, or bridge does not exist. + * \return Pointer to bridge. + */ +struct ast_bridge *stasis_app_bridge_find_by_id( + const char *bridge_id); + +/*! + * \brief Add a channel to the bridge. + * + * \param control Control whose channel should be added to the bridge + * \param bridge Pointer to the bridge + */ +void stasis_app_control_add_channel_to_bridge( + struct stasis_app_control *control, struct ast_bridge *bridge); + +/*! + * \brief Remove a channel from the bridge. + * + * \param control Control whose channel should be removed from the bridge + * \param bridge Pointer to the bridge + * + * \retval non-zero on failure + * \retval zero on success + */ +int stasis_app_control_remove_channel_from_bridge( + struct stasis_app_control *control, struct ast_bridge *bridge); + +/*! + * \brief Destroy the bridge. + * + * \param bridge_id Uniqueid of bridge to be destroyed + * + * \retval non-zero on failure + * \retval zero on success + */ +void stasis_app_bridge_destroy(const char *bridge_id); + +/*! * \brief Increment the res_stasis reference count. * * This ensures graceful shutdown happens in the proper order. diff --git a/include/asterisk/stasis_bridging.h b/include/asterisk/stasis_bridging.h index 5b8ff6ffc..42cb73ba0 100644 --- a/include/asterisk/stasis_bridging.h +++ b/include/asterisk/stasis_bridging.h @@ -207,6 +207,18 @@ void ast_bridge_publish_leave(struct ast_bridge *bridge, struct ast_channel *cha struct ast_json *ast_bridge_snapshot_to_json(const struct ast_bridge_snapshot *snapshot); /*! + * \brief Returns the most recent snapshot for the bridge. + * + * The returned pointer is AO2 managed, so ao2_cleanup() when you're done. + * + * \param bridge_id Uniqueid of the bridge for which to get the snapshot. + * \return Most recent snapshot. ao2_cleanup() when done. + * \return \c NULL if channel isn't in cache. + */ +struct ast_bridge_snapshot *ast_bridge_snapshot_get_latest( + const char *bridge_id); + +/*! * \brief Initialize the stasis bridging topic and message types * \retval 0 on success * \retval -1 on failure |