[asterisk-commits] dlee: branch dlee/stasis-cache-split r394002 - in /team/dlee/stasis-cache-spl...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Jul 10 14:20:35 CDT 2013
Author: dlee
Date: Wed Jul 10 14:20:33 2013
New Revision: 394002
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=394002
Log:
Bridge topic accessors
Modified:
team/dlee/stasis-cache-split/include/asterisk/stasis_bridging.h
team/dlee/stasis-cache-split/main/stasis_bridging.c
team/dlee/stasis-cache-split/main/stasis_channels.c
Modified: team/dlee/stasis-cache-split/include/asterisk/stasis_bridging.h
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-cache-split/include/asterisk/stasis_bridging.h?view=diff&rev=394002&r1=394001&r2=394002
==============================================================================
--- team/dlee/stasis-cache-split/include/asterisk/stasis_bridging.h (original)
+++ team/dlee/stasis-cache-split/include/asterisk/stasis_bridging.h Wed Jul 10 14:20:33 2013
@@ -91,6 +91,22 @@
/*!
* \since 12
+ * \brief A topic which publishes the events for a particular bridge.
+ *
+ * \ref ast_bridge_snapshot messages are replaced with stasis_cache_update
+ * messages.
+ *
+ * If the given \a bridge is \c NULL, ast_bridge_topic_all_cached() is returned.
+ *
+ * \param bridge Bridge for which to get a topic or \c NULL.
+ *
+ * \retval Topic for bridge's events.
+ * \retval ast_bridge_topic_all() if \a bridge is \c NULL.
+ */
+struct stasis_topic *ast_bridge_topic_cached(struct ast_bridge *bridge);
+
+/*!
+ * \since 12
* \brief A topic which publishes the events for all bridges.
* \retval Topic for all bridge events.
*/
Modified: team/dlee/stasis-cache-split/main/stasis_bridging.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-cache-split/main/stasis_bridging.c?view=diff&rev=394002&r1=394001&r2=394002
==============================================================================
--- team/dlee/stasis-cache-split/main/stasis_bridging.c (original)
+++ team/dlee/stasis-cache-split/main/stasis_bridging.c Wed Jul 10 14:20:33 2013
@@ -397,6 +397,24 @@
return -1;
}
return 0;
+}
+
+struct stasis_topic *ast_bridge_topic(struct ast_bridge *bridge)
+{
+ if (!bridge) {
+ return ast_bridge_topic_all();
+ }
+
+ return stasis_cache_one_topic(bridge->topics);
+}
+
+struct stasis_topic *ast_bridge_topic_cached(struct ast_bridge *bridge)
+{
+ if (!bridge) {
+ return ast_bridge_topic_all_cached();
+ }
+
+ return stasis_cache_one_topic_cached(bridge->topics);
}
/*! \brief Destructor for bridge snapshots */
Modified: team/dlee/stasis-cache-split/main/stasis_channels.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-cache-split/main/stasis_channels.c?view=diff&rev=394002&r1=394001&r2=394002
==============================================================================
--- team/dlee/stasis-cache-split/main/stasis_channels.c (original)
+++ team/dlee/stasis-cache-split/main/stasis_channels.c Wed Jul 10 14:20:33 2013
@@ -858,6 +858,7 @@
int ast_stasis_channels_init(void)
{
int res = 0;
+
ast_register_cleanup(stasis_channels_cleanup);
channel_cache_all = stasis_cache_all_create("ast_channel_topic_all",
More information about the asterisk-commits
mailing list