diff --git a/apps/app_cdr.c b/apps/app_cdr.c index 3e52302fd2..6929088e3f 100644 --- a/apps/app_cdr.c +++ b/apps/app_cdr.c @@ -38,26 +38,6 @@ #include "asterisk/stasis_message_router.h" /*** DOCUMENTATION - - - Tell Asterisk to not maintain a CDR for this channel. - - - - This application will tell Asterisk not to maintain a CDR for - the current channel. This does NOT mean that - information is not tracked; rather, if the channel is hung up no - CDRs will be created for that channel. - If a subsequent call to ResetCDR occurs, all non-finalized - CDRs created for the channel will be enabled. - This application is deprecated. Please use the CDR_PROP - function to disable CDRs on a channel. - - - ResetCDR - CDR_PROP - - Resets the Call Data Record. @@ -68,10 +48,6 @@ - @@ -84,21 +60,14 @@ current time. 3. All variables are wiped from the CDR. Note that this step can be prevented with the v option. - On the other hand, if the e option is - specified, the effects of the NoCDR application will be lifted. CDRs - will be re-enabled for this channel. - The e option is deprecated. Please - use the CDR_PROP function instead. ForkCDR - NoCDR CDR_PROP ***/ -static const char nocdr_app[] = "NoCDR"; static const char resetcdr_app[] = "ResetCDR"; enum reset_cdr_options { @@ -109,7 +78,6 @@ enum reset_cdr_options { AST_APP_OPTIONS(resetcdr_opts, { AST_APP_OPTION('v', AST_CDR_FLAG_KEEP_VARS), - AST_APP_OPTION('e', AST_CDR_FLAG_DISABLE_ALL), }); STASIS_MESSAGE_TYPE_DEFN_LOCAL(appcdr_message_type); @@ -118,10 +86,6 @@ STASIS_MESSAGE_TYPE_DEFN_LOCAL(appcdr_message_type); struct app_cdr_message_payload { /*! The name of the channel to be manipulated */ const char *channel_name; - /*! Disable the CDR for this channel */ - unsigned int disable:1; - /*! Re-enable the CDR for this channel */ - unsigned int reenable:1; /*! Reset the CDR */ unsigned int reset:1; /*! If reseting the CDR, keep the variables */ @@ -141,24 +105,9 @@ static void appcdr_callback(void *data, struct stasis_subscription *sub, struct return; } - if (payload->disable) { - if (ast_cdr_set_property(payload->channel_name, AST_CDR_FLAG_DISABLE_ALL)) { - ast_log(AST_LOG_WARNING, "Failed to disable CDRs on channel %s\n", - payload->channel_name); - } - } - - if (payload->reenable) { - if (ast_cdr_clear_property(payload->channel_name, AST_CDR_FLAG_DISABLE_ALL)) { - ast_log(AST_LOG_WARNING, "Failed to enable CDRs on channel %s\n", - payload->channel_name); - } - } - if (payload->reset) { if (ast_cdr_reset(payload->channel_name, payload->keep_variables)) { - ast_log(AST_LOG_WARNING, "Failed to reset CDRs on channel %s\n", - payload->channel_name); + ast_log(AST_LOG_WARNING, "Failed to reset CDRs on channel %s\n", payload->channel_name); } } } @@ -204,10 +153,6 @@ static int resetcdr_exec(struct ast_channel *chan, const char *data) payload->channel_name = ast_channel_name(chan); payload->reset = 1; - if (ast_test_flag(&flags, AST_CDR_FLAG_DISABLE_ALL)) { - payload->reenable = 1; - } - if (ast_test_flag(&flags, AST_CDR_FLAG_KEEP_VARS)) { payload->keep_variables = 1; } @@ -215,21 +160,6 @@ static int resetcdr_exec(struct ast_channel *chan, const char *data) return publish_app_cdr_message(chan, payload); } -static int nocdr_exec(struct ast_channel *chan, const char *data) -{ - RAII_VAR(struct app_cdr_message_payload *, payload, - ao2_alloc(sizeof(*payload), NULL), ao2_cleanup); - - if (!payload) { - return -1; - } - - payload->channel_name = ast_channel_name(chan); - payload->disable = 1; - - return publish_app_cdr_message(chan, payload); -} - static int unload_module(void) { RAII_VAR(struct stasis_message_router *, router, ast_cdr_message_router(), ao2_cleanup); @@ -238,7 +168,6 @@ static int unload_module(void) stasis_message_router_remove(router, appcdr_message_type()); } STASIS_MESSAGE_TYPE_CLEANUP(appcdr_message_type); - ast_unregister_application(nocdr_app); ast_unregister_application(resetcdr_app); return 0; } @@ -253,10 +182,8 @@ static int load_module(void) } res |= STASIS_MESSAGE_TYPE_INIT(appcdr_message_type); - res |= ast_register_application_xml(nocdr_app, nocdr_exec); res |= ast_register_application_xml(resetcdr_app, resetcdr_exec); - res |= stasis_message_router_add(router, appcdr_message_type(), - appcdr_callback, NULL); + res |= stasis_message_router_add(router, appcdr_message_type(), appcdr_callback, NULL); if (res) { unload_module(); diff --git a/apps/app_forkcdr.c b/apps/app_forkcdr.c index a906fc9774..9e4c9aeb56 100644 --- a/apps/app_forkcdr.c +++ b/apps/app_forkcdr.c @@ -87,7 +87,7 @@ CDR - NoCDR + CDR_PROP ResetCDR diff --git a/doc/UPGRADE-staging/app_cdr.txt b/doc/UPGRADE-staging/app_cdr.txt new file mode 100644 index 0000000000..114f0ad2a2 --- /dev/null +++ b/doc/UPGRADE-staging/app_cdr.txt @@ -0,0 +1,6 @@ +Subject: app_cdr +Master-Only: True + +The previously deprecated NoCDR application has been removed. +Additionally, the previously deprecated 'e' option to the ResetCDR +application has been removed.