[asterisk-commits] kmoore: branch kmoore/stasis-bridging_events-rework r390024 - /team/kmoore/st...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed May 29 10:14:47 CDT 2013


Author: kmoore
Date: Wed May 29 10:14:43 2013
New Revision: 390024

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=390024
Log:
Add missing function

Modified:
    team/kmoore/stasis-bridging_events-rework/main/stasis_bridging.c

Modified: team/kmoore/stasis-bridging_events-rework/main/stasis_bridging.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridging_events-rework/main/stasis_bridging.c?view=diff&rev=390024&r1=390023&r2=390024
==============================================================================
--- team/kmoore/stasis-bridging_events-rework/main/stasis_bridging.c (original)
+++ team/kmoore/stasis-bridging_events-rework/main/stasis_bridging.c Wed May 29 10:14:43 2013
@@ -317,6 +317,28 @@
 	if (r) { ast_log(LOG_ERROR, "Error adding attrib to channel json object\n"); return NULL; }
 
 	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;
 }
 
 void ast_stasis_bridging_shutdown(void)




More information about the asterisk-commits mailing list