diff options
Diffstat (limited to 'res/ari')
-rw-r--r-- | res/ari/resource_bridges.c | 21 | ||||
-rw-r--r-- | res/ari/resource_channels.c | 7 |
2 files changed, 28 insertions, 0 deletions
diff --git a/res/ari/resource_bridges.c b/res/ari/resource_bridges.c index a036ce0f3..919171139 100644 --- a/res/ari/resource_bridges.c +++ b/res/ari/resource_bridges.c @@ -439,6 +439,27 @@ void ast_ari_record_bridge(struct ast_variable *headers, struct ast_record_bridg stasis_app_recording_if_exists_parse(args->if_exists); options->beep = args->beep; + if (options->terminate_on == STASIS_APP_RECORDING_TERMINATE_INVALID) { + ast_ari_response_error( + response, 400, "Bad Request", + "terminateOn invalid"); + return; + } + + if (options->if_exists == -1) { + ast_ari_response_error( + response, 400, "Bad Request", + "ifExists invalid"); + return; + } + + if (!ast_get_format_for_file_ext(options->format)) { + ast_ari_response_error( + response, 422, "Unprocessable Entity", + "specified format is unknown on this system"); + return; + } + recording = stasis_app_control_record(control, options); if (recording == NULL) { switch(errno) { diff --git a/res/ari/resource_channels.c b/res/ari/resource_channels.c index b8d59d38b..f1a9217af 100644 --- a/res/ari/resource_channels.c +++ b/res/ari/resource_channels.c @@ -407,6 +407,13 @@ void ast_ari_record_channel(struct ast_variable *headers, return; } + if (!ast_get_format_for_file_ext(options->format)) { + ast_ari_response_error( + response, 422, "Unprocessable Entity", + "specified format is unknown on this system"); + return; + } + recording = stasis_app_control_record(control, options); if (recording == NULL) { switch(errno) { |