diff options
Diffstat (limited to 'res/res_ari_sounds.c')
-rw-r--r-- | res/res_ari_sounds.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/res/res_ari_sounds.c b/res/res_ari_sounds.c index a7411b5bf..0b817c309 100644 --- a/res/res_ari_sounds.c +++ b/res/res_ari_sounds.c @@ -41,6 +41,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") +#include "asterisk/app.h" #include "asterisk/module.h" #include "asterisk/stasis_app.h" #include "ari/resource_sounds.h" @@ -48,6 +49,8 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "ari/ari_model_validators.h" #endif +#define MAX_VALS 128 + /*! * \brief Parameter parsing callback for /sounds. * \param get_params GET parameters in the HTTP request. @@ -59,14 +62,13 @@ static void ast_ari_get_sounds_cb( struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct ast_ari_response *response) { + struct ast_get_sounds_args args = {}; + struct ast_variable *i; #if defined(AST_DEVMODE) int is_valid; int code; #endif /* AST_DEVMODE */ - struct ast_get_sounds_args args = {}; - struct ast_variable *i; - for (i = get_params; i; i = i->next) { if (strcmp(i->name, "lang") == 0) { args.lang = (i->value); @@ -104,6 +106,9 @@ static void ast_ari_get_sounds_cb( "Internal Server Error", "Response validation failed"); } #endif /* AST_DEVMODE */ + +fin: __attribute__((unused)) + return; } /*! * \brief Parameter parsing callback for /sounds/{soundId}. @@ -116,14 +121,13 @@ static void ast_ari_get_stored_sound_cb( struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct ast_ari_response *response) { + struct ast_get_stored_sound_args args = {}; + struct ast_variable *i; #if defined(AST_DEVMODE) int is_valid; int code; #endif /* AST_DEVMODE */ - struct ast_get_stored_sound_args args = {}; - struct ast_variable *i; - for (i = path_vars; i; i = i->next) { if (strcmp(i->name, "soundId") == 0) { args.sound_id = (i->value); @@ -158,6 +162,9 @@ static void ast_ari_get_stored_sound_cb( "Internal Server Error", "Response validation failed"); } #endif /* AST_DEVMODE */ + +fin: __attribute__((unused)) + return; } /*! \brief REST handler for /api-docs/sounds.{format} */ |