48 #if defined(AST_DEVMODE)
69 #if defined(AST_DEVMODE)
75 #if defined(AST_DEVMODE)
80 is_valid = response->
message == NULL;
87 if (200 <= code && code <= 299) {
91 ast_log(LOG_ERROR,
"Invalid error response %d for /recordings/stored\n", code);
97 ast_log(LOG_ERROR,
"Response validation failed for /recordings/stored\n");
99 "Internal Server Error",
"Response validation failed");
103 fin: __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)
139 is_valid = response->
message == NULL;
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");
163 fin: __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)
199 is_valid = response->
message == NULL;
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");
223 fin: __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)
259 is_valid = response->
message == NULL;
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");
284 fin: __attribute__((unused))
316 #if defined(AST_DEVMODE)
321 for (i = get_params; i; i = i->
next) {
322 if (strcmp(i->
name,
"destinationRecordingName") == 0) {
327 for (i = path_vars; i; i = i->
next) {
328 if (strcmp(i->
name,
"recordingName") == 0) {
338 #if defined(AST_DEVMODE)
343 is_valid = response->
message == NULL;
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");
368 fin: __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)
404 is_valid = response->
message == NULL;
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");
428 fin: __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)
464 is_valid = response->
message == NULL;
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");
488 fin: __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)
524 is_valid = response->
message == NULL;
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");
548 fin: __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)
584 is_valid = response->
message == NULL;
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");
609 fin: __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)
645 is_valid = response->
message == NULL;
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");
670 fin: __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)
706 is_valid = response->
message == NULL;
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");
731 fin: __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)
767 is_valid = response->
message == NULL;
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");
792 fin: __attribute__((unused))
891 static int unload_module(
void)
897 static int load_module(
void)
911 AST_MODULE_INFO(
ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT,
"RESTful API module - Recording resources",
912 .support_level = AST_MODULE_SUPPORT_CORE,
914 .unload = unload_module,
915 .requires =
"res_ari,res_ari_model,res_stasis,res_stasis_recording",
struct ast_variable * next
Asterisk main include file. File version handling, generic pbx functions.
const char * destination_recording_name
static struct stasis_rest_handlers recordings_live
REST handler for /api-docs/recordings.json.
const char * recording_name
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_pause(struct ast_variable *headers, struct ast_ari_recordings_pause_args *args, struct ast_ari_response *response)
Pause a live recording.
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}.
Structure for variables, used for configurations and for channel variables.
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_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 struct stasis_rest_handlers recordings_live_recordingName
REST handler for /api-docs/recordings.json.
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}.
Generated file - Build validators for ARI model objects.
void ast_ari_response_alloc_failed(struct ast_ari_response *response)
Fill in response with a 500 message for allocation failures.
const char * recording_name
int ast_ari_validate_void(struct ast_json *json)
Validator for native Swagger void.
static struct stasis_rest_handlers recordings_stored_recordingName_file
REST handler for /api-docs/recordings.json.
const char * recording_name
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 struct stasis_rest_handlers recordings_live_recordingName_stop
REST handler for /api-docs/recordings.json.
static struct stasis_rest_handlers recordings
REST handler for /api-docs/recordings.json.
static struct stasis_rest_handlers recordings_stored_recordingName_copy
REST handler for /api-docs/recordings.json.
const char * ast_json_string_get(const struct ast_json *string)
Get the value of a JSON string.
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.
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.
describes a server instance
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.
const char * recording_name
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.
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 struct stasis_rest_handlers recordings_stored
REST handler for /api-docs/recordings.json.
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_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.
int ast_ari_add_handler(struct stasis_rest_handlers *handler)
const char * recording_name
static struct stasis_rest_handlers recordings_live_recordingName_pause
REST handler for /api-docs/recordings.json.
const char * recording_name
int ast_ari_remove_handler(struct stasis_rest_handlers *handler)
const char * recording_name
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.
static struct stasis_rest_handlers recordings_live_recordingName_mute
REST handler for /api-docs/recordings.json.
Module has failed to load, may be in an inconsistent state.
const char * recording_name
ari_validator ast_ari_validate_stored_recording_fn(void)
Function pointer to ast_ari_validate_stored_recording().
int ast_ari_validate_live_recording(struct ast_json *json)
Validator for LiveRecording.
struct ast_json * message
const char * recording_name
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 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.
const char * path_segment
const char * recording_name
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 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.
struct ast_json * ast_json_object_get(struct ast_json *object, const char *key)
Get a field from a JSON object.
Generated file - declares stubs to be implemented in res/ari/resource_recordings.c.
Abstract JSON element (object, array, string, int, ...).
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.
Stasis Application API. See Stasis Application API for detailed documentation.
int ast_ari_validate_list(struct ast_json *json, int(*fn)(struct ast_json *))
Validator for a Swagger List[]/JSON array.
#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...
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.
static struct stasis_rest_handlers recordings_stored_recordingName
REST handler for /api-docs/recordings.json.
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.
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.
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.
Handler for a single RESTful path segment.
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.
const char * recording_name
int ast_ari_validate_stored_recording(struct ast_json *json)
Validator for StoredRecording.
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.