Asterisk - The Open Source Telephony Project
18.5.0
|
Stasis Application Recording API. See StasisApplication API" for detailed documentation. More...
Go to the source code of this file.
Data Structures | |
struct | stasis_app_recording_options |
Stasis Application Recording API. See StasisApplication API" for detailed documentation.
Definition in file stasis_app_recording.h.
#define STASIS_APP_RECORDING_TERMINATE_ANY -2 |
Definition at line 174 of file stasis_app_recording.h.
Referenced by record_file(), and stasis_app_recording_termination_parse().
#define STASIS_APP_RECORDING_TERMINATE_INVALID 0 |
Definition at line 172 of file stasis_app_recording.h.
Referenced by ast_ari_bridges_record(), ast_ari_channels_record(), record_file(), and stasis_app_recording_termination_parse().
#define STASIS_APP_RECORDING_TERMINATE_NONE -1 |
Definition at line 173 of file stasis_app_recording.h.
Referenced by record_file(), and stasis_app_recording_termination_parse().
Valid operation for controlling a recording.
Definition at line 155 of file stasis_app_recording.h.
Possible results from a recording operation.
Definition at line 292 of file stasis_app_recording.h.
State of a recording operation
Definition at line 137 of file stasis_app_recording.h.
struct stasis_app_recording* stasis_app_control_record | ( | struct stasis_app_control * | control, |
struct stasis_app_recording_options * | options | ||
) |
Record media from a channel.
A reference to the options object may be kept, so it MUST NOT be modified after calling this function.
On error, errno
is set to indicate the failure reason.
EINVAL:
Invalid input.EEXIST:
A recording with that name is in session.ENOMEM:
Out of memory.control | Control for res_stasis . |
options | Recording options. |
NULL
on error. Definition at line 370 of file res_stasis_recording.c.
References stasis_app_recording::absolute_name, ao2_alloc, ao2_bump, ao2_cleanup, ao2_find, ao2_link, ao2_ref, ast_asprintf, ast_config_AST_RECORDING_DIR, ast_debug, ast_fileexists(), ast_log, AST_RECORD_IF_EXISTS_FAIL, ast_safe_mkdir(), ast_strlen_zero, stasis_app_recording::control, stasis_app_recording::duration, stasis_app_recording::energy_only, errno, stasis_app_recording_options::format, stasis_app_recording_options::if_exists, lock, LOG_WARNING, stasis_app_recording_options::max_duration_seconds, stasis_app_recording_options::max_silence_seconds, stasis_app_recording_options::name, NULL, OBJ_KEY, OBJ_NOLOCK, stasis_app_recording::options, RAII_VAR, record_file(), recording_cleanup(), recording_dtor(), SCOPED_AO2LOCK, stasis_app_control_get_channel_id(), stasis_app_control_register_add_rule(), STASIS_APP_RECORDING_STATE_QUEUED, stasis_app_send_command_async(), stasis_app_recording::state, and stasis_app_recording::total.
Referenced by ast_ari_bridges_record(), and ast_ari_channels_record().
struct stasis_app_recording* stasis_app_recording_find_by_name | ( | const char * | name | ) |
Finds the recording object with the given name.
name | Name of the recording object to find. |
NULL
if name not found. Definition at line 473 of file res_stasis_recording.c.
References ao2_find, and OBJ_KEY.
Referenced by ast_ari_recordings_get_live(), and control_recording().
const char* stasis_app_recording_get_name | ( | struct stasis_app_recording * | recording | ) |
Gets the unique name of a recording object.
recording | Recording control object. |
NULL
if recording ic NULL
Definition at line 467 of file res_stasis_recording.c.
References stasis_app_recording_options::name, and stasis_app_recording::options.
enum stasis_app_recording_state stasis_app_recording_get_state | ( | struct stasis_app_recording * | recording | ) |
Gets the current state of a recording operation.
recording | Recording control object. |
Definition at line 461 of file res_stasis_recording.c.
References stasis_app_recording::state.
enum ast_record_if_exists stasis_app_recording_if_exists_parse | ( | const char * | str | ) |
Parse a string into the if_exists enum.
str | String to parse. |
Definition at line 194 of file res_stasis_recording.c.
References AST_RECORD_IF_EXISTS_APPEND, AST_RECORD_IF_EXISTS_ERROR, AST_RECORD_IF_EXISTS_FAIL, AST_RECORD_IF_EXISTS_OVERWRITE, and ast_strlen_zero.
Referenced by ast_ari_bridges_record(), and ast_ari_channels_record().
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.
recording | Recording control object. |
control | Media control operation. |
STASIS_APP_RECORDING_OPER_OK
on success. Definition at line 590 of file res_stasis_recording.c.
References ast_log, lock, LOG_ERROR, LOG_WARNING, operations, SCOPED_AO2LOCK, STASIS_APP_RECORDING_OPER_FAILED, STASIS_APP_RECORDING_OPER_MAX, STASIS_APP_RECORDING_OPER_NOT_RECORDING, STASIS_APP_RECORDING_OPER_OK, STASIS_APP_RECORDING_STATE_MAX, STASIS_APP_RECORDING_STATE_RECORDING, and stasis_app_recording::state.
Referenced by control_recording().
struct stasis_app_recording_options* stasis_app_recording_options_create | ( | const char * | name, |
const char * | format | ||
) |
Allocate a recording options object.
Clean up with ao2_cleanup().
name | Name of the recording. |
format | Format to record in. |
NULL
on error. Definition at line 151 of file res_stasis_recording.c.
References ao2_alloc, ao2_cleanup, ao2_ref, ast_string_field_init, ast_string_field_set, NULL, stasis_app_recording::options, RAII_VAR, and recording_options_dtor().
Referenced by ast_ari_bridges_record(), and ast_ari_channels_record().
struct stasis_message_type* stasis_app_recording_snapshot_type | ( | void | ) |
Message type for recording updates. The data is an ast_channel_blob.
Referenced by load_module(), recording_publish(), recording_to_json(), and unload_module().
char stasis_app_recording_termination_parse | ( | const char * | str | ) |
Parse a string into the recording termination enum.
str | String to parse. |
STASIS_APP_RECORDING_TERMINATE_NONE
to not terminate on DTMF. STASIS_APP_RECORDING_TERMINATE_ANY
to terminate on any DTMF. STASIS_APP_RECORDING_TERMINATE_INVALID
if input was invalid. Definition at line 169 of file res_stasis_recording.c.
References ast_strlen_zero, STASIS_APP_RECORDING_TERMINATE_ANY, STASIS_APP_RECORDING_TERMINATE_INVALID, and STASIS_APP_RECORDING_TERMINATE_NONE.
Referenced by ast_ari_bridges_record(), and ast_ari_channels_record().
struct ast_json* stasis_app_recording_to_json | ( | const struct stasis_app_recording * | recording | ) |
Construct a JSON model of a recording.
recording | Recording to conver. |
NULL
on error. Definition at line 478 of file res_stasis_recording.c.
References ast_json_integer_create(), ast_json_object_set(), ast_json_pack(), ast_json_ref(), ast_json_unref(), stasis_app_recording::duration, stasis_app_recording::energy_only, stasis_app_recording_options::format, stasis_app_recording_options::name, NULL, stasis_app_recording::options, RAII_VAR, stasis_app_recording::state, state_to_string(), stasis_app_recording_options::target, and stasis_app_recording::total.
Referenced by ast_ari_bridges_record(), ast_ari_channels_record(), ast_ari_recordings_get_live(), and recording_publish().
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.
src_recording | The recording to copy |
dst | The destination of the recording to make |
dst_recording | If successful, the stored recording created as a result of the copy |
0 | on success |
Non-zero | on error |
Definition at line 389 of file stored.c.
Referenced by ast_ari_recordings_copy_stored().
int stasis_app_stored_recording_delete | ( | struct stasis_app_stored_recording * | recording | ) |
Delete a recording from disk.
recording | Recording to delete. |
Definition at line 439 of file stored.c.
Referenced by ast_ari_recordings_delete_stored().
struct ao2_container* stasis_app_stored_recording_find_all | ( | void | ) |
Find all stored recordings on disk.
NULL
on error. Definition at line 290 of file stored.c.
References AO2_ALLOC_OPT_LOCK_NOLOCK, AO2_CONTAINER_ALLOC_OPT_DUPS_REPLACE, ao2_container_alloc_rbtree, ao2_ref, ast_config_AST_RECORDING_DIR, ast_file_read_dirs(), handle_scan_file(), NULL, recording_sort(), and recordings.
Referenced by ast_ari_recordings_list_stored().
struct stasis_app_stored_recording* stasis_app_stored_recording_find_by_name | ( | const char * | name | ) |
Creates a stored recording object, with the given name.
name | Name of the recording. |
NULL
if recording is not found. errno
is set to indicate whyENOMEM
- out of memeoryEACCES
- file permissions (or recording is outside the config dir)Definition at line 310 of file stored.c.
References ao2_cleanup, ast_begins_with(), ast_config_AST_RECORDING_DIR, ast_free, ast_log, ast_std_free(), ast_string_field_build, ast_string_field_set, errno, stasis_app_stored_recording::file, stasis_app_stored_recording::file_with_ext, find_recording(), LOG_WARNING, NULL, RAII_VAR, recording_alloc(), and split_path().
Referenced by ast_ari_recordings_copy_stored(), ast_ari_recordings_delete_stored(), ast_ari_recordings_get_stored(), ast_ari_recordings_get_stored_file(), and play_on_channel().
const char* stasis_app_stored_recording_get_extension | ( | struct stasis_app_stored_recording * | recording | ) |
Returns the extension for this recording.
recording | Recording to query. |
NULL
on error Definition at line 71 of file stored.c.
References stasis_app_stored_recording::format, and NULL.
Referenced by ast_ari_recordings_get_stored_file().
const char* stasis_app_stored_recording_get_file | ( | struct stasis_app_stored_recording * | recording | ) |
Returns the filename for this recording, for use with streamfile.
The returned string will be valid until the recording object is freed.
recording | Recording to query. |
NULL
on error. Definition at line 53 of file stored.c.
References stasis_app_stored_recording::file, and NULL.
Referenced by play_on_channel().
const char* stasis_app_stored_recording_get_filename | ( | struct stasis_app_stored_recording * | recording | ) |
Returns the full filename, with extension, for this recording.
recording | Recording to query. |
NULL
on error Definition at line 62 of file stored.c.
References stasis_app_stored_recording::file_with_ext, and NULL.
Referenced by ast_ari_recordings_get_stored_file().
struct ast_json* stasis_app_stored_recording_to_json | ( | struct stasis_app_stored_recording * | recording | ) |
Convert stored recording info to JSON.
recording | Recording to convert. |
NULL
on error. Definition at line 446 of file stored.c.
References ast_json_pack(), stasis_app_stored_recording::file_with_ext, stasis_app_stored_recording::format, stasis_app_stored_recording::name, and NULL.
Referenced by ast_ari_recordings_copy_stored(), ast_ari_recordings_get_stored(), and ast_ari_recordings_list_stored().