mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
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
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user