48 #if defined(AST_DEVMODE)
70 #if defined(AST_DEVMODE)
75 for (i = path_vars; i; i = i->
next) {
76 if (strcmp(i->
name,
"playbackId") == 0) {
82 #if defined(AST_DEVMODE)
87 is_valid = response->
message == NULL;
95 if (200 <= code && code <= 299) {
99 ast_log(LOG_ERROR,
"Invalid error response %d for /playbacks/{playbackId}\n", code);
105 ast_log(LOG_ERROR,
"Response validation failed for /playbacks/{playbackId}\n");
107 "Internal Server Error",
"Response validation failed");
111 fin: __attribute__((unused))
130 #if defined(AST_DEVMODE)
135 for (i = path_vars; i; i = i->
next) {
136 if (strcmp(i->
name,
"playbackId") == 0) {
142 #if defined(AST_DEVMODE)
147 is_valid = response->
message == NULL;
155 if (200 <= code && code <= 299) {
159 ast_log(LOG_ERROR,
"Invalid error response %d for /playbacks/{playbackId}\n", code);
165 ast_log(LOG_ERROR,
"Response validation failed for /playbacks/{playbackId}\n");
167 "Internal Server Error",
"Response validation failed");
171 fin: __attribute__((unused))
203 #if defined(AST_DEVMODE)
208 for (i = get_params; i; i = i->
next) {
209 if (strcmp(i->
name,
"operation") == 0) {
214 for (i = path_vars; i; i = i->
next) {
215 if (strcmp(i->
name,
"playbackId") == 0) {
225 #if defined(AST_DEVMODE)
230 is_valid = response->
message == NULL;
240 if (200 <= code && code <= 299) {
244 ast_log(LOG_ERROR,
"Invalid error response %d for /playbacks/{playbackId}/control\n", code);
250 ast_log(LOG_ERROR,
"Response validation failed for /playbacks/{playbackId}/control\n");
252 "Internal Server Error",
"Response validation failed");
256 fin: __attribute__((unused))
289 static int unload_module(
void)
295 static int load_module(
void)
309 AST_MODULE_INFO(
ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT,
"RESTful API module - Playback control resources",
310 .support_level = AST_MODULE_SUPPORT_CORE,
312 .unload = unload_module,
313 .requires =
"res_ari,res_ari_model,res_stasis,res_stasis_playback",
struct ast_variable * next
void ast_ari_playbacks_control(struct ast_variable *headers, struct ast_ari_playbacks_control_args *args, struct ast_ari_response *response)
Control a playback.
Asterisk main include file. File version handling, generic pbx functions.
Generated file - declares stubs to be implemented in res/ari/resource_playbacks.c.
Structure for variables, used for configurations and for channel variables.
Generated file - Build validators for ARI model objects.
static void ast_ari_playbacks_get_cb(struct ast_tcptls_session_instance *ser, struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct ast_json *body, struct ast_ari_response *response)
Parameter parsing callback for /playbacks/{playbackId}.
void ast_ari_playbacks_get(struct ast_variable *headers, struct ast_ari_playbacks_get_args *args, struct ast_ari_response *response)
Get a playback's details.
void ast_ari_response_alloc_failed(struct ast_ari_response *response)
Fill in response with a 500 message for allocation failures.
int ast_ari_validate_void(struct ast_json *json)
Validator for native Swagger void.
static struct stasis_rest_handlers playbacks_playbackId
REST handler for /api-docs/playbacks.json.
static struct stasis_rest_handlers playbacks
REST handler for /api-docs/playbacks.json.
const char * ast_json_string_get(const struct ast_json *string)
Get the value of a JSON string.
int ast_ari_validate_playback(struct ast_json *json)
Validator for Playback.
static void ast_ari_playbacks_control_cb(struct ast_tcptls_session_instance *ser, struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct ast_json *body, struct ast_ari_response *response)
Parameter parsing callback for /playbacks/{playbackId}/control.
describes a server instance
int ast_ari_add_handler(struct stasis_rest_handlers *handler)
int ast_ari_remove_handler(struct stasis_rest_handlers *handler)
void ast_ari_response_error(struct ast_ari_response *response, int response_code, const char *response_text, const char *message_fmt,...)
Fill in an error ast_ari_response.
Module has failed to load, may be in an inconsistent state.
struct ast_json * message
const char * path_segment
void ast_ari_playbacks_stop(struct ast_variable *headers, struct ast_ari_playbacks_stop_args *args, struct ast_ari_response *response)
Stop a playback.
int ast_ari_playbacks_control_parse_body(struct ast_json *body, struct ast_ari_playbacks_control_args *args)
Body parsing function for /playbacks/{playbackId}/control.
struct ast_json * ast_json_object_get(struct ast_json *object, const char *key)
Get a field from a JSON object.
static void ast_ari_playbacks_stop_cb(struct ast_tcptls_session_instance *ser, struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct ast_json *body, struct ast_ari_response *response)
Parameter parsing callback for /playbacks/{playbackId}.
static struct stasis_rest_handlers playbacks_playbackId_control
REST handler for /api-docs/playbacks.json.
Abstract JSON element (object, array, string, int, ...).
Stasis Application API. See Stasis Application API for detailed documentation.
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
Application convenience functions, designed to give consistent look and feel to Asterisk apps...
Handler for a single RESTful path segment.