Wed Apr 6 11:29:37 2011

Asterisk developer's documentation


app_cdr.c

Go to the documentation of this file.
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 #include "asterisk.h"
00029 
00030 ASTERISK_FILE_VERSION(__FILE__, "$Revision: 196072 $")
00031 
00032 #include "asterisk/channel.h"
00033 #include "asterisk/module.h"
00034 
00035 /*** DOCUMENTATION
00036    <application name="NoCDR" language="en_US">
00037       <synopsis>
00038          Tell Asterisk to not maintain a CDR for the current call
00039       </synopsis>
00040       <syntax />
00041       <description>
00042          <para>This application will tell Asterisk not to maintain a CDR for the current call.</para>
00043       </description>
00044    </application>
00045  ***/
00046 
00047 static const char nocdr_app[] = "NoCDR";
00048 
00049 static int nocdr_exec(struct ast_channel *chan, const char *data)
00050 {
00051    if (chan->cdr)
00052       ast_set_flag(chan->cdr, AST_CDR_FLAG_POST_DISABLED);
00053 
00054    return 0;
00055 }
00056 
00057 static int unload_module(void)
00058 {
00059    return ast_unregister_application(nocdr_app);
00060 }
00061 
00062 static int load_module(void)
00063 {
00064    if (ast_register_application_xml(nocdr_app, nocdr_exec))
00065       return AST_MODULE_LOAD_FAILURE;
00066    return AST_MODULE_LOAD_SUCCESS;
00067 }
00068 
00069 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Tell Asterisk to not maintain a CDR for the current call");

Generated on Wed Apr 6 11:29:37 2011 for Asterisk - The Open Source Telephony Project by  doxygen 1.4.7