add author doxygen tag (issue #8241, kshumard)
[asterisk/asterisk.git] / apps / app_cdr.c
1 /*
2  * Asterisk -- An open source telephony toolkit.
3  *
4  * Copyright (C) 1999 - 2005, Digium, Inc.
5  *
6  * Martin Pycko <martinp@digium.com>
7  *
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.
13  *
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.
17  */
18
19 /*! \file
20  * 
21  * \brief Applications connected with CDR engine
22  *
23  * \author Martin Pycko <martinp@digium.com>
24  *
25  * \ingroup applications
26  */
27
28 #include "asterisk.h"
29
30 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
31
32 #include <sys/types.h>
33 #include <stdlib.h>
34
35 #include "asterisk/channel.h"
36 #include "asterisk/module.h"
37 #include "asterisk/pbx.h"
38
39 static char *nocdr_descrip = 
40 "  NoCDR(): This application will tell Asterisk not to maintain a CDR for the\n"
41 "current call.\n";
42
43 static char *nocdr_app = "NoCDR";
44 static char *nocdr_synopsis = "Tell Asterisk to not maintain a CDR for the current call";
45
46
47 static int nocdr_exec(struct ast_channel *chan, void *data)
48 {
49         struct ast_module_user *u;
50         
51         u = ast_module_user_add(chan);
52
53         if (chan->cdr) {
54                 ast_cdr_free(chan->cdr);
55                 chan->cdr = NULL;
56         }
57
58         ast_module_user_remove(u);
59
60         return 0;
61 }
62
63 static int unload_module(void)
64 {
65         int res;
66
67         res = ast_unregister_application(nocdr_app);
68
69         ast_module_user_hangup_all();
70
71         return res;
72 }
73
74 static int load_module(void)
75 {
76         return ast_register_application(nocdr_app, nocdr_exec, nocdr_synopsis, nocdr_descrip);
77 }
78
79 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Tell Asterisk to not maintain a CDR for the current call");