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 /main | |
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 'main')
-rw-r--r-- | main/stasis_bridging.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/main/stasis_bridging.c b/main/stasis_bridging.c index d181c400c..28771a7b8 100644 --- a/main/stasis_bridging.c +++ b/main/stasis_bridging.c @@ -310,6 +310,28 @@ struct ast_json *ast_bridge_snapshot_to_json(const struct ast_bridge_snapshot *s return ast_json_ref(json_chan); } +struct ast_bridge_snapshot *ast_bridge_snapshot_get_latest(const char *uniqueid) +{ + RAII_VAR(struct stasis_message *, message, NULL, ao2_cleanup); + struct ast_bridge_snapshot *snapshot; + + ast_assert(!ast_strlen_zero(uniqueid)); + + message = stasis_cache_get(ast_bridge_topic_all_cached(), + ast_bridge_snapshot_type(), + uniqueid); + if (!message) { + return NULL; + } + + snapshot = stasis_message_data(message); + if (!snapshot) { + return NULL; + } + ao2_ref(snapshot, +1); + return snapshot; +} + static void stasis_bridging_cleanup(void) { ao2_cleanup(bridge_topic_all); |