[asterisk-commits] dlee: branch dlee/endpoints r385855 - /team/dlee/endpoints/include/asterisk/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Apr 16 09:43:55 CDT 2013


Author: dlee
Date: Tue Apr 16 09:43:51 2013
New Revision: 385855

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=385855
Log:
Obvious stuff

Added:
    team/dlee/endpoints/include/asterisk/stasis_endpoints.h   (with props)

Added: team/dlee/endpoints/include/asterisk/stasis_endpoints.h
URL: http://svnview.digium.com/svn/asterisk/team/dlee/endpoints/include/asterisk/stasis_endpoints.h?view=auto&rev=385855
==============================================================================
--- team/dlee/endpoints/include/asterisk/stasis_endpoints.h (added)
+++ team/dlee/endpoints/include/asterisk/stasis_endpoints.h Tue Apr 16 09:43:51 2013
@@ -1,0 +1,150 @@
+/*
+ * Asterisk -- An open source telephony toolkit.
+ *
+ * Copyright (C) 2013, Digium, Inc.
+ *
+ * David M. Lee, II <dlee at digium.com>
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE file
+ * at the top of the source tree.
+ */
+
+#ifndef _ASTERISK_STASIS_ENDPOINTS_H
+#define _ASTERISK_STASIS_ENDPOINTS_H
+
+/*! \file
+ *
+ * \brief Endpoint abstractions.
+ *
+ * \author David M. Lee, II <dlee at digium.com>
+ * \since 12
+ */
+
+#include "asterisk/json.h"
+
+/*!
+ * \brief Opaque struct representing an endpoint.
+ *
+ * And an endpoint is an external device/system that may offer/accept channels
+ * to/from Asterisk.
+ *
+ * \since 12
+ */
+struct ast_endpoint;
+
+/*!
+ * \brief Gets the name of the given endpoint.
+ * \param endpoint The endpoint.
+ * \return Name of the endpoint.
+ * \return \c NULL if endpoint is \c NULL.
+ * \since 12
+ */
+const char *ast_endpoint_get_name(struct ast_endpoint *endpoint);
+
+/*!
+ * \brief Finds the endpoint with the given name.
+ * \param name Name of the endpoint.
+ * \return \ref ast_endpoint with the given name.
+ * \return \c NULL if endpoint is not found.
+ * \since 12
+ */
+struct ast_endpoint *ast_find_endpoint_by_name(const char *name);
+
+/*! \addtogroup StasisTopicsAndMessages
+ * @{
+ */
+
+/*!
+ * \brief Valid states for an endpoint.
+ * \since 12
+ */
+enum ast_endpoint_state {
+	/*! The endpoint cannot offer or accept channels due to configuration. */
+	AST_ENDPOINT_DISABLED,
+	/*! The endpoint is currently not in use (no channels). */
+	AST_ENDPOINT_IDLE,
+	/*! The endpoint has one or more channels. */
+	AST_ENDPOINT_ACTIVE,
+	/*! The endpoint cannot offer or accept channels due to an error condition. */
+	AST_ENDPOINT_ERROR,
+};
+
+/*!
+ * \brief A snapshot of an endpoint's state.
+ * \since 12
+ */
+struct ast_endpoint_snapshot {
+	AST_DECLARE_STRING_FIELDS(
+		AST_STRING_FIELD(name);	/*!< Name of the endpoint. */
+		);
+
+	/*! Endpoint state */
+	enum ast_endpoint_state state;
+	/*!
+	 * Maximum number of channels this endpoint supports. If the upper limit
+	 * for an endpoint is unknown, this field is set to -1.
+	 */
+	int max_channels;
+	/*! Number of channels currently active on this endpoint */
+	int current_channels;
+};
+
+/*!
+ * \brief Blob of data associated with an endpoint.
+ *
+ * The blob is actually a JSON object of structured data. It has a "type" field
+ * which contains the type string describing this blob.
+ *
+ * \since 12
+ */
+struct ast_endpoint_blob {
+	struct ast_endpoint_snapshot *snapshot;
+	struct ast_json *blob;
+};
+
+/*!
+ * \brief Message type for \ref ast_endpoint_snapshot.
+ * \since 12
+ */
+struct stasis_message_type *ast_endpoint_snapshot_type(void);
+
+/*!
+ * \brief Topic for a specific endpoint.
+ * \param endpoint The endpoint.
+ * \return Topic for this endpoint.
+ * \return ast_endpoint_topic_all() if \a endpoint is \c NULL.
+ */
+struct stasis_topic *ast_endpoint_topic(ast_endpoint *endpoint);
+
+/*!
+ * \brief Topic for all endpoint releated messages.
+ * \since 12
+ */
+struct stasis_topic *ast_endpoint_topic_all(void);
+
+/*!
+ * \brief Cached topic for all endpoint related messages.
+ * \since 12
+ */
+struct stasis_caching_topic *ast_endpoint_topic_all_cached(void);
+
+/*!
+ * \brief Retrieve the most recent snapshot for the endpoint with the given
+ * name.
+ * \param name Name of the endpoint.
+ * \return Snapshot of the endpoint with the given name.
+ * \return \c NULL if endpoint is not found, or on error.
+ * \since 12
+ */
+struct ast_endpoint_snapshot *ast_endpoint_latest_snapshot(const char *name);
+
+/*! @} */
+
+#endif /* _ASTERISK_STASIS_ENDPOINTS_H */

Propchange: team/dlee/endpoints/include/asterisk/stasis_endpoints.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/dlee/endpoints/include/asterisk/stasis_endpoints.h
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/dlee/endpoints/include/asterisk/stasis_endpoints.h
------------------------------------------------------------------------------
    svn:mime-type = text/plain




More information about the asterisk-commits mailing list