Add XML documentation for the ForkCDR() application.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@154225 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.6.2
Eliel C. Sardanons 17 years ago
parent f349f18eaa
commit a57a3cbf19

@ -37,91 +37,110 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/app.h" #include "asterisk/app.h"
#include "asterisk/module.h" #include "asterisk/module.h"
static char *app = "ForkCDR"; /*** DOCUMENTATION
static char *synopsis = <application name="ForkCDR" language="en_US">
"Forks the Call Data Record"; <synopsis>
static char *descrip = Forks the Call Data Record.
" ForkCDR([options]): Causes the Call Data Record to fork an additional\n" </synopsis>
"cdr record starting from the time of the fork call. This new cdr record will\n" <syntax>
"be linked to end of the list of cdr records attached to the channel. The original CDR is\n" <parameter name="options">
"has a LOCKED flag set, which forces most cdr operations to skip it, except\n" <optionlist>
"for the functions that set the answer and end times, which ignore the LOCKED\n" <option name="a">
"flag. This allows all the cdr records in the channel to be 'ended' together\n" <para>Update the answer time on the NEW CDR just after it's been inited.
"when the channel is closed.\n" The new CDR may have been answered already, the reset that forkcdr does
"The CDR() func (when setting CDR values) normally ignores the LOCKED flag also,\n" will erase the answer time. This will bring it back, but the answer time
"but has options to vary its behavior. The 'T' option (described below), can\n" will be a copy of the fork/start time. It will only do this if the initial
"override this behavior, but beware the risks.\n" cdr was indeed already answered.</para>
"\n" </option>
"Detailed Behavior Description:\n" <option name="A">
"First, this app finds the last cdr record in the list, and makes\n" <para>Lock the original CDR against the answer time being updated. This
"a copy of it. This new copy will be the newly forked cdr record.\n" will allow the disposition on the original CDR to remain the same.</para>
"Next, this new record is linked to the end of the cdr record list.\n" </option>
"Next, The new cdr record is RESET (unless you use an option to prevent this)\n" <option name="d">
"This means that:\n" <para>Copy the disposition forward from the old cdr, after the init.</para>
" 1. All flags are unset on the cdr record\n" </option>
" 2. the start, end, and answer times are all set to zero.\n" <option name="D">
" 3. the billsec and duration fields are set to zero.\n" <para>Clear the <literal>dstchannel</literal> on the new CDR after
" 4. the start time is set to the current time.\n" reset.</para>
" 5. the disposition is set to NULL.\n" </option>
"Next, unless you specified the 'v' option, all variables will be\n" <option name="e">
"removed from the original cdr record. Thus, the 'v' option allows\n" <para>End the original CDR. Do this after all the necc. data.</para>
"any CDR variables to be replicated to all new forked cdr records.\n" </option>
"Without the 'v' option, the variables on the original are effectively\n" <option name="r">
"moved to the new forked cdr record.\n" <para>Do <emphasis>NOT</emphasis> reset the new cdr.</para>
"Next, if the 's' option is set, the provided variable and value\n" </option>
"are set on the original cdr record.\n" <option name="s(name=val)">
"Next, if the 'a' option is given, and the original cdr record has an\n" <para>Set the CDR var <replaceable>name</replaceable> in the original CDR,
"answer time set, then the new forked cdr record will have its answer\n" with value <replaceable>val</replaceable></para>.
"time set to its start time. If the old answer time were carried forward,\n" </option>
"the answer time would be earlier than the start time, giving strange\n" <option name="T">
"duration and billsec times.\n" <para>Mark the original CDR with a DONT_TOUCH flag. setvar, answer, and end
"Next, if the 'd' option was specified, the disposition is copied from\n" cdr funcs will obey this flag; normally they don't honor the LOCKED flag
"the original cdr record to the new forked cdr.\n" set on the original CDR record.</para>
"Next, if the 'D' option was specified, the destination channel field\n" <note><para>Using this flag may cause CDR's not to have their end times
"in the new forked CDR is erased.\n" updated! It is suggested that if you specify this flag, you might wish
"Next, if the 'e' option was specified, the 'end' time for the original\n" to use the <literal>e</literal> flag as well!.</para></note>
"cdr record is set to the current time. Future hang-up or ending events\n" </option>
"will not override this time stamp.\n" <option name="v">
"Next, If the 'A' option is specified, the original cdr record will have\n" <para>When the new CDR is forked, it gets a copy of the vars attached to
"it ANS_LOCKED flag set, which prevent future answer events\n" the current CDR. The vars attached to the original CDR are removed unless
"from updating the original cdr record's disposition. Normally, an\n" this option is specified.</para>
"'ANSWERED' event would mark all cdr records in the chain as 'ANSWERED'.\n" </option>
"Next, if the 'T' option is specified, the original cdr record will have\n" </optionlist>
"its 'DONT_TOUCH' flag set, which will force the cdr_answer, cdr_end, and\n" </parameter>
"cdr_setvar functions to leave that cdr record alone.\n" </syntax>
"And, last but not least, the original cdr record has its LOCKED flag\n" <description>
"set. Almost all internal CDR functions (except for the funcs that set\n" <para> Causes the Call Data Record to fork an additional cdr record starting from the time
"the end, and answer times, and set a variable) will honor this flag\n" of the fork call. This new cdr record will be linked to end of the list of cdr records attached
"and leave a LOCKED cdr record alone.\n" to the channel. The original CDR has a LOCKED flag set, which forces most cdr operations to skip
"This means that the newly created forked cdr record will affected\n" it, except for the functions that set the answer and end times, which ignore the LOCKED flag. This
"by events transpiring within Asterisk, with the previously noted\n" allows all the cdr records in the channel to be 'ended' together when the channel is closed.</para>
"exceptions.\n" <para>The CDR() func (when setting CDR values) normally ignores the LOCKED flag also, but has options
" Options:\n" to vary its behavior. The 'T' option (described below), can override this behavior, but beware
" a - update the answer time on the NEW CDR just after it's been inited..\n" the risks.</para>
" The new CDR may have been answered already, the reset that forkcdr.\n" <para>First, this app finds the last cdr record in the list, and makes a copy of it. This new copy
" does will erase the answer time. This will bring it back, but\n" will be the newly forked cdr record. Next, this new record is linked to the end of the cdr record list.
" the answer time will be a copy of the fork/start time. It will.\n" Next, The new cdr record is RESET (unless you use an option to prevent this)</para>
" only do this if the initial cdr was indeed already answered..\n" <para>This means that:</para>
" A - Lock the original CDR against the answer time being updated.\n" <para> 1. All flags are unset on the cdr record</para>
" This will allow the disposition on the original CDR to remain the same.\n" <para> 2. the start, end, and answer times are all set to zero.</para>
" d - Copy the disposition forward from the old cdr, after the .\n" <para> 3. the billsec and duration fields are set to zero.</para>
" init..\n" <para> 4. the start time is set to the current time.</para>
" D - Clear the dstchannel on the new CDR after reset..\n" <para> 5. the disposition is set to NULL.</para>
" e - end the original CDR. Do this after all the necc. data.\n" <para>Next, unless you specified the <literal>v</literal> option, all variables will be removed from
" is copied from the original CDR to the new forked CDR..\n" the original cdr record. Thus, the <literal>v</literal> option allows any CDR variables to be replicated
" R - do NOT reset the new cdr..\n" to all new forked cdr records. Without the <literal>v</literal> option, the variables on the original
" s(name=val) - Set the CDR var 'name' in the original CDR, with value.\n" are effectively moved to the new forked cdr record.</para>
" 'val'.\n" <para>Next, if the <literal>s</literal> option is set, the provided variable and value are set on the
" T - Mark the original CDR with a DONT_TOUCH flag. setvar, answer, and end\n" original cdr record.</para>
" cdr funcs will obey this flag; normally they don't honor the LOCKED\n" <para>Next, if the <literal>a</literal> option is given, and the original cdr record has an answer time
" flag set on the original CDR record.\n" set, then the new forked cdr record will have its answer time set to its start time. If the old answer
" Beware-- using this flag may cause CDR's not to have their end times\n" time were carried forward, the answer time would be earlier than the start time, giving strange
" updated! It is suggested that if you specify this flag, you might\n" duration and billsec times.</para>
" wish to use the 'e' flag as well!\n" <para>If the <literal>d</literal> option was specified, the disposition is copied from
" v - When the new CDR is forked, it gets a copy of the vars attached\n" the original cdr record to the new forked cdr. If the <literal>D</literal> option was specified,
" to the current CDR. The vars attached to the original CDR are removed\n" the destination channel field in the new forked CDR is erased. If the <literal>e</literal> option
" unless this option is specified.\n"; was specified, the 'end' time for the original cdr record is set to the current time. Future hang-up or
ending events will not override this time stamp. If the <literal>A</literal> option is specified,
the original cdr record will have it ANS_LOCKED flag set, which prevent future answer events from updating
the original cdr record's disposition. Normally, an <literal>ANSWERED</literal> event would mark all cdr
records in the chain as <literal>ANSWERED</literal>. If the <literal>T</literal> option is specified,
the original cdr record will have its <literal>DONT_TOUCH</literal> flag set, which will force the
cdr_answer, cdr_end, and cdr_setvar functions to leave that cdr record alone.</para>
<para>And, last but not least, the original cdr record has its LOCKED flag set. Almost all internal
CDR functions (except for the funcs that set the end, and answer times, and set a variable) will honor
this flag and leave a LOCKED cdr record alone. This means that the newly created forked cdr record
will be affected by events transpiring within Asterisk, with the previously noted exceptions.</para>
</description>
<see-also>
<ref type="function">CDR</ref>
<ref type="application">NoCDR</ref>
<ref type="application">ResetCDR</ref>
</see-also>
</application>
***/
static char *app = "ForkCDR";
enum { enum {
OPT_SETANS = (1 << 0), OPT_SETANS = (1 << 0),
@ -247,7 +266,7 @@ static int unload_module(void)
static int load_module(void) static int load_module(void)
{ {
return ast_register_application(app, forkcdr_exec, synopsis, descrip); return ast_register_application_xml(app, forkcdr_exec);
} }
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Fork The CDR into 2 separate entities"); AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Fork The CDR into 2 separate entities");

Loading…
Cancel
Save