add a project-specific script to be used during release preparation
[asterisk-bristuff.git] / apps / app_cdr.c
blobe8f76a6022008f03246283ae6746c5aa436c1b7d
1 /*
2 * Asterisk -- An open source telephony toolkit.
4 * Copyright (C) 1999 - 2005, Digium, Inc.
6 * Martin Pycko <martinp@digium.com>
8 * See http://www.asterisk.org for more information about
9 * the Asterisk project. Please do not directly contact
10 * any of the maintainers of this project for assistance;
11 * the project provides a web site, mailing lists and IRC
12 * channels for your use.
14 * This program is free software, distributed under the terms of
15 * the GNU General Public License Version 2. See the LICENSE file
16 * at the top of the source tree.
19 /*! \file
21 * \brief Applications connected with CDR engine
23 * Martin Pycko <martinp@digium.com>
25 * \ingroup applications
28 #include "asterisk.h"
30 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
32 #include <sys/types.h>
33 #include <stdlib.h>
35 #include "asterisk/channel.h"
36 #include "asterisk/module.h"
37 #include "asterisk/pbx.h"
39 static char *nocdr_descrip =
40 " NoCDR(): This application will tell Asterisk not to maintain a CDR for the\n"
41 "current call.\n";
43 static char *nocdr_app = "NoCDR";
44 static char *nocdr_synopsis = "Tell Asterisk to not maintain a CDR for the current call";
47 static int nocdr_exec(struct ast_channel *chan, void *data)
49 struct ast_module_user *u;
51 u = ast_module_user_add(chan);
53 if (chan->cdr) {
54 ast_cdr_free(chan->cdr);
55 chan->cdr = NULL;
58 ast_module_user_remove(u);
60 return 0;
63 static int unload_module(void)
65 int res;
67 res = ast_unregister_application(nocdr_app);
69 ast_module_user_hangup_all();
71 return res;
74 static int load_module(void)
76 return ast_register_application(nocdr_app, nocdr_exec, nocdr_synopsis, nocdr_descrip);
79 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Tell Asterisk to not maintain a CDR for the current call");