00001 /* 00002 * Asterisk -- An open source telephony toolkit. 00003 * 00004 * Copyright (C) 1999 - 2005, Digium, Inc. 00005 * 00006 * Martin Pycko <martinp@digium.com> 00007 * 00008 * See http://www.asterisk.org for more information about 00009 * the Asterisk project. Please do not directly contact 00010 * any of the maintainers of this project for assistance; 00011 * the project provides a web site, mailing lists and IRC 00012 * channels for your use. 00013 * 00014 * This program is free software, distributed under the terms of 00015 * the GNU General Public License Version 2. See the LICENSE file 00016 * at the top of the source tree. 00017 */ 00018 00019 /*! \file 00020 * 00021 * \brief Applications connected with CDR engine 00022 * 00023 * \author Martin Pycko <martinp@digium.com> 00024 * 00025 * \ingroup applications 00026 */ 00027 00028 /*** MODULEINFO 00029 <support_level>core</support_level> 00030 ***/ 00031 00032 #include "asterisk.h" 00033 00034 ASTERISK_FILE_VERSION(__FILE__, "$Revision: 328209 $") 00035 00036 #include "asterisk/channel.h" 00037 #include "asterisk/module.h" 00038 00039 /*** DOCUMENTATION 00040 <application name="NoCDR" language="en_US"> 00041 <synopsis> 00042 Tell Asterisk to not maintain a CDR for the current call 00043 </synopsis> 00044 <syntax /> 00045 <description> 00046 <para>This application will tell Asterisk not to maintain a CDR for the current call.</para> 00047 </description> 00048 </application> 00049 ***/ 00050 00051 static const char nocdr_app[] = "NoCDR"; 00052 00053 static int nocdr_exec(struct ast_channel *chan, const char *data) 00054 { 00055 if (chan->cdr) 00056 ast_set_flag(chan->cdr, AST_CDR_FLAG_POST_DISABLED); 00057 00058 return 0; 00059 } 00060 00061 static int unload_module(void) 00062 { 00063 return ast_unregister_application(nocdr_app); 00064 } 00065 00066 static int load_module(void) 00067 { 00068 if (ast_register_application_xml(nocdr_app, nocdr_exec)) 00069 return AST_MODULE_LOAD_FAILURE; 00070 return AST_MODULE_LOAD_SUCCESS; 00071 } 00072 00073 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Tell Asterisk to not maintain a CDR for the current call");