[asterisk-commits] eliel: branch group/appdocsxml r145748 - /team/group/appdocsxml/funcs/func_cdr.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Oct 2 09:03:53 CDT 2008


Author: eliel
Date: Thu Oct  2 09:03:52 2008
New Revision: 145748

URL: http://svn.digium.com/view/asterisk?view=rev&rev=145748
Log:
Introduce CDR() function XML documentation.

Modified:
    team/group/appdocsxml/funcs/func_cdr.c

Modified: team/group/appdocsxml/funcs/func_cdr.c
URL: http://svn.digium.com/view/asterisk/team/group/appdocsxml/funcs/func_cdr.c?view=diff&rev=145748&r1=145747&r2=145748
==============================================================================
--- team/group/appdocsxml/funcs/func_cdr.c (original)
+++ team/group/appdocsxml/funcs/func_cdr.c Thu Oct  2 09:03:52 2008
@@ -35,6 +35,77 @@
 #include "asterisk/utils.h"
 #include "asterisk/app.h"
 #include "asterisk/cdr.h"
+
+/*** DOCUMENTATION
+	<function name="CDR" language="en_US">
+		<synopsis>
+			Gets or sets a CDR variable.
+		</synopsis>	
+		<syntax>
+			<parameter name="name" required="true">
+				<para>CDR field name:</para>
+				<para><literal>clid</literal>: Caller ID.</para>
+				<para><literal>lastdata</literal>: Last application arguments.</para>
+				<para><literal>disposition</literal>: ANSWERED, NO ANSWER, BUSY.</para>
+				<para><literal>src</literal>: Source.</para>
+				<para><literal>start</literal>:Time the call started.</para>
+				<para><literal>amaflags</literal>: DOCUMENTATION, BILL, IGNORE, etc.</para>
+				<para><literal>dst</literal>: Destination.</para>
+				<para><literal>answer</literal>: Time the call was answered.</para>
+				<para><literal>accountcode</literal>: The channel's account code.</para>
+				<para><literal>dcontext</literal>: Destination context.</para>
+				<para><literal>end</literal>: Time the call ended.</para>
+				<para><literal>uniqueid</literal>: The channel's unique id.</para>
+				<para><literal>dstchannel</literal>: Destination channel.</para>
+				<para><literal>duration</literal>: Duration of the call.</para>
+				<para><literal>userfield</literal>: The channel's user specified field.</para>
+				<para><literal>lastapp</literal>: Last application.</para>
+				<para><literal>billsec</literal>: Duration of the call once it was answered.</para>
+				<para><literal>channel</literal>: Channel name.</para>
+			</parameter>
+			<parameter name="options" required="false">
+				<optionlist>
+					<option name="l">
+						<para>Uses the most recent CDR on a channel with multiple records</para>
+					</option>
+					<option name="r">
+						<para>Searches the entire stack of CDRs on the channel.</para>
+					</option>
+					<option name="s">
+						<para>Skips any CDR's that are marked 'LOCKED' due to forkCDR() calls.
+						(on setting/writing CDR vars only)</para>
+					</option>
+					<option name="u">
+						<para>Retrieves the raw, unprocessed value.</para>
+						<para>For example, 'start', 'answer', and 'end' will be retrieved as epoch
+						values, when the <literal>u</literal> option is passed, but formatted as YYYY-MM-DD HH:MM:SS
+						otherwise.  Similarly, disposition and amaflags will return their raw
+						integral values.</para>
+					</option>
+				</optionlist>
+			</parameter>
+		</syntax>
+		<description>
+			<para>All of the CDR field names are read-only, except for <literal>accountcode</literal>,
+			<literal>userfield</literal>, and <literal>amaflags</literal>. You may, however, supply
+			a name not on the above list, and create your own variable, whose value can be changed
+			with this function, and this variable will be stored on the cdr.</para>
+			<note><para>For setting CDR values, the <literal>l</literal> flag does not apply to
+			setting the <literal>accountcode</literal>, <literal>userfield</literal>, or
+			<literal>amaflags</literal>.</para></note>
+			<para>Raw values for <literal>disposition</literal>:</para>
+			<para>1 = NO ANSWER</para>
+			<para>2 = BUSY</para>
+			<para>3 = FAILED</para>
+			<para>4 = ANSWERED</para>
+			<para>Raw values for <literal>amaflags</literal>:</para>
+			<para>1 = OMIT</para>
+			<para>2 = BILLING</para>
+			<para>3 = DOCUMENTATION</para>
+			<para>Example: exten => 1,1,Set(CDR(userfield)=test)</para>
+		</description>
+	</function>
+ ***/
 
 enum {
 	OPT_RECURSIVE = (1 << 0),
@@ -128,44 +199,8 @@
 
 static struct ast_custom_function cdr_function = {
 	.name = "CDR",
-	.synopsis = "Gets or sets a CDR variable",
-	.syntax = "CDR(<name>[,options])",
 	.read = cdr_read,
 	.write = cdr_write,
-	.desc =
-"Options:\n"
-"  'l' uses the most recent CDR on a channel with multiple records\n"
-"  'r' searches the entire stack of CDRs on the channel\n"
-"  's' skips any CDR's that are marked 'LOCKED' due to forkCDR() calls.\n"
-"      (on setting/writing CDR vars only)\n"
-"  'u' retrieves the raw, unprocessed value\n"
-"  For example, 'start', 'answer', and 'end' will be retrieved as epoch\n"
-"  values, when the 'u' option is passed, but formatted as YYYY-MM-DD HH:MM:SS\n"
-"  otherwise.  Similarly, disposition and amaflags will return their raw\n"
-"  integral values.\n"
-"  Here is a list of all the available cdr field names:\n"
-"    clid          lastdata       disposition\n"
-"    src           start          amaflags\n"
-"    dst           answer         accountcode\n"
-"    dcontext      end            uniqueid\n"
-"    dstchannel    duration       userfield\n"
-"    lastapp       billsec        channel\n"
-"  All of the above variables are read-only, except for accountcode,\n"
-"  userfield, and amaflags. You may, however,  supply\n"
-"  a name not on the above list, and create your own\n"
-"  variable, whose value can be changed with this function,\n"
-"  and this variable will be stored on the cdr.\n"
-"  For setting CDR values, the 'l' flag does not apply to\n"
-"  setting the accountcode, userfield, or amaflags.\n"
-"   raw values for disposition:\n"
-"       1 = NO ANSWER\n"
-"       2 = BUSY\n"
-"       3 = FAILED\n"
-"       4 = ANSWERED\n"
-"    raw values for amaflags:\n"
-"       1 = OMIT\n"
-"       2 = BILLING\n"
-"       3 = DOCUMENTATION\n",
 };
 
 static int unload_module(void)




More information about the asterisk-commits mailing list