[asterisk-commits] dlee: branch dlee/stasis-cache-split r394015 - in /team/dlee/stasis-cache-spl...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Jul 10 15:30:19 CDT 2013
Author: dlee
Date: Wed Jul 10 15:30:18 2013
New Revision: 394015
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=394015
Log:
Endpoint topics
Modified:
team/dlee/stasis-cache-split/include/asterisk/stasis_endpoints.h
team/dlee/stasis-cache-split/main/endpoints.c
Modified: team/dlee/stasis-cache-split/include/asterisk/stasis_endpoints.h
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-cache-split/include/asterisk/stasis_endpoints.h?view=diff&rev=394015&r1=394014&r2=394015
==============================================================================
--- team/dlee/stasis-cache-split/include/asterisk/stasis_endpoints.h (original)
+++ team/dlee/stasis-cache-split/include/asterisk/stasis_endpoints.h Wed Jul 10 15:30:18 2013
@@ -137,12 +137,29 @@
/*!
* \brief Returns the topic for a specific endpoint.
*
+ * This is AO2 managed, so ao2_cleanup when done.
+ *
* \param endpoint The endpoint.
* \return The topic for the given endpoint.
* \return ast_endpoint_topic_all() if endpoint is \c NULL.
* \since 12
*/
struct stasis_topic *ast_endpoint_topic(struct ast_endpoint *endpoint);
+
+/*!
+ * \brief Returns the topic for a specific endpoint.
+ *
+ * \ref ast_endpoint_snapshot messages are replaced with
+ * \ref stasis_cache_update
+ *
+ * This is AO2 managed, so ao2_cleanup when done.
+ *
+ * \param endpoint The endpoint.
+ * \return The topic for the given endpoint.
+ * \return ast_endpoint_topic_all() if endpoint is \c NULL.
+ * \since 12
+ */
+struct stasis_topic *ast_endpoint_topic_cached(struct ast_endpoint *endpoint);
/*!
* \internal
Modified: team/dlee/stasis-cache-split/main/endpoints.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-cache-split/main/endpoints.c?view=diff&rev=394015&r1=394014&r2=394015
==============================================================================
--- team/dlee/stasis-cache-split/main/endpoints.c (original)
+++ team/dlee/stasis-cache-split/main/endpoints.c Wed Jul 10 15:30:18 2013
@@ -65,6 +65,22 @@
struct ao2_container *channel_ids;
};
+struct stasis_topic *ast_endpoint_topic(struct ast_endpoint *endpoint)
+{
+ if (!endpoint) {
+ return ast_endpoint_topic_all();
+ }
+ return stasis_cache_one_topic(endpoint->topics);
+}
+
+struct stasis_topic *ast_endpoint_topic_cached(struct ast_endpoint *endpoint)
+{
+ if (!endpoint) {
+ return ast_endpoint_topic_all_cached();
+ }
+ return stasis_cache_one_topic_cached(endpoint->topics);
+}
+
const char *ast_endpoint_state_to_string(enum ast_endpoint_state state)
{
switch (state) {
More information about the asterisk-commits
mailing list