Channel monitoring. More...
Go to the source code of this file.
Data Structures | |
struct | ast_channel_monitor |
Macros | |
#define | X_JOIN 4 |
#define | X_REC_IN 1 |
#define | X_REC_OUT 2 |
Enumerations | |
enum | AST_MONITORING_STATE { AST_MONITOR_RUNNING, AST_MONITOR_PAUSED } |
Functions | |
int | ast_monitor_change_fname (struct ast_channel *chan, const char *fname_base, int need_lock) |
Change monitored filename of channel. More... | |
int | ast_monitor_pause (struct ast_channel *chan) |
Pause monitoring of channel. More... | |
void | ast_monitor_setjoinfiles (struct ast_channel *chan, int turnon) |
int | ast_monitor_start (struct ast_channel *chan, const char *format_spec, const char *fname_base, int need_lock, int stream_action) |
Start monitoring a channel. More... | |
int | ast_monitor_stop (struct ast_channel *chan, int need_lock) |
Stop monitoring channel. More... | |
int | ast_monitor_unpause (struct ast_channel *chan) |
Unpause monitoring of channel. More... | |
Channel monitoring.
Definition in file monitor.h.
#define X_JOIN 4 |
Definition at line 37 of file monitor.h.
Referenced by start_monitor_exec().
#define X_REC_IN 1 |
Definition at line 35 of file monitor.h.
Referenced by __agent_start_monitoring(), ast_monitor_start(), start_monitor_action(), start_monitor_exec(), and try_calling().
#define X_REC_OUT 2 |
Definition at line 36 of file monitor.h.
Referenced by __agent_start_monitoring(), ast_monitor_start(), start_monitor_action(), start_monitor_exec(), and try_calling().
enum AST_MONITORING_STATE |
Enumerator | |
---|---|
AST_MONITOR_RUNNING | |
AST_MONITOR_PAUSED |
Definition at line 29 of file monitor.h.
int ast_monitor_change_fname | ( | struct ast_channel * | chan, |
const char * | fname_base, | ||
int | need_lock | ||
) |
Change monitored filename of channel.
chan | |
fname_base | new filename |
need_lock |
0 | on success. |
-1 | on failure. |
Remember, also, that we're using the basename of the file (i.e. the file without the format suffix), so it does not already exist and we aren't interfering with the recording itself.
Definition at line 566 of file res_monitor.c.
References ast_config_AST_MONITOR_DIR, ast_copy_string(), ast_debug, ast_log(), ast_mkdir(), ast_strdupa, ast_strlen_zero(), doexit, errno, ast_channel_monitor::filename_base, ast_channel_monitor::filename_changed, LOCK_IF_NEEDED, LOG_ERROR, LOG_WARNING, ast_channel::monitor, name, ast_channel::name, and UNLOCK_IF_NEEDED.
Referenced by change_monitor_action(), change_monitor_exec(), start_monitor_action(), and start_monitor_exec().
int ast_monitor_pause | ( | struct ast_channel * | chan | ) |
Pause monitoring of channel.
Definition at line 535 of file res_monitor.c.
References AST_MONITOR_PAUSED, and ast_monitor_set_state().
Referenced by do_pause_or_unpause(), and pause_monitor_exec().
void ast_monitor_setjoinfiles | ( | struct ast_channel * | chan, |
int | turnon | ||
) |
Definition at line 867 of file res_monitor.c.
References ast_channel_monitor::joinfiles, and ast_channel::monitor.
Referenced by __agent_start_monitoring(), start_monitor_action(), start_monitor_exec(), and try_calling().
int ast_monitor_start | ( | struct ast_channel * | chan, |
const char * | format_spec, | ||
const char * | fname_base, | ||
int | need_lock, | ||
int | stream_action | ||
) |
Start monitoring a channel.
chan | ast_channel struct to record |
format_spec | file format to use for recording |
fname_base | filename base to record to |
need_lock | whether to lock the channel mutex |
stream_action | whether to record the input and/or output streams. X_REC_IN | X_REC_OUT is most often used Creates the file to record, if no format is specified it assumes WAV It also sets channel variable __MONITORED=yes |
0 | on success |
-1 | on failure |
Definition at line 290 of file res_monitor.c.
References ast_calloc, ast_closestream(), ast_config_AST_MONITOR_DIR, ast_debug, AST_FILE_MODE, ast_filedelete(), ast_fileexists(), ast_free, ast_log(), ast_manager_event, ast_mkdir(), AST_MONITOR_RUNNING, ast_monitor_set_state(), ast_monitor_stop(), ast_mutex_lock, ast_mutex_unlock, ast_strdup, ast_strdupa, ast_strlen_zero(), ast_writefile(), EVENT_FLAG_CALL, ast_channel_monitor::filename_base, ast_channel_monitor::filename_changed, FILENAME_MAX, ast_channel_monitor::format, LOCK_IF_NEEDED, LOG_WARNING, monitor, ast_channel::monitor, monitorlock, name, ast_channel::name, pbx_builtin_setvar_helper(), ast_channel_monitor::read_filename, ast_channel_monitor::read_stream, ast_channel_monitor::stop, ast_channel::uniqueid, UNLOCK_IF_NEEDED, ast_channel_monitor::write_filename, ast_channel_monitor::write_stream, X_REC_IN, and X_REC_OUT.
Referenced by __agent_start_monitoring(), start_monitor_action(), start_monitor_exec(), and try_calling().
int ast_monitor_stop | ( | struct ast_channel * | chan, |
int | need_lock | ||
) |
Stop monitoring channel.
chan | |
need_lock | Stop the recording, close any open streams, mix in/out channels if required |
Definition at line 437 of file res_monitor.c.
References ast_closestream(), ast_copy_string(), ast_debug, ast_filedelete(), ast_fileexists(), ast_filerename(), ast_free, ast_log(), ast_manager_event, ast_safe_system(), ast_strlen_zero(), EVENT_FLAG_CALL, ast_channel_monitor::filename_base, ast_channel_monitor::filename_changed, FILENAME_MAX, ast_channel_monitor::format, format, get_soxmix_format(), ast_channel_monitor::joinfiles, LOCK_IF_NEEDED, LOG_WARNING, ast_channel::monitor, ast_channel::name, pbx_builtin_getvar_helper(), pbx_builtin_setvar_helper(), ast_channel_monitor::read_filename, ast_channel_monitor::read_stream, ast_channel::uniqueid, UNLOCK_IF_NEEDED, ast_channel_monitor::write_filename, and ast_channel_monitor::write_stream.
Referenced by ast_monitor_start(), stop_monitor_action(), and stop_monitor_exec().
int ast_monitor_unpause | ( | struct ast_channel * | chan | ) |
Unpause monitoring of channel.
Definition at line 541 of file res_monitor.c.
References AST_MONITOR_RUNNING, and ast_monitor_set_state().
Referenced by do_pause_or_unpause(), and unpause_monitor_exec().