Playback control resources.
More...
Go to the source code of this file.
|
static void | __reg_module (void) |
|
static void | __unreg_module (void) |
|
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. More...
|
|
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. More...
|
|
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}. More...
|
|
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}. More...
|
|
struct ast_module * | AST_MODULE_SELF_SYM (void) |
|
static int | load_module (void) |
|
static int | unload_module (void) |
|
|
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "RESTful API module - Playback control resources" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = "30ef0c93b36035ec78c9cfd712d36d9b" , .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .requires = "res_ari,res_ari_model,res_stasis,res_stasis_playback", } |
|
static const struct ast_module_info * | ast_module_info = &__mod_info |
|
static struct stasis_rest_handlers | playbacks |
| REST handler for /api-docs/playbacks.json. More...
|
|
static struct stasis_rest_handlers | playbacks_playbackId |
| REST handler for /api-docs/playbacks.json. More...
|
|
static struct stasis_rest_handlers | playbacks_playbackId_control |
| REST handler for /api-docs/playbacks.json. More...
|
|
Playback control resources.
- Author
- David M. Lee, II dlee@.nosp@m.digi.nosp@m.um.co.nosp@m.m
Definition in file res_ari_playbacks.c.
◆ MAX_VALS
◆ __reg_module()
static void __reg_module |
( |
void |
| ) |
|
|
static |
◆ __unreg_module()
static void __unreg_module |
( |
void |
| ) |
|
|
static |
◆ ast_ari_playbacks_control_cb()
Parameter parsing callback for /playbacks/{playbackId}/control.
- Parameters
-
| get_params | GET parameters in the HTTP request. |
| path_vars | Path variables extracted from the request. |
| headers | HTTP headers. |
[out] | response | Response to the HTTP request. |
Definition at line 190 of file res_ari_playbacks.c.
References ast_ari_playbacks_control(), ast_ari_playbacks_control_parse_body(), ast_ari_response_alloc_failed(), ast_ari_response_error(), ast_ari_validate_void(), ast_log, LOG_ERROR, ast_ari_response::message, ast_variable::name, ast_variable::next, NULL, ast_ari_playbacks_control_args::operation, ast_ari_playbacks_control_args::playback_id, ast_ari_response::response_code, and ast_variable::value.
197 #if defined(AST_DEVMODE) 202 for (i = get_params; i; i = i->
next) {
203 if (strcmp(i->
name,
"operation") == 0) {
208 for (i = path_vars; i; i = i->
next) {
209 if (strcmp(i->
name,
"playbackId") == 0) {
219 #if defined(AST_DEVMODE) 234 if (200 <= code && code <= 299) {
238 ast_log(
LOG_ERROR,
"Invalid error response %d for /playbacks/{playbackId}/control\n", code);
244 ast_log(
LOG_ERROR,
"Response validation failed for /playbacks/{playbackId}/control\n");
246 "Internal Server Error",
"Response validation failed");
250 fin: __attribute__((unused))
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.
Structure for variables, used for configurations and for channel variables.
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.
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.
struct ast_json * message
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.
◆ ast_ari_playbacks_control_parse_body()
Body parsing function for /playbacks/{playbackId}/control.
- Parameters
-
| body | The JSON body from which to parse parameters. |
[out] | args | The args structure to parse into. |
- Return values
-
zero | on success |
non-zero | on failure |
Definition at line 170 of file res_ari_playbacks.c.
References ast_json_object_get(), ast_json_string_get(), and ast_ari_playbacks_control_args::operation.
Referenced by ast_ari_playbacks_control_cb().
const char * ast_json_string_get(const struct ast_json *string)
Get the value of a JSON string.
struct ast_json * ast_json_object_get(struct ast_json *object, const char *key)
Get a field from a JSON object.
Abstract JSON element (object, array, string, int, ...).
◆ ast_ari_playbacks_get_cb()
Parameter parsing callback for /playbacks/{playbackId}.
- Parameters
-
| get_params | GET parameters in the HTTP request. |
| path_vars | Path variables extracted from the request. |
| headers | HTTP headers. |
[out] | response | Response to the HTTP request. |
Definition at line 61 of file res_ari_playbacks.c.
References ast_ari_playbacks_get(), ast_ari_response_error(), ast_ari_validate_playback(), ast_log, LOG_ERROR, ast_ari_response::message, ast_variable::name, ast_variable::next, NULL, ast_ari_playbacks_get_args::playback_id, ast_ari_response::response_code, and ast_variable::value.
68 #if defined(AST_DEVMODE) 73 for (i = path_vars; i; i = i->
next) {
74 if (strcmp(i->
name,
"playbackId") == 0) {
80 #if defined(AST_DEVMODE) 93 if (200 <= code && code <= 299) {
97 ast_log(
LOG_ERROR,
"Invalid error response %d for /playbacks/{playbackId}\n", code);
103 ast_log(
LOG_ERROR,
"Response validation failed for /playbacks/{playbackId}\n");
105 "Internal Server Error",
"Response validation failed");
109 fin: __attribute__((unused))
struct ast_variable * next
Structure for variables, used for configurations and for channel variables.
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.
int ast_ari_validate_playback(struct ast_json *json)
Validator for Playback.
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.
struct ast_json * message
◆ ast_ari_playbacks_stop_cb()
Parameter parsing callback for /playbacks/{playbackId}.
- Parameters
-
| get_params | GET parameters in the HTTP request. |
| path_vars | Path variables extracted from the request. |
| headers | HTTP headers. |
[out] | response | Response to the HTTP request. |
Definition at line 119 of file res_ari_playbacks.c.
References ast_ari_playbacks_stop(), ast_ari_response_error(), ast_ari_validate_void(), ast_log, LOG_ERROR, ast_ari_response::message, ast_variable::name, ast_variable::next, NULL, ast_ari_playbacks_stop_args::playback_id, ast_ari_response::response_code, and ast_variable::value.
126 #if defined(AST_DEVMODE) 131 for (i = path_vars; i; i = i->
next) {
132 if (strcmp(i->
name,
"playbackId") == 0) {
138 #if defined(AST_DEVMODE) 151 if (200 <= code && code <= 299) {
155 ast_log(
LOG_ERROR,
"Invalid error response %d for /playbacks/{playbackId}\n", code);
161 ast_log(
LOG_ERROR,
"Response validation failed for /playbacks/{playbackId}\n");
163 "Internal Server Error",
"Response validation failed");
167 fin: __attribute__((unused))
struct ast_variable * next
Structure for variables, used for configurations and for channel variables.
int ast_ari_validate_void(struct ast_json *json)
Validator for native Swagger void.
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.
struct ast_json * message
void ast_ari_playbacks_stop(struct ast_variable *headers, struct ast_ari_playbacks_stop_args *args, struct ast_ari_response *response)
Stop a playback.
◆ AST_MODULE_SELF_SYM()
◆ load_module()
static int load_module |
( |
void |
| ) |
|
|
static |
◆ unload_module()
static int unload_module |
( |
void |
| ) |
|
|
static |
◆ __mod_info
struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "RESTful API module - Playback control resources" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = "30ef0c93b36035ec78c9cfd712d36d9b" , .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .requires = "res_ari,res_ari_model,res_stasis,res_stasis_playback", } |
|
static |
◆ ast_module_info
◆ playbacks
◆ playbacks_playbackId
◆ playbacks_playbackId_control