84 args->recording_name);
85 if (recording ==
NULL) {
87 "Recording not found");
94 "Internal Server Error",
"Error building response");
121 "Recording not found");
128 "Format specified by recording not available or loaded");
133 if (response->
fd < 0) {
135 "Recording could not be opened");
157 args->recording_name);
158 if (src_recording ==
NULL) {
160 "Recording not found");
165 args->destination_recording_name);
168 "A recording with the same name already exists on the system");
176 "Invalid destination recording name");
180 "Destination file path is forbidden");
187 args->destination_recording_name, &dst_recording);
193 "Internal Server Error",
198 "Unexpected error copying recording %s to %s: %s\n",
199 args->recording_name,
args->destination_recording_name, strerror(
errno));
201 "Internal Server Error",
211 "Internal Server Error",
"Error building response");
227 args->recording_name);
228 if (recording ==
NULL) {
230 "Recording not found");
241 "Internal Server Error",
246 "Unexpected error deleting recording %s: %s\n",
249 "Internal Server Error",
267 if (recording ==
NULL) {
269 "Recording not found");
276 "Internal Server Error",
"Error building response");
291 if (recording ==
NULL) {
293 "Recording not found");
305 "Internal Server Error",
"Recording operation failed");
309 "Conflict",
"Recording not in session");
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_ok(struct ast_ari_response *response, struct ast_json *message)
Fill in an OK (200) ast_ari_response.
void ast_ari_response_alloc_failed(struct ast_ari_response *response)
Fill in response with a 500 message for allocation failures.
void ast_ari_response_no_content(struct ast_ari_response *response)
Fill in a No Content (204) ast_ari_response.
Asterisk main include file. File version handling, generic pbx functions.
#define ao2_iterator_next(iter)
struct ao2_iterator ao2_iterator_init(struct ao2_container *c, int flags) attribute_warn_unused_result
Create an iterator for a container.
void ao2_iterator_destroy(struct ao2_iterator *iter)
Destroy a container iterator.
struct ast_format * ast_get_format_for_file_ext(const char *file_ext)
Get the ast_format associated with the given file extension.
struct ast_json * ast_json_null(void)
Get the JSON null value.
void ast_json_unref(struct ast_json *value)
Decrease refcount on value. If refcount reaches zero, value is freed.
int ast_json_array_append(struct ast_json *array, struct ast_json *value)
Append to an array.
struct ast_json * ast_json_array_create(void)
Create a empty JSON array.
struct ast_json * ast_json_ref(struct ast_json *value)
Increase refcount on value.
static struct stasis_rest_handlers recordings
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.
static void control_recording(const char *name, enum stasis_app_recording_media_operation operation, struct ast_ari_response *response)
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 Recording API. See StasisApplication API" for detailed documentation.
const char * stasis_app_stored_recording_get_filename(struct stasis_app_stored_recording *recording)
Returns the full filename, with extension, for this recording.
struct ast_json * stasis_app_recording_to_json(const struct stasis_app_recording *recording)
Construct a JSON model of a recording.
struct ao2_container * stasis_app_stored_recording_find_all(void)
Find all stored recordings on disk.
struct ast_json * stasis_app_stored_recording_to_json(struct stasis_app_stored_recording *recording)
Convert stored recording info to JSON.
struct stasis_app_stored_recording * stasis_app_stored_recording_find_by_name(const char *name)
Creates a stored recording object, with the given name.
struct stasis_app_recording * stasis_app_recording_find_by_name(const char *name)
Finds the recording object with the given name.
int stasis_app_stored_recording_delete(struct stasis_app_stored_recording *recording)
Delete a recording from disk.
enum stasis_app_recording_oper_results stasis_app_recording_operation(struct stasis_app_recording *recording, enum stasis_app_recording_media_operation operation)
Controls the media for a given recording operation.
stasis_app_recording_oper_results
Possible results from a recording operation.
@ STASIS_APP_RECORDING_OPER_NOT_RECORDING
@ STASIS_APP_RECORDING_OPER_FAILED
@ STASIS_APP_RECORDING_OPER_OK
const char * stasis_app_stored_recording_get_extension(struct stasis_app_stored_recording *recording)
Returns the extension for this recording.
int stasis_app_stored_recording_copy(struct stasis_app_stored_recording *src_recording, const char *dst, struct stasis_app_stored_recording **dst_recording)
Copy a recording.
stasis_app_recording_media_operation
@ STASIS_APP_RECORDING_PAUSE
@ STASIS_APP_RECORDING_UNPAUSE
@ STASIS_APP_RECORDING_UNMUTE
@ STASIS_APP_RECORDING_STOP
@ STASIS_APP_RECORDING_MUTE
@ STASIS_APP_RECORDING_CANCEL
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
When we need to walk through a container, we use an ao2_iterator to keep track of the current positio...
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.
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.