Wed Jan 8 2020 09:49:39

Asterisk developer's documentation


app_cdr.c
Go to the documentation of this file.
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 /*** MODULEINFO
29  <support_level>core</support_level>
30  ***/
31 
32 #include "asterisk.h"
33 
34 ASTERISK_FILE_VERSION(__FILE__, "$Revision: 328209 $")
35 
36 #include "asterisk/channel.h"
37 #include "asterisk/module.h"
38 
39 /*** DOCUMENTATION
40  <application name="NoCDR" language="en_US">
41  <synopsis>
42  Tell Asterisk to not maintain a CDR for the current call
43  </synopsis>
44  <syntax />
45  <description>
46  <para>This application will tell Asterisk not to maintain a CDR for the current call.</para>
47  </description>
48  </application>
49  ***/
50 
51 static const char nocdr_app[] = "NoCDR";
52 
53 static int nocdr_exec(struct ast_channel *chan, const char *data)
54 {
55  if (chan->cdr)
57 
58  return 0;
59 }
60 
61 static int unload_module(void)
62 {
63  return ast_unregister_application(nocdr_app);
64 }
65 
66 static int load_module(void)
67 {
71 }
72 
73 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Tell Asterisk to not maintain a CDR for the current call");
Main Channel structure associated with a channel.
Definition: channel.h:742
#define AST_MODULE_INFO_STANDARD(keystr, desc)
Definition: module.h:396
Asterisk main include file. File version handling, generic pbx functions.
#define ast_set_flag(p, flag)
Definition: utils.h:70
struct ast_cdr * cdr
Definition: channel.h:766
int ast_unregister_application(const char *app)
Unregister an application.
Definition: pbx.c:7705
static int unload_module(void)
Definition: app_cdr.c:61
static const char nocdr_app[]
Definition: app_cdr.c:51
static int nocdr_exec(struct ast_channel *chan, const char *data)
Definition: app_cdr.c:53
#define ASTERISK_GPL_KEY
The text the key() function should return.
Definition: module.h:38
Asterisk module definitions.
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.
Definition: module.h:437
#define ASTERISK_FILE_VERSION(file, version)
Register/unregister a source code file with the core.
Definition: asterisk.h:180
static int load_module(void)
Definition: app_cdr.c:66