summaryrefslogtreecommitdiff
path: root/res/res_ari_playback.c
diff options
context:
space:
mode:
Diffstat (limited to 'res/res_ari_playback.c')
-rw-r--r--res/res_ari_playback.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/res/res_ari_playback.c b/res/res_ari_playback.c
index 0dc76aff9..55da058a8 100644
--- a/res/res_ari_playback.c
+++ b/res/res_ari_playback.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_playback.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 /playback/{playbackId}.
* \param get_params GET parameters in the HTTP request.
@@ -59,14 +62,13 @@ static void ast_ari_get_playback_cb(
struct ast_variable *get_params, struct ast_variable *path_vars,
struct ast_variable *headers, struct ast_ari_response *response)
{
+ struct ast_get_playback_args args = {};
+ struct ast_variable *i;
#if defined(AST_DEVMODE)
int is_valid;
int code;
#endif /* AST_DEVMODE */
- struct ast_get_playback_args args = {};
- struct ast_variable *i;
-
for (i = path_vars; i; i = i->next) {
if (strcmp(i->name, "playbackId") == 0) {
args.playback_id = (i->value);
@@ -101,6 +103,9 @@ static void ast_ari_get_playback_cb(
"Internal Server Error", "Response validation failed");
}
#endif /* AST_DEVMODE */
+
+fin: __attribute__((unused))
+ return;
}
/*!
* \brief Parameter parsing callback for /playback/{playbackId}.
@@ -113,14 +118,13 @@ static void ast_ari_stop_playback_cb(
struct ast_variable *get_params, struct ast_variable *path_vars,
struct ast_variable *headers, struct ast_ari_response *response)
{
+ struct ast_stop_playback_args args = {};
+ struct ast_variable *i;
#if defined(AST_DEVMODE)
int is_valid;
int code;
#endif /* AST_DEVMODE */
- struct ast_stop_playback_args args = {};
- struct ast_variable *i;
-
for (i = path_vars; i; i = i->next) {
if (strcmp(i->name, "playbackId") == 0) {
args.playback_id = (i->value);
@@ -155,6 +159,9 @@ static void ast_ari_stop_playback_cb(
"Internal Server Error", "Response validation failed");
}
#endif /* AST_DEVMODE */
+
+fin: __attribute__((unused))
+ return;
}
/*!
* \brief Parameter parsing callback for /playback/{playbackId}/control.
@@ -167,14 +174,13 @@ static void ast_ari_control_playback_cb(
struct ast_variable *get_params, struct ast_variable *path_vars,
struct ast_variable *headers, struct ast_ari_response *response)
{
+ struct ast_control_playback_args args = {};
+ struct ast_variable *i;
#if defined(AST_DEVMODE)
int is_valid;
int code;
#endif /* AST_DEVMODE */
- struct ast_control_playback_args args = {};
- struct ast_variable *i;
-
for (i = get_params; i; i = i->next) {
if (strcmp(i->name, "operation") == 0) {
args.operation = (i->value);
@@ -218,6 +224,9 @@ static void ast_ari_control_playback_cb(
"Internal Server Error", "Response validation failed");
}
#endif /* AST_DEVMODE */
+
+fin: __attribute__((unused))
+ return;
}
/*! \brief REST handler for /api-docs/playback.{format} */