48#if defined(AST_DEVMODE)
69#if defined(AST_DEVMODE)
75#if defined(AST_DEVMODE)
87 if (200 <= code && code <= 299) {
91 ast_log(
LOG_ERROR,
"Invalid error response %d for /recordings/stored\n", code);
99 "Internal Server Error",
"Response validation failed");
103fin: __attribute__((unused))
122#if defined(AST_DEVMODE)
127 for (i = path_vars; i; i = i->
next) {
128 if (strcmp(i->
name,
"recordingName") == 0) {
134#if defined(AST_DEVMODE)
147 if (200 <= code && code <= 299) {
151 ast_log(
LOG_ERROR,
"Invalid error response %d for /recordings/stored/{recordingName}\n", code);
157 ast_log(
LOG_ERROR,
"Response validation failed for /recordings/stored/{recordingName}\n");
159 "Internal Server Error",
"Response validation failed");
163fin: __attribute__((unused))
182#if defined(AST_DEVMODE)
187 for (i = path_vars; i; i = i->
next) {
188 if (strcmp(i->
name,
"recordingName") == 0) {
194#if defined(AST_DEVMODE)
207 if (200 <= code && code <= 299) {
211 ast_log(
LOG_ERROR,
"Invalid error response %d for /recordings/stored/{recordingName}\n", code);
217 ast_log(
LOG_ERROR,
"Response validation failed for /recordings/stored/{recordingName}\n");
219 "Internal Server Error",
"Response validation failed");
223fin: __attribute__((unused))
242#if defined(AST_DEVMODE)
247 for (i = path_vars; i; i = i->
next) {
248 if (strcmp(i->
name,
"recordingName") == 0) {
254#if defined(AST_DEVMODE)
268 if (200 <= code && code <= 299) {
272 ast_log(
LOG_ERROR,
"Invalid error response %d for /recordings/stored/{recordingName}/file\n", code);
278 ast_log(
LOG_ERROR,
"Response validation failed for /recordings/stored/{recordingName}/file\n");
280 "Internal Server Error",
"Response validation failed");
284fin: __attribute__((unused))
316#if defined(AST_DEVMODE)
321 for (i = get_params; i; i = i->
next) {
322 if (strcmp(i->
name,
"destinationRecordingName") == 0) {
323 args.destination_recording_name = (i->
value);
327 for (i = path_vars; i; i = i->
next) {
328 if (strcmp(i->
name,
"recordingName") == 0) {
338#if defined(AST_DEVMODE)
352 if (200 <= code && code <= 299) {
356 ast_log(
LOG_ERROR,
"Invalid error response %d for /recordings/stored/{recordingName}/copy\n", code);
362 ast_log(
LOG_ERROR,
"Response validation failed for /recordings/stored/{recordingName}/copy\n");
364 "Internal Server Error",
"Response validation failed");
368fin: __attribute__((unused))
387#if defined(AST_DEVMODE)
392 for (i = path_vars; i; i = i->
next) {
393 if (strcmp(i->
name,
"recordingName") == 0) {
399#if defined(AST_DEVMODE)
412 if (200 <= code && code <= 299) {
416 ast_log(
LOG_ERROR,
"Invalid error response %d for /recordings/live/{recordingName}\n", code);
422 ast_log(
LOG_ERROR,
"Response validation failed for /recordings/live/{recordingName}\n");
424 "Internal Server Error",
"Response validation failed");
428fin: __attribute__((unused))
447#if defined(AST_DEVMODE)
452 for (i = path_vars; i; i = i->
next) {
453 if (strcmp(i->
name,
"recordingName") == 0) {
459#if defined(AST_DEVMODE)
472 if (200 <= code && code <= 299) {
476 ast_log(
LOG_ERROR,
"Invalid error response %d for /recordings/live/{recordingName}\n", code);
482 ast_log(
LOG_ERROR,
"Response validation failed for /recordings/live/{recordingName}\n");
484 "Internal Server Error",
"Response validation failed");
488fin: __attribute__((unused))
507#if defined(AST_DEVMODE)
512 for (i = path_vars; i; i = i->
next) {
513 if (strcmp(i->
name,
"recordingName") == 0) {
519#if defined(AST_DEVMODE)
532 if (200 <= code && code <= 299) {
536 ast_log(
LOG_ERROR,
"Invalid error response %d for /recordings/live/{recordingName}/stop\n", code);
542 ast_log(
LOG_ERROR,
"Response validation failed for /recordings/live/{recordingName}/stop\n");
544 "Internal Server Error",
"Response validation failed");
548fin: __attribute__((unused))
567#if defined(AST_DEVMODE)
572 for (i = path_vars; i; i = i->
next) {
573 if (strcmp(i->
name,
"recordingName") == 0) {
579#if defined(AST_DEVMODE)
593 if (200 <= code && code <= 299) {
597 ast_log(
LOG_ERROR,
"Invalid error response %d for /recordings/live/{recordingName}/pause\n", code);
603 ast_log(
LOG_ERROR,
"Response validation failed for /recordings/live/{recordingName}/pause\n");
605 "Internal Server Error",
"Response validation failed");
609fin: __attribute__((unused))
628#if defined(AST_DEVMODE)
633 for (i = path_vars; i; i = i->
next) {
634 if (strcmp(i->
name,
"recordingName") == 0) {
640#if defined(AST_DEVMODE)
654 if (200 <= code && code <= 299) {
658 ast_log(
LOG_ERROR,
"Invalid error response %d for /recordings/live/{recordingName}/pause\n", code);
664 ast_log(
LOG_ERROR,
"Response validation failed for /recordings/live/{recordingName}/pause\n");
666 "Internal Server Error",
"Response validation failed");
670fin: __attribute__((unused))
689#if defined(AST_DEVMODE)
694 for (i = path_vars; i; i = i->
next) {
695 if (strcmp(i->
name,
"recordingName") == 0) {
701#if defined(AST_DEVMODE)
715 if (200 <= code && code <= 299) {
719 ast_log(
LOG_ERROR,
"Invalid error response %d for /recordings/live/{recordingName}/mute\n", code);
725 ast_log(
LOG_ERROR,
"Response validation failed for /recordings/live/{recordingName}/mute\n");
727 "Internal Server Error",
"Response validation failed");
731fin: __attribute__((unused))
750#if defined(AST_DEVMODE)
755 for (i = path_vars; i; i = i->
next) {
756 if (strcmp(i->
name,
"recordingName") == 0) {
762#if defined(AST_DEVMODE)
776 if (200 <= code && code <= 299) {
780 ast_log(
LOG_ERROR,
"Invalid error response %d for /recordings/live/{recordingName}/mute\n", code);
786 ast_log(
LOG_ERROR,
"Response validation failed for /recordings/live/{recordingName}/mute\n");
788 "Internal Server Error",
"Response validation failed");
792fin: __attribute__((unused))
915 .
requires =
"res_ari,res_ari_model,res_stasis,res_stasis_recording",
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.
void ast_ari_response_alloc_failed(struct ast_ari_response *response)
Fill in response with a 500 message for allocation failures.
int ast_ari_add_handler(struct stasis_rest_handlers *handler)
int ast_ari_validate_live_recording(struct ast_json *json)
Validator for LiveRecording.
ari_validator ast_ari_validate_stored_recording_fn(void)
Function pointer to ast_ari_validate_stored_recording().
int ast_ari_validate_stored_recording(struct ast_json *json)
Validator for StoredRecording.
Generated file - Build validators for ARI model objects.
int ast_ari_validate_void(struct ast_json *json)
Validator for native Swagger void.
int ast_ari_validate_list(struct ast_json *json, int(*fn)(struct ast_json *))
Validator for a Swagger List[]/JSON array.
Asterisk main include file. File version handling, generic pbx functions.
Application convenience functions, designed to give consistent look and feel to Asterisk apps.
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.
Asterisk module definitions.
#define AST_MODULE_INFO(keystr, flags_to_set, desc, fields...)
@ AST_MODULE_SUPPORT_CORE
#define ASTERISK_GPL_KEY
The text the key() function should return.
@ AST_MODULE_LOAD_SUCCESS
@ AST_MODULE_LOAD_DECLINE
Module has failed to load, may be in an inconsistent state.
static struct stasis_rest_handlers recordings_stored_recordingName_copy
REST handler for /api-docs/recordings.json.
int ast_ari_recordings_copy_stored_parse_body(struct ast_json *body, struct ast_ari_recordings_copy_stored_args *args)
Body parsing function for /recordings/stored/{recordingName}/copy.
static void ast_ari_recordings_delete_stored_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 /recordings/stored/{recordingName}.
static struct stasis_rest_handlers recordings_stored
REST handler for /api-docs/recordings.json.
static struct stasis_rest_handlers recordings_live_recordingName_mute
REST handler for /api-docs/recordings.json.
static void ast_ari_recordings_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 /recordings/live/{recordingName}/stop.
static void ast_ari_recordings_unmute_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 /recordings/live/{recordingName}/mute.
static void ast_ari_recordings_unpause_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 /recordings/live/{recordingName}/pause.
static void ast_ari_recordings_list_stored_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 /recordings/stored.
static void ast_ari_recordings_get_stored_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 /recordings/stored/{recordingName}.
static void ast_ari_recordings_get_stored_file_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 /recordings/stored/{recordingName}/file.
static struct stasis_rest_handlers recordings_live
REST handler for /api-docs/recordings.json.
static struct stasis_rest_handlers recordings_stored_recordingName
REST handler for /api-docs/recordings.json.
static struct stasis_rest_handlers recordings_live_recordingName_pause
REST handler for /api-docs/recordings.json.
static void ast_ari_recordings_copy_stored_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 /recordings/stored/{recordingName}/copy.
static void ast_ari_recordings_cancel_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 /recordings/live/{recordingName}.
static struct stasis_rest_handlers recordings_stored_recordingName_file
REST handler for /api-docs/recordings.json.
static struct stasis_rest_handlers recordings_live_recordingName
REST handler for /api-docs/recordings.json.
static void ast_ari_recordings_mute_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 /recordings/live/{recordingName}/mute.
static void ast_ari_recordings_pause_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 /recordings/live/{recordingName}/pause.
static int load_module(void)
static int unload_module(void)
static struct stasis_rest_handlers recordings
REST handler for /api-docs/recordings.json.
static void ast_ari_recordings_get_live_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 /recordings/live/{recordingName}.
static struct stasis_rest_handlers recordings_live_recordingName_stop
REST handler for /api-docs/recordings.json.
void ast_ari_recordings_unmute(struct ast_variable *headers, struct ast_ari_recordings_unmute_args *args, struct ast_ari_response *response)
Unmute a live recording.
void ast_ari_recordings_cancel(struct ast_variable *headers, struct ast_ari_recordings_cancel_args *args, struct ast_ari_response *response)
Stop a live recording and discard it.
void ast_ari_recordings_pause(struct ast_variable *headers, struct ast_ari_recordings_pause_args *args, struct ast_ari_response *response)
Pause a live recording.
void ast_ari_recordings_copy_stored(struct ast_variable *headers, struct ast_ari_recordings_copy_stored_args *args, struct ast_ari_response *response)
Copy a stored recording.
void ast_ari_recordings_unpause(struct ast_variable *headers, struct ast_ari_recordings_unpause_args *args, struct ast_ari_response *response)
Unpause a live recording.
void ast_ari_recordings_mute(struct ast_variable *headers, struct ast_ari_recordings_mute_args *args, struct ast_ari_response *response)
Mute a live recording.
void ast_ari_recordings_delete_stored(struct ast_variable *headers, struct ast_ari_recordings_delete_stored_args *args, struct ast_ari_response *response)
Delete a stored recording.
void ast_ari_recordings_get_stored(struct ast_variable *headers, struct ast_ari_recordings_get_stored_args *args, struct ast_ari_response *response)
Get a stored recording's details.
void ast_ari_recordings_get_live(struct ast_variable *headers, struct ast_ari_recordings_get_live_args *args, struct ast_ari_response *response)
List live recordings.
void ast_ari_recordings_get_stored_file(struct ast_tcptls_session_instance *ser, struct ast_variable *headers, struct ast_ari_recordings_get_stored_file_args *args, struct ast_ari_response *response)
Get the file associated with the stored recording.
void ast_ari_recordings_list_stored(struct ast_variable *headers, struct ast_ari_recordings_list_stored_args *args, struct ast_ari_response *response)
List recordings that are complete.
void ast_ari_recordings_stop(struct ast_variable *headers, struct ast_ari_recordings_stop_args *args, struct ast_ari_response *response)
Stop a live recording and store it.
Generated file - declares stubs to be implemented in res/ari/resource_recordings.c.
Stasis Application API. See Stasis Application API for detailed documentation.
struct ast_json * message
Abstract JSON element (object, array, string, int, ...).
describes a server instance
Structure for variables, used for configurations and for channel variables.
struct ast_variable * next
Handler for a single RESTful path segment.
const char * path_segment