[asterisk-commits] StatsD: Write skeleton Asterisk application (asterisk[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Oct 13 11:59:24 CDT 2015


Matt Jordan has submitted this change and it was merged.

Change subject: StatsD: Write skeleton Asterisk application
......................................................................


StatsD: Write skeleton Asterisk application

Wrote the skeleton framework for the Asterisk StatsD dialplan
application. This includes a load function, unload function, a
callback for execution, and XML documentation.

ASTERISK-25419
Reported By: Ashley Sanders

Change-Id: I9597730e134c6e82c8a55ef4d5334b62dd473363
---
A apps/app_statsd.c
1 file changed, 74 insertions(+), 0 deletions(-)

Approvals:
  Kevin Harwell: Looks good to me, but someone else must approve
  Anonymous Coward #1000019: Verified
  Matt Jordan: Looks good to me, approved
  Joshua Colp: Looks good to me, but someone else must approve



diff --git a/apps/app_statsd.c b/apps/app_statsd.c
new file mode 100644
index 0000000..cf05419
--- /dev/null
+++ b/apps/app_statsd.c
@@ -0,0 +1,74 @@
+/*
+ * Asterisk -- An open source telephony toolkit.
+ *
+ * Copyright (C) 2015, Digium, Inc.
+ *
+ * Tyler Cambron <tcambron 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.
+ */
+
+ /*** MODULEINFO
+	<depend>res_statsd</depend>
+	<defaultenabled>no</defaultenabled>
+	<support_level>extended</support_level>
+ ***/
+
+#include "asterisk.h"
+
+ASTERISK_REGISTER_FILE()
+
+#include "asterisk/module.h"
+#include "asterisk/logger.h"
+
+/*** DOCUMENTATION
+	<application name="Statsd" language="en_US">
+		<synopsis>
+			Allow statistics to be passed to the StatsD server from the dialplan.
+		</synopsis>
+		<syntax>
+			<parameter name="metric_type" required="true">
+				<para>The metric type to be sent to StatsD.</para>
+			</parameter>
+			<parameter name="statistic_name" required="true">
+				<para>The name of the variable to be sent to StatsD.</para>
+			</parameter>
+			<parameter name="value" required="true">
+				<para>The value of the variable to be sent to StatsD.</para>
+			</parameter>
+		</syntax>
+		<description>
+			<para>This dialplan application sends statistics to the StatsD server
+			specified inside of <literal>statsd.conf</literal>.</para>
+		</description>
+	</application>
+ ***/
+
+static const char app[] = "Statsd";
+
+static int statsd_exec(struct ast_channel *chan, const char *data)
+{
+	ast_log(LOG_NOTICE, "StatsD application callback is working!\n");
+	return 0;
+}
+
+
+static int unload_module(void)
+{
+	return ast_unregister_application(app);
+}
+
+static int load_module(void)
+{
+	return ast_register_application_xml(app, statsd_exec);
+}
+
+AST_MODULE_INFO_STANDARD_EXTENDED(ASTERISK_GPL_KEY, "Statsd Dialplan Application");
\ No newline at end of file

-- 
To view, visit https://gerrit.asterisk.org/1414
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I9597730e134c6e82c8a55ef4d5334b62dd473363
Gerrit-PatchSet: 4
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Tyler Cambron <tcambron at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>



More information about the asterisk-commits mailing list