2005-05-05 05:39:33 +00:00
|
|
|
/*
|
2005-09-14 20:46:50 +00:00
|
|
|
* Asterisk -- An open source telephony toolkit.
|
|
|
|
*
|
2006-02-12 04:28:58 +00:00
|
|
|
* Copyright (C) 1999-2006, Digium, Inc.
|
2005-05-05 05:39:33 +00:00
|
|
|
*
|
2005-05-05 12:48:52 +00:00
|
|
|
* Portions Copyright (C) 2005, Anthony Minessale II
|
2005-05-05 05:39:33 +00:00
|
|
|
*
|
2005-09-14 20:46:50 +00:00
|
|
|
* 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.
|
|
|
|
*
|
2005-05-05 05:39:33 +00:00
|
|
|
* This program is free software, distributed under the terms of
|
2005-09-14 20:46:50 +00:00
|
|
|
* the GNU General Public License Version 2. See the LICENSE file
|
|
|
|
* at the top of the source tree.
|
|
|
|
*/
|
|
|
|
|
2005-10-24 20:12:06 +00:00
|
|
|
/*! \file
|
2005-09-14 20:46:50 +00:00
|
|
|
*
|
2005-10-24 20:12:06 +00:00
|
|
|
* \brief Call Detail Record related dialplan functions
|
2005-12-30 21:18:06 +00:00
|
|
|
*
|
|
|
|
* \author Anthony Minessale II
|
2007-01-24 09:05:29 +00:00
|
|
|
*
|
|
|
|
* \ingroup functions
|
2005-05-05 05:39:33 +00:00
|
|
|
*/
|
|
|
|
|
2005-06-06 22:12:19 +00:00
|
|
|
#include "asterisk.h"
|
|
|
|
|
2006-02-11 03:14:05 +00:00
|
|
|
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
2005-06-06 22:12:19 +00:00
|
|
|
|
2006-02-11 03:14:05 +00:00
|
|
|
#include "asterisk/module.h"
|
2005-05-05 05:39:33 +00:00
|
|
|
#include "asterisk/channel.h"
|
|
|
|
#include "asterisk/pbx.h"
|
|
|
|
#include "asterisk/utils.h"
|
|
|
|
#include "asterisk/app.h"
|
|
|
|
#include "asterisk/cdr.h"
|
|
|
|
|
2008-11-01 21:10:07 +00:00
|
|
|
/*** 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>
|
|
|
|
<enumlist>
|
|
|
|
<enum name="clid">
|
|
|
|
<para>Caller ID.</para>
|
|
|
|
</enum>
|
|
|
|
<enum name="lastdata">
|
|
|
|
<para>Last application arguments.</para>
|
|
|
|
</enum>
|
|
|
|
<enum name="disposition">
|
|
|
|
<para>ANSWERED, NO ANSWER, BUSY.</para>
|
|
|
|
</enum>
|
|
|
|
<enum name="src">
|
|
|
|
<para>Source.</para>
|
|
|
|
</enum>
|
|
|
|
<enum name="start">
|
|
|
|
<para>Time the call started.</para>
|
|
|
|
</enum>
|
|
|
|
<enum name="amaflags">
|
|
|
|
<para>DOCUMENTATION, BILL, IGNORE, etc.</para>
|
|
|
|
</enum>
|
|
|
|
<enum name="dst">
|
|
|
|
<para>Destination.</para>
|
|
|
|
</enum>
|
|
|
|
<enum name="answer">
|
|
|
|
<para>Time the call was answered.</para>
|
|
|
|
</enum>
|
|
|
|
<enum name="accountcode">
|
|
|
|
<para>The channel's account code.</para>
|
|
|
|
</enum>
|
|
|
|
<enum name="dcontext">
|
|
|
|
<para>Destination context.</para>
|
|
|
|
</enum>
|
|
|
|
<enum name="end">
|
|
|
|
<para>Time the call ended.</para>
|
|
|
|
</enum>
|
|
|
|
<enum name="uniqueid">
|
|
|
|
<para>The channel's unique id.</para>
|
|
|
|
</enum>
|
|
|
|
<enum name="dstchannel">
|
|
|
|
<para>Destination channel.</para>
|
|
|
|
</enum>
|
|
|
|
<enum name="duration">
|
|
|
|
<para>Duration of the call.</para>
|
|
|
|
</enum>
|
|
|
|
<enum name="userfield">
|
|
|
|
<para>The channel's user specified field.</para>
|
|
|
|
</enum>
|
|
|
|
<enum name="lastapp">
|
|
|
|
<para>Last application.</para>
|
|
|
|
</enum>
|
|
|
|
<enum name="billsec">
|
|
|
|
<para>Duration of the call once it was answered.</para>
|
|
|
|
</enum>
|
|
|
|
<enum name="channel">
|
|
|
|
<para>Channel name.</para>
|
|
|
|
</enum>
|
|
|
|
</enumlist>
|
|
|
|
</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>
|
|
|
|
<enumlist>
|
|
|
|
<enum name="1">
|
|
|
|
<para>NO ANSWER</para>
|
|
|
|
</enum>
|
|
|
|
<enum name="2">
|
|
|
|
<para>BUSY</para>
|
|
|
|
</enum>
|
|
|
|
<enum name="3">
|
|
|
|
<para>FAILED</para>
|
|
|
|
</enum>
|
|
|
|
<enum name="4">
|
|
|
|
<para>ANSWERED</para>
|
|
|
|
</enum>
|
|
|
|
</enumlist>
|
|
|
|
<para>Raw values for <literal>amaflags</literal>:</para>
|
|
|
|
<enumlist>
|
|
|
|
<enum name="1">
|
|
|
|
<para>OMIT</para>
|
|
|
|
</enum>
|
|
|
|
<enum name="2">
|
|
|
|
<para>BILLING</para>
|
|
|
|
</enum>
|
|
|
|
<enum name="3">
|
|
|
|
<para>DOCUMENTATION</para>
|
|
|
|
</enum>
|
|
|
|
</enumlist>
|
|
|
|
<para>Example: exten => 1,1,Set(CDR(userfield)=test)</para>
|
|
|
|
</description>
|
|
|
|
</function>
|
|
|
|
***/
|
|
|
|
|
2009-06-15 17:34:30 +00:00
|
|
|
enum cdr_option_flags {
|
2006-01-11 19:52:29 +00:00
|
|
|
OPT_RECURSIVE = (1 << 0),
|
2006-02-23 23:12:41 +00:00
|
|
|
OPT_UNPARSED = (1 << 1),
|
2006-08-17 16:29:44 +00:00
|
|
|
OPT_LAST = (1 << 2),
|
Merged revisions 122046 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r122046 | murf | 2008-06-12 07:47:34 -0600 (Thu, 12 Jun 2008) | 37 lines
(closes issue #10668)
Reported by: arkadia
Tested by: murf, arkadia
Options added to forkCDR() app and the CDR() func to
remove some roadblocks for CDR applications.
The "show application ForkCDR" output was upgraded
to more fully explain the inner workings of forkCDR.
The A option was added to forkCDR to force the
CDR system to NOT change the disposition on the
original CDR, after the fork. This involves
ast_cdr_answer, _busy, _failed, and so on.
The T option was added to forkCDR to force
obedience of the cdr LOCKED flag in the
ast_cdr_end, all the disposition changing
funcs (ast_cdr_answer, etc), and in the
ast_cdr_setvar func.
The CHANGES file was updated to explain ALL
the new options added to satisfy this bug report
(and some requests made verbally and via
email, irc, etc, over the past months/year)
The 's' option was added to the CDR() func,
to force it to skip LOCKED cdr's in the
chain.
Again, the new options should be totally transparent
to existing apps! Current behavior of CDR,
forkCDR, and the rest of the CDR system should
not change one little bit. Until you add the
new options, at least!
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@122091 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-12 14:28:01 +00:00
|
|
|
OPT_SKIPLOCKED = (1 << 3),
|
2009-06-15 17:34:30 +00:00
|
|
|
};
|
2006-01-11 19:52:29 +00:00
|
|
|
|
|
|
|
AST_APP_OPTIONS(cdr_func_options, {
|
2006-08-17 16:29:44 +00:00
|
|
|
AST_APP_OPTION('l', OPT_LAST),
|
2006-01-11 19:52:29 +00:00
|
|
|
AST_APP_OPTION('r', OPT_RECURSIVE),
|
Merged revisions 122046 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r122046 | murf | 2008-06-12 07:47:34 -0600 (Thu, 12 Jun 2008) | 37 lines
(closes issue #10668)
Reported by: arkadia
Tested by: murf, arkadia
Options added to forkCDR() app and the CDR() func to
remove some roadblocks for CDR applications.
The "show application ForkCDR" output was upgraded
to more fully explain the inner workings of forkCDR.
The A option was added to forkCDR to force the
CDR system to NOT change the disposition on the
original CDR, after the fork. This involves
ast_cdr_answer, _busy, _failed, and so on.
The T option was added to forkCDR to force
obedience of the cdr LOCKED flag in the
ast_cdr_end, all the disposition changing
funcs (ast_cdr_answer, etc), and in the
ast_cdr_setvar func.
The CHANGES file was updated to explain ALL
the new options added to satisfy this bug report
(and some requests made verbally and via
email, irc, etc, over the past months/year)
The 's' option was added to the CDR() func,
to force it to skip LOCKED cdr's in the
chain.
Again, the new options should be totally transparent
to existing apps! Current behavior of CDR,
forkCDR, and the rest of the CDR system should
not change one little bit. Until you add the
new options, at least!
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@122091 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-12 14:28:01 +00:00
|
|
|
AST_APP_OPTION('s', OPT_SKIPLOCKED),
|
2006-02-23 23:12:41 +00:00
|
|
|
AST_APP_OPTION('u', OPT_UNPARSED),
|
2006-01-11 19:52:29 +00:00
|
|
|
});
|
|
|
|
|
2007-01-06 00:13:33 +00:00
|
|
|
static int cdr_read(struct ast_channel *chan, const char *cmd, char *parse,
|
2006-02-12 04:28:58 +00:00
|
|
|
char *buf, size_t len)
|
2005-05-05 05:39:33 +00:00
|
|
|
{
|
|
|
|
char *ret;
|
2006-02-12 04:28:58 +00:00
|
|
|
struct ast_flags flags = { 0 };
|
2007-04-19 02:51:21 +00:00
|
|
|
struct ast_cdr *cdr = chan ? chan->cdr : NULL;
|
2006-01-11 19:52:29 +00:00
|
|
|
AST_DECLARE_APP_ARGS(args,
|
2006-02-12 04:28:58 +00:00
|
|
|
AST_APP_ARG(variable);
|
|
|
|
AST_APP_ARG(options);
|
2006-01-11 19:52:29 +00:00
|
|
|
);
|
2005-05-05 05:39:33 +00:00
|
|
|
|
2006-02-12 04:28:58 +00:00
|
|
|
if (ast_strlen_zero(parse))
|
|
|
|
return -1;
|
2005-05-05 05:39:33 +00:00
|
|
|
|
2006-08-17 16:29:44 +00:00
|
|
|
if (!cdr)
|
2006-02-12 04:28:58 +00:00
|
|
|
return -1;
|
2005-05-05 05:39:33 +00:00
|
|
|
|
2006-01-11 19:52:29 +00:00
|
|
|
AST_STANDARD_APP_ARGS(args, parse);
|
2006-02-12 04:28:58 +00:00
|
|
|
|
|
|
|
if (!ast_strlen_zero(args.options))
|
2006-01-11 19:52:29 +00:00
|
|
|
ast_app_parse_options(cdr_func_options, &flags, NULL, args.options);
|
2005-05-05 05:39:33 +00:00
|
|
|
|
2006-08-17 16:29:44 +00:00
|
|
|
if (ast_test_flag(&flags, OPT_LAST))
|
|
|
|
while (cdr->next)
|
|
|
|
cdr = cdr->next;
|
|
|
|
|
Merged revisions 122046 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r122046 | murf | 2008-06-12 07:47:34 -0600 (Thu, 12 Jun 2008) | 37 lines
(closes issue #10668)
Reported by: arkadia
Tested by: murf, arkadia
Options added to forkCDR() app and the CDR() func to
remove some roadblocks for CDR applications.
The "show application ForkCDR" output was upgraded
to more fully explain the inner workings of forkCDR.
The A option was added to forkCDR to force the
CDR system to NOT change the disposition on the
original CDR, after the fork. This involves
ast_cdr_answer, _busy, _failed, and so on.
The T option was added to forkCDR to force
obedience of the cdr LOCKED flag in the
ast_cdr_end, all the disposition changing
funcs (ast_cdr_answer, etc), and in the
ast_cdr_setvar func.
The CHANGES file was updated to explain ALL
the new options added to satisfy this bug report
(and some requests made verbally and via
email, irc, etc, over the past months/year)
The 's' option was added to the CDR() func,
to force it to skip LOCKED cdr's in the
chain.
Again, the new options should be totally transparent
to existing apps! Current behavior of CDR,
forkCDR, and the rest of the CDR system should
not change one little bit. Until you add the
new options, at least!
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@122091 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-12 14:28:01 +00:00
|
|
|
if (ast_test_flag(&flags, OPT_SKIPLOCKED))
|
|
|
|
while (ast_test_flag(cdr, AST_CDR_FLAG_LOCKED) && cdr->next)
|
|
|
|
cdr = cdr->next;
|
|
|
|
|
2006-08-17 16:29:44 +00:00
|
|
|
ast_cdr_getvar(cdr, args.variable, &ret, buf, len,
|
2006-02-23 23:12:41 +00:00
|
|
|
ast_test_flag(&flags, OPT_RECURSIVE),
|
|
|
|
ast_test_flag(&flags, OPT_UNPARSED));
|
2006-02-12 04:28:58 +00:00
|
|
|
|
2008-10-06 21:09:05 +00:00
|
|
|
return ret ? 0 : -1;
|
2005-05-05 05:39:33 +00:00
|
|
|
}
|
|
|
|
|
2007-01-06 00:13:33 +00:00
|
|
|
static int cdr_write(struct ast_channel *chan, const char *cmd, char *parse,
|
2006-02-12 04:28:58 +00:00
|
|
|
const char *value)
|
2005-05-05 05:39:33 +00:00
|
|
|
{
|
Merged revisions 122046 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r122046 | murf | 2008-06-12 07:47:34 -0600 (Thu, 12 Jun 2008) | 37 lines
(closes issue #10668)
Reported by: arkadia
Tested by: murf, arkadia
Options added to forkCDR() app and the CDR() func to
remove some roadblocks for CDR applications.
The "show application ForkCDR" output was upgraded
to more fully explain the inner workings of forkCDR.
The A option was added to forkCDR to force the
CDR system to NOT change the disposition on the
original CDR, after the fork. This involves
ast_cdr_answer, _busy, _failed, and so on.
The T option was added to forkCDR to force
obedience of the cdr LOCKED flag in the
ast_cdr_end, all the disposition changing
funcs (ast_cdr_answer, etc), and in the
ast_cdr_setvar func.
The CHANGES file was updated to explain ALL
the new options added to satisfy this bug report
(and some requests made verbally and via
email, irc, etc, over the past months/year)
The 's' option was added to the CDR() func,
to force it to skip LOCKED cdr's in the
chain.
Again, the new options should be totally transparent
to existing apps! Current behavior of CDR,
forkCDR, and the rest of the CDR system should
not change one little bit. Until you add the
new options, at least!
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@122091 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-12 14:28:01 +00:00
|
|
|
struct ast_cdr *cdr = chan ? chan->cdr : NULL;
|
2006-02-12 04:28:58 +00:00
|
|
|
struct ast_flags flags = { 0 };
|
|
|
|
AST_DECLARE_APP_ARGS(args,
|
|
|
|
AST_APP_ARG(variable);
|
|
|
|
AST_APP_ARG(options);
|
|
|
|
);
|
2005-05-05 05:39:33 +00:00
|
|
|
|
2007-04-19 02:51:21 +00:00
|
|
|
if (ast_strlen_zero(parse) || !value || !chan)
|
2006-02-12 04:28:58 +00:00
|
|
|
return -1;
|
2006-01-11 19:52:29 +00:00
|
|
|
|
Merged revisions 122046 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r122046 | murf | 2008-06-12 07:47:34 -0600 (Thu, 12 Jun 2008) | 37 lines
(closes issue #10668)
Reported by: arkadia
Tested by: murf, arkadia
Options added to forkCDR() app and the CDR() func to
remove some roadblocks for CDR applications.
The "show application ForkCDR" output was upgraded
to more fully explain the inner workings of forkCDR.
The A option was added to forkCDR to force the
CDR system to NOT change the disposition on the
original CDR, after the fork. This involves
ast_cdr_answer, _busy, _failed, and so on.
The T option was added to forkCDR to force
obedience of the cdr LOCKED flag in the
ast_cdr_end, all the disposition changing
funcs (ast_cdr_answer, etc), and in the
ast_cdr_setvar func.
The CHANGES file was updated to explain ALL
the new options added to satisfy this bug report
(and some requests made verbally and via
email, irc, etc, over the past months/year)
The 's' option was added to the CDR() func,
to force it to skip LOCKED cdr's in the
chain.
Again, the new options should be totally transparent
to existing apps! Current behavior of CDR,
forkCDR, and the rest of the CDR system should
not change one little bit. Until you add the
new options, at least!
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@122091 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-12 14:28:01 +00:00
|
|
|
if (!cdr)
|
|
|
|
return -1;
|
|
|
|
|
2006-01-11 19:52:29 +00:00
|
|
|
AST_STANDARD_APP_ARGS(args, parse);
|
2005-05-05 05:39:33 +00:00
|
|
|
|
2006-02-12 04:28:58 +00:00
|
|
|
if (!ast_strlen_zero(args.options))
|
2006-01-11 19:52:29 +00:00
|
|
|
ast_app_parse_options(cdr_func_options, &flags, NULL, args.options);
|
2005-05-05 05:39:33 +00:00
|
|
|
|
Merged revisions 122046 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r122046 | murf | 2008-06-12 07:47:34 -0600 (Thu, 12 Jun 2008) | 37 lines
(closes issue #10668)
Reported by: arkadia
Tested by: murf, arkadia
Options added to forkCDR() app and the CDR() func to
remove some roadblocks for CDR applications.
The "show application ForkCDR" output was upgraded
to more fully explain the inner workings of forkCDR.
The A option was added to forkCDR to force the
CDR system to NOT change the disposition on the
original CDR, after the fork. This involves
ast_cdr_answer, _busy, _failed, and so on.
The T option was added to forkCDR to force
obedience of the cdr LOCKED flag in the
ast_cdr_end, all the disposition changing
funcs (ast_cdr_answer, etc), and in the
ast_cdr_setvar func.
The CHANGES file was updated to explain ALL
the new options added to satisfy this bug report
(and some requests made verbally and via
email, irc, etc, over the past months/year)
The 's' option was added to the CDR() func,
to force it to skip LOCKED cdr's in the
chain.
Again, the new options should be totally transparent
to existing apps! Current behavior of CDR,
forkCDR, and the rest of the CDR system should
not change one little bit. Until you add the
new options, at least!
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@122091 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-12 14:28:01 +00:00
|
|
|
if (ast_test_flag(&flags, OPT_LAST))
|
|
|
|
while (cdr->next)
|
|
|
|
cdr = cdr->next;
|
|
|
|
|
|
|
|
if (!strcasecmp(args.variable, "accountcode")) /* the 'l' flag doesn't apply to setting the accountcode, userfield, or amaflags */
|
2005-07-15 23:24:51 +00:00
|
|
|
ast_cdr_setaccount(chan, value);
|
2009-06-26 15:28:53 +00:00
|
|
|
else if (!strcasecmp(args.variable, "peeraccount"))
|
|
|
|
ast_cdr_setpeeraccount(chan, value);
|
2006-01-11 19:52:29 +00:00
|
|
|
else if (!strcasecmp(args.variable, "userfield"))
|
2005-07-15 23:24:51 +00:00
|
|
|
ast_cdr_setuserfield(chan, value);
|
2006-05-15 19:46:26 +00:00
|
|
|
else if (!strcasecmp(args.variable, "amaflags"))
|
2006-05-16 03:18:22 +00:00
|
|
|
ast_cdr_setamaflags(chan, value);
|
Merged revisions 122046 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r122046 | murf | 2008-06-12 07:47:34 -0600 (Thu, 12 Jun 2008) | 37 lines
(closes issue #10668)
Reported by: arkadia
Tested by: murf, arkadia
Options added to forkCDR() app and the CDR() func to
remove some roadblocks for CDR applications.
The "show application ForkCDR" output was upgraded
to more fully explain the inner workings of forkCDR.
The A option was added to forkCDR to force the
CDR system to NOT change the disposition on the
original CDR, after the fork. This involves
ast_cdr_answer, _busy, _failed, and so on.
The T option was added to forkCDR to force
obedience of the cdr LOCKED flag in the
ast_cdr_end, all the disposition changing
funcs (ast_cdr_answer, etc), and in the
ast_cdr_setvar func.
The CHANGES file was updated to explain ALL
the new options added to satisfy this bug report
(and some requests made verbally and via
email, irc, etc, over the past months/year)
The 's' option was added to the CDR() func,
to force it to skip LOCKED cdr's in the
chain.
Again, the new options should be totally transparent
to existing apps! Current behavior of CDR,
forkCDR, and the rest of the CDR system should
not change one little bit. Until you add the
new options, at least!
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@122091 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-12 14:28:01 +00:00
|
|
|
else
|
|
|
|
ast_cdr_setvar(cdr, args.variable, value, ast_test_flag(&flags, OPT_RECURSIVE));
|
2006-02-23 23:12:41 +00:00
|
|
|
/* No need to worry about the u flag, as all fields for which setting
|
|
|
|
* 'u' would do anything are marked as readonly. */
|
2006-02-12 04:28:58 +00:00
|
|
|
|
|
|
|
return 0;
|
2005-05-05 05:39:33 +00:00
|
|
|
}
|
|
|
|
|
2006-02-11 03:14:05 +00:00
|
|
|
static struct ast_custom_function cdr_function = {
|
2005-05-05 05:39:33 +00:00
|
|
|
.name = "CDR",
|
2006-02-11 03:14:05 +00:00
|
|
|
.read = cdr_read,
|
|
|
|
.write = cdr_write,
|
2005-05-05 05:39:33 +00:00
|
|
|
};
|
|
|
|
|
2006-08-21 02:11:39 +00:00
|
|
|
static int unload_module(void)
|
2006-02-11 03:14:05 +00:00
|
|
|
{
|
2006-02-12 04:28:58 +00:00
|
|
|
return ast_custom_function_unregister(&cdr_function);
|
2006-02-11 03:14:05 +00:00
|
|
|
}
|
|
|
|
|
2006-08-21 02:11:39 +00:00
|
|
|
static int load_module(void)
|
2006-02-11 03:14:05 +00:00
|
|
|
{
|
2006-02-12 04:28:58 +00:00
|
|
|
return ast_custom_function_register(&cdr_function);
|
2006-02-11 03:14:05 +00:00
|
|
|
}
|
|
|
|
|
2007-05-30 05:17:09 +00:00
|
|
|
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Call Detail Record (CDR) dialplan function");
|