diff --git a/res/ari/resource_channels.c b/res/ari/resource_channels.c index 4d5228168a..aaf04a3f88 100644 --- a/res/ari/resource_channels.c +++ b/res/ari/resource_channels.c @@ -152,6 +152,13 @@ void ast_ari_mute_channel(struct ast_variable *headers, struct ast_mute_channel_ return; } + if (ast_strlen_zero(args->direction)) { + ast_ari_response_error( + response, 400, "Bad Request", + "Direction is required"); + return; + } + if (!strcmp(args->direction, "in")) { direction = AST_MUTE_DIRECTION_READ; } else if (!strcmp(args->direction, "out")) { @@ -181,6 +188,13 @@ void ast_ari_unmute_channel(struct ast_variable *headers, struct ast_unmute_chan return; } + if (ast_strlen_zero(args->direction)) { + ast_ari_response_error( + response, 400, "Bad Request", + "Direction is required"); + return; + } + if (!strcmp(args->direction, "in")) { direction = AST_MUTE_DIRECTION_READ; } else if (!strcmp(args->direction, "out")) {