aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-09-08 21:52:45 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-09-08 21:52:45 +0000
commit881d71013d450989154b3ec5cad111bb73932a4a (patch)
treeea8fdfb5dec75701dddccfb7be801277d75609ac
parentb80fa4ea237e397f9a8978d200bebb400f244458 (diff)
Add ResetCDR application (with mods) (bug #235)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1488 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-xpbx.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/pbx.c b/pbx.c
index 92289918a..5a99f5c18 100755
--- a/pbx.c
+++ b/pbx.c
@@ -20,6 +20,7 @@
#include <asterisk/file.h>
#include <asterisk/callerid.h>
#include <asterisk/cdr.h>
+#include <asterisk/config.h>
#include <asterisk/term.h>
#include <asterisk/manager.h>
#include <asterisk/ast_expr.h>
@@ -156,6 +157,7 @@ static int pbx_builtin_rtimeout(struct ast_channel *, void *);
static int pbx_builtin_atimeout(struct ast_channel *, void *);
static int pbx_builtin_wait(struct ast_channel *, void *);
static int pbx_builtin_setlanguage(struct ast_channel *, void *);
+static int pbx_builtin_resetcdr(struct ast_channel *, void *);
static int pbx_builtin_setaccount(struct ast_channel *, void *);
static int pbx_builtin_ringing(struct ast_channel *, void *);
static int pbx_builtin_congestion(struct ast_channel *, void *);
@@ -263,6 +265,12 @@ static struct pbx_builtin {
"which has no first step, the PBX will treat it as though the user dialed an\n"
"invalid extension.\n" },
+ { "ResetCDR", pbx_builtin_resetcdr,
+"Resets the Call Data Record",
+" ResetCDR([options]): Causes the Call Data Record to be reset, optionally\n"
+"storing the current CDR before zeroing it out (if 'w' option is specifed).\n"
+"record WILL be stored. Always returns 0.\n" },
+
{ "ResponseTimeout", pbx_builtin_rtimeout,
"Set maximum timeout awaiting response",
" ResponseTimeout(seconds): Set the maximum amount of time permitted after\n"
@@ -4066,6 +4074,16 @@ static int pbx_builtin_setlanguage(struct ast_channel *chan, void *data)
return 0;
}
+static int pbx_builtin_resetcdr(struct ast_channel *chan, void *data)
+{
+ /* Reset the CDR as specified */
+ if (data)
+ ast_cdr_reset(chan->cdr, strchr((char *)data, 'w') ? 1 : 0);
+ else
+ ast_cdr_reset(chan->cdr, 0);
+ return 0;
+}
+
static int pbx_builtin_setaccount(struct ast_channel *chan, void *data)
{
/* Copy the language as specified */