Applications connected with CDR engine.
More...
Go to the source code of this file.
|
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Tell Asterisk to not maintain a CDR for the current call" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = "30ef0c93b36035ec78c9cfd712d36d9b" , .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_DEFAULT, .support_level = AST_MODULE_SUPPORT_CORE, } |
|
static const struct ast_module_info * | ast_module_info = &__mod_info |
|
static const char | nocdr_app [] = "NoCDR" |
|
static const char | resetcdr_app [] = "ResetCDR" |
|
static const struct ast_app_option | resetcdr_opts [128] = { [ 'v' ] = { .flag = AST_CDR_FLAG_KEEP_VARS }, [ 'e' ] = { .flag = AST_CDR_FLAG_DISABLE_ALL }, } |
|
Applications connected with CDR engine.
- Author
- Martin Pycko marti.nosp@m.np@d.nosp@m.igium.nosp@m..com
Definition in file app_cdr.c.
◆ reset_cdr_options
Enumerator |
---|
OPT_DISABLE_DISPATCH | |
OPT_KEEP_VARS | |
OPT_ENABLE | |
Definition at line 104 of file app_cdr.c.
◆ __reg_module()
static void __reg_module |
( |
void |
| ) |
|
|
static |
◆ __unreg_module()
static void __unreg_module |
( |
void |
| ) |
|
|
static |
◆ appcdr_callback()
Definition at line 131 of file app_cdr.c.
References ast_cdr_clear_property(), AST_CDR_FLAG_DISABLE_ALL, ast_cdr_reset(), ast_cdr_set_property(), ast_log, AST_LOG_WARNING, app_cdr_message_payload::channel_name, app_cdr_message_payload::disable, app_cdr_message_payload::keep_variables, app_cdr_message_payload::reenable, app_cdr_message_payload::reset, stasis_message_data(), and stasis_message_type().
Referenced by load_module().
158 if (payload->
reset) {
struct stasis_message_type * stasis_message_type(const struct stasis_message *msg)
Get the message type for a stasis_message.
const char * channel_name
unsigned int keep_variables
int ast_cdr_reset(const char *channel_name, int keep_variables)
Reset the detail record.
int ast_cdr_set_property(const char *channel_name, enum ast_cdr_options option)
Set a property on a CDR for a channel.
void * stasis_message_data(const struct stasis_message *msg)
Get the data contained in a message.
int ast_cdr_clear_property(const char *channel_name, enum ast_cdr_options option)
Clear a property on a CDR for a channel.
◆ AST_MODULE_SELF_SYM()
◆ load_module()
static int load_module |
( |
void |
| ) |
|
|
static |
Definition at line 246 of file app_cdr.c.
References ao2_cleanup, appcdr_callback(), ast_cdr_message_router(), AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, ast_register_application_xml, nocdr_app, nocdr_exec(), NULL, RAII_VAR, resetcdr_app, resetcdr_exec(), router, stasis_message_router_add(), STASIS_MESSAGE_TYPE_INIT, and unload_module().
static int resetcdr_exec(struct ast_channel *chan, const char *data)
static struct stasis_message_router * router
int stasis_message_router_add(struct stasis_message_router *router, struct stasis_message_type *message_type, stasis_subscription_cb callback, void *data)
Add a route to a message router.
#define STASIS_MESSAGE_TYPE_INIT(name)
Boiler-plate messaging macro for initializing message types.
static void appcdr_callback(void *data, struct stasis_subscription *sub, struct stasis_message *message)
static int unload_module(void)
struct stasis_message_router * ast_cdr_message_router(void)
Return the message router for the CDR engine.
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
static const char nocdr_app[]
static const char resetcdr_app[]
Module has failed to load, may be in an inconsistent state.
static int nocdr_exec(struct ast_channel *chan, const char *data)
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.
◆ nocdr_exec()
static int nocdr_exec |
( |
struct ast_channel * |
chan, |
|
|
const char * |
data |
|
) |
| |
|
static |
Definition at line 218 of file app_cdr.c.
References ao2_alloc, ao2_cleanup, ast_channel_name(), NULL, publish_app_cdr_message(), and RAII_VAR.
Referenced by load_module().
228 payload->disable = 1;
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
#define ao2_alloc(data_size, destructor_fn)
static int publish_app_cdr_message(struct ast_channel *chan, struct app_cdr_message_payload *payload)
const char * ast_channel_name(const struct ast_channel *chan)
◆ publish_app_cdr_message()
Definition at line 166 of file app_cdr.c.
References ao2_cleanup, ast_cdr_message_router(), ast_channel_name(), ast_log, AST_LOG_WARNING, app_cdr_message_payload::channel_name, NULL, RAII_VAR, router, stasis_message_create(), and stasis_message_router_publish_sync().
Referenced by nocdr_exec(), and resetcdr_exec().
static struct stasis_message_router * router
void stasis_message_router_publish_sync(struct stasis_message_router *router, struct stasis_message *message)
Publish a message to a message router's subscription synchronously.
const char * channel_name
struct stasis_message_router * ast_cdr_message_router(void)
Return the message router for the CDR engine.
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
struct stasis_message * stasis_message_create(struct stasis_message_type *type, void *data)
Create a new message.
const char * ast_channel_name(const struct ast_channel *chan)
◆ resetcdr_exec()
static int resetcdr_exec |
( |
struct ast_channel * |
chan, |
|
|
const char * |
data |
|
) |
| |
|
static |
Definition at line 188 of file app_cdr.c.
References ao2_alloc, ao2_cleanup, args, ast_app_parse_options(), AST_CDR_FLAG_DISABLE_ALL, AST_CDR_FLAG_KEEP_VARS, ast_channel_name(), ast_strdupa, ast_strlen_zero, ast_test_flag, NULL, publish_app_cdr_message(), RAII_VAR, and resetcdr_opts.
Referenced by load_module().
208 payload->reenable = 1;
212 payload->keep_variables = 1;
#define ast_test_flag(p, flag)
#define ast_strlen_zero(foo)
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
#define ast_strdupa(s)
duplicate a string in memory from the stack
int ast_app_parse_options(const struct ast_app_option *options, struct ast_flags *flags, char **args, char *optstr)
Parses a string containing application options and sets flags/arguments.
static const struct ast_app_option resetcdr_opts[128]
#define ao2_alloc(data_size, destructor_fn)
Structure used to handle boolean flags.
static int publish_app_cdr_message(struct ast_channel *chan, struct app_cdr_message_payload *payload)
const char * ast_channel_name(const struct ast_channel *chan)
◆ STASIS_MESSAGE_TYPE_DEFN_LOCAL()
STASIS_MESSAGE_TYPE_DEFN_LOCAL |
( |
appcdr_message_type |
| ) |
|
◆ unload_module()
static int unload_module |
( |
void |
| ) |
|
|
static |
Definition at line 233 of file app_cdr.c.
References ao2_cleanup, ast_cdr_message_router(), ast_unregister_application(), nocdr_app, RAII_VAR, resetcdr_app, router, stasis_message_router_remove(), and STASIS_MESSAGE_TYPE_CLEANUP.
Referenced by load_module().
static struct stasis_message_router * router
#define STASIS_MESSAGE_TYPE_CLEANUP(name)
Boiler-plate messaging macro for cleaning up message types.
int ast_unregister_application(const char *app)
Unregister an application.
struct stasis_message_router * ast_cdr_message_router(void)
Return the message router for the CDR engine.
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
static const char nocdr_app[]
static const char resetcdr_app[]
void stasis_message_router_remove(struct stasis_message_router *router, struct stasis_message_type *message_type)
Remove a route from a message router.
◆ __mod_info
struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Tell Asterisk to not maintain a CDR for the current call" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = "30ef0c93b36035ec78c9cfd712d36d9b" , .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_DEFAULT, .support_level = AST_MODULE_SUPPORT_CORE, } |
|
static |
◆ ast_module_info
◆ nocdr_app
const char nocdr_app[] = "NoCDR" |
|
static |
◆ resetcdr_app
const char resetcdr_app[] = "ResetCDR" |
|
static |
◆ resetcdr_opts