2003-09-18 21:17:14 +00:00
|
|
|
/*
|
2005-09-14 20:46:50 +00:00
|
|
|
* Asterisk -- An open source telephony toolkit.
|
2003-09-18 21:17:14 +00:00
|
|
|
*
|
2005-09-14 20:46:50 +00:00
|
|
|
* Copyright (C) 1999 - 2005, Digium, Inc.
|
2003-09-18 21:17:14 +00:00
|
|
|
*
|
2003-09-18 21:52:01 +00:00
|
|
|
* Martin Pycko <martinp@digium.com>
|
2003-09-18 21:17:14 +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.
|
|
|
|
*
|
2003-09-18 21:17:14 +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
|
|
|
|
* \brief Applications connected with CDR engine
|
2005-09-14 20:46:50 +00:00
|
|
|
*
|
2005-11-06 15:09:47 +00:00
|
|
|
* \ingroup applications
|
2003-09-18 21:17:14 +00:00
|
|
|
*/
|
|
|
|
|
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
|
|
|
|
|
|
|
|
2005-11-10 20:56:45 +00:00
|
|
|
static char *tdesc = "Tell Asterisk to not maintain a CDR for the current call";
|
|
|
|
|
|
|
|
static char *nocdr_descrip =
|
|
|
|
" NoCDR(): This application will tell Asterisk not to maintain a CDR for the\n"
|
|
|
|
"current call.\n";
|
2003-09-18 21:17:14 +00:00
|
|
|
|
|
|
|
static char *nocdr_app = "NoCDR";
|
2005-11-10 20:56:45 +00:00
|
|
|
static char *nocdr_synopsis = "Tell Asterisk to not maintain a CDR for the current call";
|
2003-09-18 21:17:14 +00:00
|
|
|
|
|
|
|
STANDARD_LOCAL_USER;
|
|
|
|
|
|
|
|
LOCAL_USER_DECL;
|
|
|
|
|
|
|
|
static int nocdr_exec(struct ast_channel *chan, void *data)
|
|
|
|
{
|
2005-10-19 18:19:02 +00:00
|
|
|
struct localuser *u;
|
|
|
|
|
|
|
|
LOCAL_USER_ADD(u);
|
|
|
|
|
2003-09-18 21:17:14 +00:00
|
|
|
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;
|
|
|
|
}
|
2005-10-19 18:19:02 +00:00
|
|
|
|
|
|
|
LOCAL_USER_REMOVE(u);
|
|
|
|
|
2003-09-18 21:17:14 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int unload_module(void)
|
|
|
|
{
|
2005-10-18 22:52:21 +00:00
|
|
|
int res;
|
|
|
|
|
|
|
|
res = ast_unregister_application(nocdr_app);
|
|
|
|
|
2003-09-18 21:17:14 +00:00
|
|
|
STANDARD_HANGUP_LOCALUSERS;
|
2005-10-18 22:52:21 +00:00
|
|
|
|
|
|
|
return res;
|
2003-09-18 21:17:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|