43 if (playback ==
NULL) {
45 "Playback not found");
52 "Internal Server Error",
"Error building response");
66 if (playback ==
NULL) {
68 "Playback not found");
79 "Internal Server Error",
"Could not stop playback");
85 "Internal Server Error",
"Could not stop playback");
99 "Bad Request",
"Missing operation");
102 if (strcmp(args->
operation,
"unpause") == 0) {
104 }
else if (strcmp(args->
operation,
"pause") == 0) {
106 }
else if (strcmp(args->
operation,
"restart") == 0) {
108 }
else if (strcmp(args->
operation,
"reverse") == 0) {
110 }
else if (strcmp(args->
operation,
"forward") == 0) {
114 "Bad Request",
"Invalid operation %s",
120 if (playback ==
NULL) {
122 "Playback not found");
133 "Internal Server Error",
"Could not %s playback",
138 "Can only %s while media is playing", args->
operation);
void ast_ari_playbacks_control(struct ast_variable *headers, struct ast_ari_playbacks_control_args *args, struct ast_ari_response *response)
Control a playback.
enum stasis_playback_oper_results stasis_app_playback_operation(struct stasis_app_playback *playback, enum stasis_app_playback_media_operation operation)
Controls the media for a given playback operation.
Asterisk main include file. File version handling, generic pbx functions.
Generated file - declares stubs to be implemented in res/ari/resource_playbacks.c.
stasis_app_playback_media_operation
Structure for variables, used for configurations and for channel variables.
struct ast_json * stasis_app_playback_to_json(const struct stasis_app_playback *playback)
Convert a playback to its JSON representation.
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.
struct stasis_app_playback * stasis_app_playback_find_by_id(const char *id)
Finds the playback object with the given id.
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
void ast_ari_response_ok(struct ast_ari_response *response, struct ast_json *message)
Fill in an OK (200) ast_ari_response.
stasis_playback_oper_results
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.
void ast_ari_response_no_content(struct ast_ari_response *response)
Fill in a No Content (204) ast_ari_response.
void ast_ari_playbacks_stop(struct ast_variable *headers, struct ast_ari_playbacks_stop_args *args, struct ast_ari_response *response)
Stop a playback.
Stasis Application Playback API. See StasisApplication API" for detailed documentation.
Abstract JSON element (object, array, string, int, ...).