mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 03:50:31 +00:00
ARI: Deleting log channels
An http request can be sent to delete a log channel in Asterisk. The command "curl -v -u user:pass -X DELETE 'http://localhost:8088 /ari/asterisk/logging/mylog'" can be run in the terminal to access the newly implemented functionally for ARI. * Able to delete log channels using ARI ASTERISK-25252 Change-Id: Id6eeb54ebcc511595f0418d586ff55914bc3aae6
This commit is contained in:
@@ -653,6 +653,29 @@ void ast_ari_asterisk_rotate_log(struct ast_variable *headers,
|
||||
ast_ari_response_no_content(response);
|
||||
}
|
||||
|
||||
void ast_ari_asterisk_delete_log(struct ast_variable *headers,
|
||||
struct ast_ari_asterisk_delete_log_args *args,
|
||||
struct ast_ari_response *response)
|
||||
{
|
||||
int res;
|
||||
|
||||
ast_assert(response != NULL);
|
||||
|
||||
res = ast_logger_remove_channel(args->log_channel_name);
|
||||
|
||||
if (res == AST_LOGGER_FAILURE) {
|
||||
ast_ari_response_error(response, 404, "Not Found",
|
||||
"Log channel does not exist");
|
||||
return;
|
||||
} else if (res == AST_LOGGER_ALLOC_ERROR) {
|
||||
ast_ari_response_error(response, 500, "Internal Server Error",
|
||||
"Allocation failed");
|
||||
return;
|
||||
}
|
||||
|
||||
ast_ari_response_no_content(response);
|
||||
}
|
||||
|
||||
void ast_ari_asterisk_get_global_var(struct ast_variable *headers,
|
||||
struct ast_ari_asterisk_get_global_var_args *args,
|
||||
struct ast_ari_response *response)
|
||||
|
Reference in New Issue
Block a user