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 = AST_BUILDOPT_SUM, .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 | resetcdr_app [] = "ResetCDR" |
|
static const struct ast_app_option | resetcdr_opts [128] = { [ 'v' ] = { .flag = AST_CDR_FLAG_KEEP_VARS }, } |
|
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 73 of file app_cdr.c.
◆ __reg_module()
static void __reg_module |
( |
void |
| ) |
|
|
static |
◆ __unreg_module()
static void __unreg_module |
( |
void |
| ) |
|
|
static |
◆ appcdr_callback()
◆ AST_MODULE_SELF_SYM()
◆ load_module()
static int load_module |
( |
void |
| ) |
|
|
static |
Definition at line 175 of file app_cdr.c.
176{
178 int res = 0;
179
182 }
183
187
188 if (res) {
191 }
193}
static void appcdr_callback(void *data, struct stasis_subscription *sub, struct stasis_message *message)
static int resetcdr_exec(struct ast_channel *chan, const char *data)
static int unload_module(void)
static const char resetcdr_app[]
struct stasis_message_router * ast_cdr_message_router(void)
Return the message router for the CDR engine.
@ AST_MODULE_LOAD_SUCCESS
@ AST_MODULE_LOAD_DECLINE
Module has failed to load, may be in an inconsistent state.
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.
static struct stasis_message_router * router
#define STASIS_MESSAGE_TYPE_INIT(name)
Boiler-plate messaging macro for initializing message types.
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 RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
References ao2_cleanup, appcdr_callback(), ast_cdr_message_router(), AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, ast_register_application_xml, NULL, RAII_VAR, resetcdr_app, resetcdr_exec(), router, stasis_message_router_add(), STASIS_MESSAGE_TYPE_INIT, and unload_module().
◆ publish_app_cdr_message()
Definition at line 115 of file app_cdr.c.
116{
119
123 return -1;
124 }
125
130 return -1;
131 }
133
134 return 0;
135}
const char * ast_channel_name(const struct ast_channel *chan)
struct stasis_message * stasis_message_create(struct stasis_message_type *type, void *data)
Create a new message.
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.
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 resetcdr_exec().
◆ resetcdr_exec()
static int resetcdr_exec |
( |
struct ast_channel * |
chan, |
|
|
const char * |
data |
|
) |
| |
|
static |
Definition at line 137 of file app_cdr.c.
138{
143
144 if (!payload) {
145 return -1;
146 }
147
151 }
152
154 payload->reset = 1;
155
157 payload->keep_variables = 1;
158 }
159
161}
static const struct ast_app_option resetcdr_opts[128]
static int publish_app_cdr_message(struct ast_channel *chan, struct app_cdr_message_payload *payload)
#define ast_strdupa(s)
duplicate a string in memory from the stack
#define ao2_alloc(data_size, destructor_fn)
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 force_inline int attribute_pure ast_strlen_zero(const char *s)
Structure used to handle boolean flags.
#define ast_test_flag(p, flag)
References ao2_alloc, ao2_cleanup, args, ast_app_parse_options(), AST_CDR_FLAG_KEEP_VARS, ast_channel_name(), ast_strdupa, ast_strlen_zero(), ast_test_flag, ast_flags::flags, NULL, publish_app_cdr_message(), RAII_VAR, and resetcdr_opts.
Referenced by load_module().
◆ STASIS_MESSAGE_TYPE_DEFN_LOCAL()
STASIS_MESSAGE_TYPE_DEFN_LOCAL |
( |
appcdr_message_type |
| ) |
|
◆ unload_module()
static int unload_module |
( |
void |
| ) |
|
|
static |
◆ __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 = AST_BUILDOPT_SUM, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_DEFAULT, .support_level = AST_MODULE_SUPPORT_CORE, } |
|
static |
◆ ast_module_info
◆ resetcdr_app
const char resetcdr_app[] = "ResetCDR" |
|
static |
◆ resetcdr_opts