[asterisk-commits] branch kpfleming/chanfunc r9466 - /team/kpfleming/chanfunc/funcs/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Feb 10 19:01:22 MST 2006


Author: kpfleming
Date: Fri Feb 10 20:01:21 2006
New Revision: 9466

URL: http://svn.digium.com/view/asterisk?rev=9466&view=rev
Log:
add beginnings of new function

Added:
    team/kpfleming/chanfunc/funcs/func_channel.c
Modified:
    team/kpfleming/chanfunc/funcs/Makefile

Modified: team/kpfleming/chanfunc/funcs/Makefile
URL: http://svn.digium.com/view/asterisk/team/kpfleming/chanfunc/funcs/Makefile?rev=9466&r1=9465&r2=9466&view=diff
==============================================================================
--- team/kpfleming/chanfunc/funcs/Makefile (original)
+++ team/kpfleming/chanfunc/funcs/Makefile Fri Feb 10 20:01:21 2006
@@ -3,7 +3,7 @@
 # 
 # Makefile for dialplan functions
 #
-# Copyright (C) 2005, Digium
+# Copyright (C) 2005, 2006, Digium
 #
 # Kevin P. Fleming <kpfleming at digium.com>
 #
@@ -25,7 +25,8 @@
          func_language.o \
          func_moh.o \
          func_base64.o \
-         func_sha1.o
+         func_sha1.o \
+         func_channel.o
 
 AVAILABLE_FUNCS=$(filter-out $(BUILTINS),$(patsubst %.c,%.o,$(wildcard func*.c)))
 

Added: team/kpfleming/chanfunc/funcs/func_channel.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/chanfunc/funcs/func_channel.c?rev=9466&view=auto
==============================================================================
--- team/kpfleming/chanfunc/funcs/func_channel.c (added)
+++ team/kpfleming/chanfunc/funcs/func_channel.c Fri Feb 10 20:01:21 2006
@@ -1,0 +1,73 @@
+/*
+ * Asterisk -- An open source telephony toolkit.
+ *
+ * Copyright (C) 1999 - 2006, Digium, Inc.
+ *
+ * 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 Channel info dialplan function
+ * 
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+
+#include "asterisk.h"
+
+/* ASTERISK_FILE_VERSION(__FILE__, "$Revision:  $") */
+
+#include "asterisk/channel.h"
+#include "asterisk/pbx.h"
+#include "asterisk/logger.h"
+#include "asterisk/utils.h"
+#include "asterisk/app.h"
+
+static char *func_channel(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len) 
+{
+	ast_copy_string(buf, chan->language, len);
+
+	return buf;
+}
+
+#ifndef BUILTIN_FUNC
+static
+#endif
+struct ast_custom_function channel_function = {
+	.name = "CHANNEL",
+	.synopsis = "Gets various pieces of information about the channel.",
+	.syntax = "CHANNEL(item)",
+	.desc = "Gets various pieces of information about the channel.\n"
+        "Standard items (provided by all channel technologies) are:\n"
+        "	audionativeformat -	format (codec) used natively for audio\n"
+        "	videonativeformat -	format (codec) used nativel for video\n"
+        "	audioreadformat -	format currently being read\n"
+        "	audiowriteformat -	format currently being written\n"
+        "	tonezone -		zone for indications played\n"
+        "\n"
+        "Additional items may be available from the channel driver providing\n"
+        "the channel; see its documentation for details.\n"
+        "\n"
+        "Any item requested that is not available on the current channel will\n"
+        "return an empty string.\n",
+	.read = func_channel,
+};
+
+/*
+Local Variables:
+mode: C
+c-file-style: "linux"
+indent-tabs-mode: nil
+End:
+*/



More information about the asterisk-commits mailing list