diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-09-08 21:52:45 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-09-08 21:52:45 +0000 |
commit | 881d71013d450989154b3ec5cad111bb73932a4a (patch) | |
tree | ea8fdfb5dec75701dddccfb7be801277d75609ac | |
parent | b80fa4ea237e397f9a8978d200bebb400f244458 (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-x | pbx.c | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -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 */ |