#include <sys/types.h>
#include <stdlib.h>
#include "asterisk.h"
#include "asterisk/channel.h"
#include "asterisk/module.h"
#include "asterisk/pbx.h"
Go to the source code of this file.
Functions | |
char * | description (void) |
Provides a description of the module. | |
char * | key () |
Returns the ASTERISK_GPL_KEY. | |
int | load_module (void) |
Initialize the module. | |
int | nocdr_exec (struct ast_channel *chan, void *data) |
int | unload_module (void) |
Cleanup all module structures, sockets, etc. | |
int | usecount (void) |
Provides a usecount. | |
Variables | |
LOCAL_USER_DECL | |
char * | nocdr_app = "NoCDR" |
char * | nocdr_descrip |
char * | nocdr_synopsis = "Tell Asterisk to not maintain a CDR for the current call" |
STANDARD_LOCAL_USER | |
char * | tdesc = "Tell Asterisk to not maintain a CDR for the current call" |
Definition in file app_cdr.c.
|
Provides a description of the module.
Definition at line 82 of file app_cdr.c. 00083 {
00084 return tdesc;
00085 }
|
|
Returns the ASTERISK_GPL_KEY. This returns the ASTERISK_GPL_KEY, signifiying that you agree to the terms of the GPL stated in the ASTERISK_GPL_KEY. Your module will not load if it does not return the EXACT message:
char *key(void) { return ASTERISK_GPL_KEY; }
Definition at line 94 of file app_cdr.c. 00095 {
00096 return ASTERISK_GPL_KEY;
00097 }
|
|
Initialize the module. Initialize the Agents module. This function is being called by Asterisk when loading the module. Among other thing it registers applications, cli commands and reads the cofiguration file.
Definition at line 77 of file app_cdr.c. References ast_register_application(), nocdr_app, nocdr_descrip, nocdr_exec(), and nocdr_synopsis. 00078 { 00079 return ast_register_application(nocdr_app, nocdr_exec, nocdr_synopsis, nocdr_descrip); 00080 }
|
|
Definition at line 50 of file app_cdr.c. References ast_cdr_free(), ast_channel::cdr, LOCAL_USER_ADD, and LOCAL_USER_REMOVE. Referenced by load_module(). 00051 { 00052 struct localuser *u; 00053 00054 LOCAL_USER_ADD(u); 00055 00056 if (chan->cdr) { 00057 ast_cdr_free(chan->cdr); 00058 chan->cdr = NULL; 00059 } 00060 00061 LOCAL_USER_REMOVE(u); 00062 00063 return 0; 00064 }
|
|
Cleanup all module structures, sockets, etc. This is called at exit. Any registrations and memory allocations need to be unregistered and free'd here. Nothing else will do these for you (until exit).
Definition at line 66 of file app_cdr.c. References ast_unregister_application(), and nocdr_app. 00067 { 00068 int res; 00069 00070 res = ast_unregister_application(nocdr_app); 00071 00072 STANDARD_HANGUP_LOCALUSERS; 00073 00074 return res; 00075 }
|
|
Provides a usecount. This function will be called by various parts of asterisk. Basically, all it has to do is to return a usecount when called. You will need to maintain your usecount within the module somewhere. The usecount should be how many channels provided by this module are in use.
Definition at line 87 of file app_cdr.c. References STANDARD_USECOUNT. 00088 { 00089 int res; 00090 STANDARD_USECOUNT(res); 00091 return res; 00092 }
|
|
|
|
Definition at line 43 of file app_cdr.c. Referenced by load_module(), and unload_module(). |
|
Initial value: " NoCDR(): This application will tell Asterisk not to maintain a CDR for the\n" "current call.\n" Definition at line 39 of file app_cdr.c. Referenced by load_module(). |
|
Definition at line 44 of file app_cdr.c. Referenced by load_module(). |
|
|
|
|