[asterisk-commits] dvossel: branch dvossel/awesomehooks r287192 - /team/dvossel/awesomehooks/funcs/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Sep 16 15:49:51 CDT 2010


Author: dvossel
Date: Thu Sep 16 15:49:47 2010
New Revision: 287192

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=287192
Log:
func_awesome_trace for debugging internal ast_frame read and write streams on a channel.

Added:
    team/dvossel/awesomehooks/funcs/func_awesome_trace.c   (with props)

Added: team/dvossel/awesomehooks/funcs/func_awesome_trace.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/awesomehooks/funcs/func_awesome_trace.c?view=auto&rev=287192
==============================================================================
--- team/dvossel/awesomehooks/funcs/func_awesome_trace.c (added)
+++ team/dvossel/awesomehooks/funcs/func_awesome_trace.c Thu Sep 16 15:49:47 2010
@@ -1,0 +1,70 @@
+/*
+ * Asterisk -- An open source telephony toolkit.
+ *
+ * Copyright (C) 2010, Digium, Inc.
+ *
+ * David Vossel <dvossel 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.
+ */
+
+/*! \file
+ *
+ * \brief Trace internal ast_frames on a channel.
+ *
+ * \author David Vossel <dvossel at digium.com>
+ *
+ * \ingroup functions
+ */
+
+#include "asterisk.h"
+
+ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+
+#include "asterisk/module.h"
+#include "asterisk/channel.h"
+#include "asterisk/pbx.h"
+#include "asterisk/awesomehook.h"
+
+static struct ast_frame *awesome_trace_event_cb(struct ast_channel *chan, struct ast_frame *frame, enum ast_awesomehook_event event, void *datastore)
+{
+
+	//todohere, print out the frame
+	return frame;
+}
+
+static int awesome_trace_helper(struct ast_channel *chan, const char *cmd, char *data, const char *value)
+{
+	ast_channel_lock(chan);
+	ast_awesomehook_attach(chan, awesome_trace_event_cb, NULL, NULL);
+	ast_channel_unlock(chan);
+
+	return 0;
+}
+
+static struct ast_custom_function awesome_trace_function = {
+	.name = "AWESOME_TRACE",
+	.write = awesome_trace_helper,
+};
+
+static int unload_module(void)
+{
+	return ast_custom_function_unregister(&awesome_trace_function);
+}
+
+static int load_module(void)
+{
+	int res = ast_custom_function_register(&awesome_trace_function);
+	return res ? AST_MODULE_LOAD_DECLINE : AST_MODULE_LOAD_SUCCESS;
+}
+
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Awesome Trace for internal ast_frame debugging.");
+

Propchange: team/dvossel/awesomehooks/funcs/func_awesome_trace.c
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/dvossel/awesomehooks/funcs/func_awesome_trace.c
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/dvossel/awesomehooks/funcs/func_awesome_trace.c
------------------------------------------------------------------------------
    svn:mime-type = text/plain




More information about the asterisk-commits mailing list