2003-09-18 21:17:14 +00:00
|
|
|
/*
|
|
|
|
* Asterisk -- A telephony toolkit for Linux.
|
|
|
|
*
|
|
|
|
* Applictions connected with CDR engine
|
|
|
|
*
|
|
|
|
* Copyright (C) 2003, Digium
|
|
|
|
*
|
2003-09-18 21:52:01 +00:00
|
|
|
* Martin Pycko <martinp@digium.com>
|
2003-09-18 21:17:14 +00:00
|
|
|
*
|
|
|
|
* This program is free software, distributed under the terms of
|
|
|
|
* the GNU General Public License
|
|
|
|
*/
|
|
|
|
|
2003-09-29 20:13:54 +00:00
|
|
|
#include <sys/types.h>
|
2005-06-06 22:39:32 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#include "asterisk.h"
|
|
|
|
|
|
|
|
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
|
|
|
|
2005-04-21 06:02:45 +00:00
|
|
|
#include "asterisk/channel.h"
|
|
|
|
#include "asterisk/module.h"
|
|
|
|
#include "asterisk/pbx.h"
|
2003-09-18 21:17:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
static char *tdesc = "Make sure asterisk doesn't save CDR for a certain call";
|
|
|
|
|
|
|
|
static char *nocdr_descrip = "NoCDR(): makes sure there won't be any CDR written for a certain call";
|
|
|
|
static char *nocdr_app = "NoCDR";
|
|
|
|
static char *nocdr_synopsis = "Make sure asterisk doesn't save CDR for a certain call";
|
|
|
|
|
|
|
|
STANDARD_LOCAL_USER;
|
|
|
|
|
|
|
|
LOCAL_USER_DECL;
|
|
|
|
|
|
|
|
static int nocdr_exec(struct ast_channel *chan, void *data)
|
|
|
|
{
|
|
|
|
if (chan->cdr) {
|
2003-10-22 02:53:39 +00:00
|
|
|
ast_cdr_free(chan->cdr);
|
2003-09-18 21:17:14 +00:00
|
|
|
chan->cdr = NULL;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int unload_module(void)
|
|
|
|
{
|
|
|
|
STANDARD_HANGUP_LOCALUSERS;
|
|
|
|
return ast_unregister_application(nocdr_app);
|
|
|
|
}
|
|
|
|
|
|
|
|
int load_module(void)
|
|
|
|
{
|
|
|
|
return ast_register_application(nocdr_app, nocdr_exec, nocdr_synopsis, nocdr_descrip);
|
|
|
|
}
|
|
|
|
|
|
|
|
char *description(void)
|
|
|
|
{
|
|
|
|
return tdesc;
|
|
|
|
}
|
|
|
|
|
|
|
|
int usecount(void)
|
|
|
|
{
|
|
|
|
int res;
|
|
|
|
STANDARD_USECOUNT(res);
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
char *key()
|
|
|
|
{
|
|
|
|
return ASTERISK_GPL_KEY;
|
|
|
|
}
|