Asterisk - The Open Source Telephony Project
21.4.1
|
Generic File Format Support. Should be included by clients of the file handling routines. File service providers should instead include mod_format.h. More...
#include <fcntl.h>
#include <sys/mman.h>
Go to the source code of this file.
Macros | |
#define | AST_DIGIT_ANY "0123456789#*ABCD" |
#define | AST_DIGIT_ANYNUM "0123456789" |
#define | AST_DIGIT_NONE "" |
#define | ast_file_read_dir(dir_name, on_file, obj) ast_file_read_dirs(dir_name, on_file, obj, 1) |
Iterate over each file in a given directory. More... | |
#define | AST_MAX_FORMATS 10 |
#define | AST_RESERVED_POINTERS 20 |
#define | SEEK_FORCECUR 10 |
Typedefs | |
typedef int(* | ast_file_on_file) (const char *dir_name, const char *filename, void *obj) |
Callback called for each file found when reading directories. More... | |
typedef void( | ast_waitstream_fr_cb) (struct ast_channel *chan, long ms, enum ast_waitstream_fr_cb_values val) |
callback used during dtmf controlled file playback to indicate location of playback in a file after rewinding or fastforwarding a file. | |
Enumerations | |
enum | ast_waitstream_fr_cb_values { AST_WAITSTREAM_CB_REWIND = 1, AST_WAITSTREAM_CB_FASTFORWARD, AST_WAITSTREAM_CB_START } |
Functions | |
int | ast_applystream (struct ast_channel *chan, struct ast_filestream *s) |
Applies a open stream to a channel. More... | |
int | ast_closestream (struct ast_filestream *f) |
Closes a stream. More... | |
int | ast_file_fdtemp (const char *path, char **filename, const char *template_name) |
Create a temporary file located at path. More... | |
int | ast_file_init (void) |
FILE * | ast_file_mkftemp (char *template_name, mode_t mode) |
same as mkstemp, but return a FILE More... | |
int | ast_file_read_dirs (const char *dir_name, ast_file_on_file on_file, void *obj, int max_depth) |
Recursively iterate through files and directories up to max_depth. More... | |
int | ast_filecopy (const char *oldname, const char *newname, const char *fmt) |
Copies a file. More... | |
int | ast_filedelete (const char *filename, const char *fmt) |
Deletes a file. More... | |
int | ast_fileexists (const char *filename, const char *fmt, const char *preflang) |
Checks for the existence of a given file. More... | |
int | ast_filerename (const char *oldname, const char *newname, const char *fmt) |
Renames a file. More... | |
char * | ast_format_str_reduce (char *fmts) |
int | ast_get_extension_for_mime_type (const char *mime_type, char *buffer, size_t capacity) |
Get a suitable filename extension for the given MIME type. More... | |
struct ast_format * | ast_get_format_for_file_ext (const char *file_ext) |
Get the ast_format associated with the given file extension. More... | |
struct ast_filestream * | ast_openstream (struct ast_channel *chan, const char *filename, const char *preflang) |
Opens stream for use in seeking, playing. More... | |
struct ast_filestream * | ast_openstream_full (struct ast_channel *chan, const char *filename, const char *preflang, int asis) |
Opens stream for use in seeking, playing. More... | |
struct ast_filestream * | ast_openvstream (struct ast_channel *chan, const char *filename, const char *preflang) |
Opens stream for use in seeking, playing. More... | |
int | ast_playstream (struct ast_filestream *s) |
Play a open stream on a channel. More... | |
int | ast_ratestream (struct ast_filestream *fs) |
Return the sample rate of the stream's format. More... | |
struct ast_filestream * | ast_readfile (const char *filename, const char *type, const char *comment, int flags, int check, mode_t mode) |
Starts reading from a file. More... | |
struct ast_frame * | ast_readframe (struct ast_filestream *s) |
Read a frame from a filestream. More... | |
int | ast_seekstream (struct ast_filestream *fs, off_t sample_offset, int whence) |
Seeks into stream. More... | |
int | ast_stopstream (struct ast_channel *c) |
Stops a stream. More... | |
int | ast_stream_and_wait (struct ast_channel *chan, const char *file, const char *digits) |
stream file until digit If the file name is non-empty, try to play it. More... | |
int | ast_stream_fastforward (struct ast_filestream *fs, off_t ms) |
Fast forward stream ms. More... | |
int | ast_stream_rewind (struct ast_filestream *fs, off_t ms) |
Rewind stream ms. More... | |
int | ast_streamfile (struct ast_channel *c, const char *filename, const char *preflang) |
Streams a file. More... | |
off_t | ast_tellstream (struct ast_filestream *fs) |
Tell where we are in a stream. More... | |
int | ast_truncstream (struct ast_filestream *fs) |
Trunc stream at current location. More... | |
int | ast_waitstream (struct ast_channel *c, const char *breakon) |
Waits for a stream to stop or digit to be pressed. More... | |
int | ast_waitstream_exten (struct ast_channel *c, const char *context) |
Waits for a stream to stop or digit matching a valid one digit exten to be pressed. More... | |
int | ast_waitstream_fr (struct ast_channel *c, const char *breakon, const char *forward, const char *rewind, int ms) |
Same as waitstream but allows stream to be forwarded or rewound. More... | |
int | ast_waitstream_fr_w_cb (struct ast_channel *c, const char *breakon, const char *forward, const char *rewind, int ms, ast_waitstream_fr_cb cb) |
Same as waitstream_fr but allows a callback to be alerted when a user fastforwards or rewinds the file. More... | |
int | ast_waitstream_full (struct ast_channel *c, const char *breakon, int audiofd, int monfd) |
struct ast_filestream * | ast_writefile (const char *filename, const char *type, const char *comment, int flags, int check, mode_t mode) |
Starts writing a file. More... | |
int | ast_writestream (struct ast_filestream *fs, struct ast_frame *f) |
Writes a frame to a stream. More... | |
Generic File Format Support. Should be included by clients of the file handling routines. File service providers should instead include mod_format.h.
Definition in file file.h.
#define AST_DIGIT_NONE "" |
Convenient for waiting
Definition at line 47 of file file.h.
Referenced by agent_login_exec(), ast_bridge_channel_playfile(), grab_transfer(), play_file(), and stream_failsound().
#define ast_file_read_dir | ( | dir_name, | |
on_file, | |||
obj | |||
) | ast_file_read_dirs(dir_name, on_file, obj, 1) |
Iterate over each file in a given directory.
dir_name | the name of the directory to search |
on_file | callback called on each file |
obj | user data object |
errno | on failure |
0 | otherwise |
Definition at line 203 of file file.h.
Referenced by find_recording().
#define AST_MAX_FORMATS 10 |
The maximum number of formats we expect to see in a format string
Definition at line 44 of file file.h.
Referenced by __ast_play_and_record(), and ast_format_str_reduce().
typedef int(* ast_file_on_file) (const char *dir_name, const char *filename, void *obj) |
Callback called for each file found when reading directories.
dir_name | the name of the directory |
filename | the name of the file |
obj | user data object |
non-zero | to stop reading, otherwise zero to continue |
int ast_applystream | ( | struct ast_channel * | chan, |
struct ast_filestream * | s | ||
) |
Applies a open stream to a channel.
chan | channel to work |
s | ast_filestream to apply |
0 | on success. |
-1 | on failure. |
Definition at line 1057 of file file.c.
Referenced by ast_streamfile(), handle_getoption(), and speech_streamfile().
int ast_closestream | ( | struct ast_filestream * | f | ) |
Closes a stream.
f | filestream to close Close a playback or recording stream |
0 | on success. |
-1 | on failure. |
Definition at line 1111 of file file.c.
References ao2_ref.
Referenced by __ast_play_and_record(), ast_hangup(), ast_readfile(), ast_stopstream(), ast_writefile(), and handle_cli_file_convert().
int ast_file_fdtemp | ( | const char * | path, |
char ** | filename, | ||
const char * | template_name | ||
) |
Create a temporary file located at path.
path | The directory path to create the file in |
filename | Function allocates memory and stores full filename (including path) here |
template_name | mkstemp template to use. Must end with XXXXXX. |
-1 | on failure |
Definition at line 202 of file file.c.
References ast_asprintf, and ast_mkdir().
int ast_file_init | ( | void | ) |
Initialize file stuff
Initializes all the various file stuff. Basically just registers the cli stuff Returns 0 all the time
Provided by file.c
Definition at line 2051 of file file.c.
References ast_cli_register_multiple, ast_format_register_type(), ast_format_unregister_type(), ast_register_cleanup(), and STASIS_MESSAGE_TYPE_INIT.
FILE* ast_file_mkftemp | ( | char * | template_name, |
mode_t | mode | ||
) |
same as mkstemp, but return a FILE
template_name | The template for the unique file name to generate. Modified in place to return the file name. |
mode | The mode for file permissions |
Definition at line 187 of file file.c.
References ast_format_def::close.
int ast_file_read_dirs | ( | const char * | dir_name, |
ast_file_on_file | on_file, | ||
void * | obj, | ||
int | max_depth | ||
) |
Recursively iterate through files and directories up to max_depth.
dir_name | the name of the directory to search |
on_file | callback called on each file |
obj | user data object |
max_depth | re-curse into sub-directories up to a given maximum (-1 = infinite) |
-1 | on failure |
errno | on failure |
0 | otherwise |
Definition at line 1274 of file file.c.
References read_dirs_lock.
Referenced by ast_media_index_update_for_file(), and crypto_load().
int ast_filecopy | ( | const char * | oldname, |
const char * | newname, | ||
const char * | fmt | ||
) |
Copies a file.
oldname | name of the file you wish to copy (minus extension) |
newname | name you wish the file to be copied to (minus extension) |
fmt | the format of the file Copy a given file in a given format, or if fmt is NULL, then do so for all |
Definition at line 1151 of file file.c.
Referenced by copy_plain_file(), and vm_forwardoptions().
int ast_filedelete | ( | const char * | filename, |
const char * | fmt | ||
) |
Deletes a file.
filename | name of the file you wish to delete (minus the extension) |
fmt | of the file Delete a given file in a given format, or if fmt is NULL, then do so for all |
Definition at line 1141 of file file.c.
Referenced by __ast_play_and_record(), async_delete_name_rec_task(), conf_free(), confbridge_exec(), dial_exec_full(), handle_cli_file_convert(), leave_voicemail(), setup_privacy_args(), and vm_delete().
int ast_fileexists | ( | const char * | filename, |
const char * | fmt, | ||
const char * | preflang | ||
) |
Checks for the existence of a given file.
filename | name of the file you wish to check, minus the extension |
fmt | the format you wish to check (the extension) |
preflang | (the preferred language you wisht to find the file in) See if a given file exists in a given format. If fmt is NULL, any format is accepted. |
0 | The file does not exist |
1 | The file does exist. |
Definition at line 1129 of file file.c.
References ast_alloca, ast_filestream::buf, and fileexists_core().
Referenced by ast_get_character_str(), ast_get_digit_str(), ast_get_phonetic_str(), dial_exec_full(), forward_message(), get_folder(), leave_voicemail(), setup_privacy_args(), stasis_app_control_record(), and vm_tempgreeting().
int ast_filerename | ( | const char * | oldname, |
const char * | newname, | ||
const char * | fmt | ||
) |
Renames a file.
oldname | the name of the file you wish to act upon (minus the extension) |
newname | the name you wish to rename the file to (minus the extension) |
fmt | the format of the file Rename a given file in a given format, or if fmt is NULL, then do so for all |
-1 | on failure |
Definition at line 1146 of file file.c.
Referenced by __ast_play_and_record(), forward_message(), leave_voicemail(), rename_file(), and vm_forwardoptions().
char* ast_format_str_reduce | ( | char * | fmts | ) |
Remove duplicate formats from a format string.
fmts | a format string, this string will be modified |
NULL | error |
Definition at line 1894 of file file.c.
References AST_MAX_FORMATS, AST_RWLIST_RDLOCK, AST_RWLIST_UNLOCK, ast_strdupa, and ast_format_def::exts.
int ast_get_extension_for_mime_type | ( | const char * | mime_type, |
char * | buffer, | ||
size_t | capacity | ||
) |
Get a suitable filename extension for the given MIME type.
mime_type | The MIME type for which to find extensions |
buffer | A pointer to a buffer to receive the extension |
capacity | The size of 'buffer' in bytes |
1 | if an extension was found for the provided MIME type |
0 | if the MIME type was not found |
Definition at line 2019 of file file.c.
References ast_format_def::exts, lock, ast_format_def::mime_types, and SCOPED_RDLOCK.
struct ast_format* ast_get_format_for_file_ext | ( | const char * | file_ext | ) |
Get the ast_format associated with the given file extension.
file_ext | The file extension for which to find the format |
NULL | if not found |
Definition at line 2006 of file file.c.
References ast_format_def::exts, ast_format_def::format, lock, and SCOPED_RDLOCK.
Referenced by ast_ari_bridges_record(), ast_ari_channels_record(), ast_ari_recordings_get_stored_file(), and process_media_file().
struct ast_filestream* ast_openstream | ( | struct ast_channel * | chan, |
const char * | filename, | ||
const char * | preflang | ||
) |
Opens stream for use in seeking, playing.
chan | channel to work with |
filename | to use |
preflang | prefered language to use |
NULL | on error. |
Definition at line 790 of file file.c.
References ast_openstream_full().
Referenced by ast_streamfile(), handle_getoption(), and speech_streamfile().
struct ast_filestream* ast_openstream_full | ( | struct ast_channel * | chan, |
const char * | filename, | ||
const char * | preflang, | ||
int | asis | ||
) |
Opens stream for use in seeking, playing.
chan | channel to work with |
filename | to use |
preflang | prefered language to use |
asis | if set, don't clear generators |
a | ast_filestream pointer if it opens the file. |
NULL | on error. |
Definition at line 795 of file file.c.
References ao2_ref, ast_alloca, ast_deactivate_generator(), ast_format_cap_alloc, AST_FORMAT_CAP_FLAG_DEFAULT, ast_format_cap_has_type(), ast_set_write_format_from_cap(), ast_stopstream(), and fileexists_core().
Referenced by ast_openstream().
struct ast_filestream* ast_openvstream | ( | struct ast_channel * | chan, |
const char * | filename, | ||
const char * | preflang | ||
) |
Opens stream for use in seeking, playing.
chan | channel to work with |
filename | to use |
preflang | prefered language to use |
NULL | on error. |
Definition at line 848 of file file.c.
References ao2_bump, ao2_ref, ast_alloca, ast_format_cap_alloc, ast_format_cap_count(), AST_FORMAT_CAP_FLAG_DEFAULT, ast_format_cap_get_format(), ast_format_cap_has_type(), ast_format_cap_iscompatible(), ast_format_get_name(), ast_format_get_type(), and fileexists_core().
Referenced by ast_streamfile(), and handle_getoption().
int ast_playstream | ( | struct ast_filestream * | s | ) |
Play a open stream on a channel.
s | filestream to play |
0 | on success. |
-1 | on failure. |
Definition at line 1063 of file file.c.
References ast_format_get_type(), ast_filestream::fmt, and ast_format_def::format.
Referenced by ast_streamfile(), handle_getoption(), and speech_streamfile().
int ast_ratestream | ( | struct ast_filestream * | fs | ) |
Return the sample rate of the stream's format.
fs | fs to act on |
Definition at line 1090 of file file.c.
References ast_format_get_sample_rate(), ast_filestream::fmt, and ast_format_def::format.
struct ast_filestream* ast_readfile | ( | const char * | filename, |
const char * | type, | ||
const char * | comment, | ||
int | flags, | ||
int | check, | ||
mode_t | mode | ||
) |
Starts reading from a file.
filename | the name of the file to read from |
type | format of file you wish to read from |
comment | comment to go with |
flags | file flags |
check | (unimplemented, hence negligible) |
mode | Open mode Open an incoming file stream. flags are flags for the open() command, and if check is non-zero, then it will not read a file if there are any files that start with that name and have an extension Please note, this is a blocking function. Program execution will not return until ast_waitstream completes it's execution. |
NULL | on failure. |
Definition at line 1371 of file file.c.
References ast_closestream(), AST_RWLIST_RDLOCK, AST_RWLIST_UNLOCK, ast_strdup, build_filename(), ast_format_def::exts, ast_filestream::fmt, ast_filestream::trans, and ast_filestream::vfs.
Referenced by __ast_play_and_record(), and handle_cli_file_convert().
struct ast_frame* ast_readframe | ( | struct ast_filestream * | s | ) |
Read a frame from a filestream.
s | ast_filestream to act on |
NULL | if read failed. |
Definition at line 936 of file file.c.
Referenced by __ast_play_and_record(), and handle_cli_file_convert().
int ast_seekstream | ( | struct ast_filestream * | fs, |
off_t | sample_offset, | ||
int | whence | ||
) |
Seeks into stream.
fs | ast_filestream to perform seek on |
sample_offset | numbers of samples to seek |
whence | SEEK_SET, SEEK_CUR, SEEK_END |
0 | on success. |
-1 | on failure. |
Definition at line 1075 of file file.c.
References ast_filestream::fmt, and ast_format_def::seek.
Referenced by ast_stream_fastforward(), ast_stream_rewind(), ast_streamfile(), and handle_getoption().
int ast_stopstream | ( | struct ast_channel * | c | ) |
Stops a stream.
c | The channel you wish to stop playback on |
Stop playback of a stream
0 | always |
Definition at line 222 of file file.c.
References ast_closestream(), ast_format_get_name(), and ast_set_write_format().
Referenced by ast_openstream_full(), ast_play_and_wait(), ast_say_enumeration_full_da(), ast_say_enumeration_full_de(), ast_say_enumeration_full_en(), ast_say_enumeration_full_is(), ast_say_number_full_cs(), ast_say_number_full_da(), ast_say_number_full_de(), ast_say_number_full_en_GB(), ast_say_number_full_es(), ast_say_number_full_fr(), ast_say_number_full_gr(), ast_say_number_full_hu(), ast_say_number_full_is(), ast_say_number_full_it(), ast_say_number_full_ka(), ast_say_number_full_nl(), ast_say_number_full_no(), ast_say_number_full_ru(), ast_say_number_full_se(), ast_say_number_full_th(), ast_say_number_full_vi(), ast_say_number_full_zh(), ast_stream_and_wait(), conf_exec(), dial_exec_full(), grab_transfer(), handle_getoption(), leave_voicemail(), play_file(), queue_exec(), speech_background(), and waitstream_core().
int ast_stream_and_wait | ( | struct ast_channel * | chan, |
const char * | file, | ||
const char * | digits | ||
) |
stream file until digit If the file name is non-empty, try to play it.
0 | if success. |
-1 | if error. |
digit | if interrupted by a digit. |
Definition at line 1878 of file file.c.
References ast_stopstream(), ast_streamfile(), and ast_waitstream().
Referenced by __ast_play_and_record(), agent_login_exec(), announce_user_count(), ast_bridge_channel_playfile(), ast_pickup_call(), ast_record_review(), confbridge_exec(), forward_message(), grab_transfer(), join_conference_bridge(), leave_voicemail(), play_file(), play_prompt_to_user(), stream_failsound(), and vm_forwardoptions().
int ast_stream_fastforward | ( | struct ast_filestream * | fs, |
off_t | ms | ||
) |
Fast forward stream ms.
fs | filestream to act on |
ms | milliseconds to move |
0 | on success. |
-1 | on failure. |
Definition at line 1095 of file file.c.
References ast_seekstream().
int ast_stream_rewind | ( | struct ast_filestream * | fs, |
off_t | ms | ||
) |
Rewind stream ms.
fs | filestream to act on |
ms | milliseconds to move |
0 | on success. |
-1 | on failure. |
Definition at line 1100 of file file.c.
References ast_debug, ast_seekstream(), and ast_tellstream().
Referenced by __ast_play_and_record().
int ast_streamfile | ( | struct ast_channel * | c, |
const char * | filename, | ||
const char * | preflang | ||
) |
Streams a file.
c | channel to stream the file to |
filename | the name of the file you wish to stream, minus the extension |
preflang | the preferred language you wish to have the file streamed to you in Prepares a channel for the streaming of a file. To start the stream, afterward do a ast_waitstream() on the channel Also, it will stop any existing streams on the channel. |
0 | on success. |
-1 | on failure. |
Definition at line 1293 of file file.c.
References ast_applystream(), ast_debug, AST_FLAG_MASQ_NOSTREAM, ast_format_cap_get_names(), AST_FORMAT_CAP_NAMES_LEN, ast_format_get_name(), ast_openstream(), ast_openvstream(), ast_playstream(), ast_seekstream(), ast_strdup, ast_test_suite_event_notify, ast_filestream::fmt, ast_format_def::format, and ast_filestream::vfs.
Referenced by ast_app_getdata_full(), ast_app_getdata_terminator(), ast_play_and_wait(), ast_say_date_da(), ast_say_date_de(), ast_say_date_en(), ast_say_date_fr(), ast_say_date_gr(), ast_say_date_he(), ast_say_date_hu(), ast_say_date_ka(), ast_say_date_nl(), ast_say_date_th(), ast_say_date_with_format_gr(), ast_say_datetime_en(), ast_say_datetime_fr(), ast_say_datetime_from_now_en(), ast_say_datetime_from_now_fr(), ast_say_datetime_from_now_he(), ast_say_datetime_from_now_ka(), ast_say_datetime_gr(), ast_say_datetime_he(), ast_say_datetime_nl(), ast_say_datetime_pt(), ast_say_datetime_th(), ast_say_datetime_zh(), ast_say_enumeration_full_da(), ast_say_enumeration_full_de(), ast_say_enumeration_full_en(), ast_say_enumeration_full_is(), ast_say_number_full_cs(), ast_say_number_full_da(), ast_say_number_full_de(), ast_say_number_full_en_GB(), ast_say_number_full_es(), ast_say_number_full_fr(), ast_say_number_full_gr(), ast_say_number_full_hu(), ast_say_number_full_is(), ast_say_number_full_it(), ast_say_number_full_ka(), ast_say_number_full_nl(), ast_say_number_full_no(), ast_say_number_full_ru(), ast_say_number_full_se(), ast_say_number_full_th(), ast_say_number_full_vi(), ast_say_number_full_zh(), ast_say_time_de(), ast_say_time_en(), ast_say_time_fr(), ast_say_time_gr(), ast_say_time_hu(), ast_say_time_ka(), ast_say_time_nl(), ast_say_time_zh(), ast_stream_and_wait(), conf_exec(), dial_exec_full(), forward_message(), gr_say_number_female(), leave_voicemail(), and setup_privacy_args().
off_t ast_tellstream | ( | struct ast_filestream * | fs | ) |
Tell where we are in a stream.
fs | fs to act on |
Definition at line 1085 of file file.c.
References ast_filestream::fmt, and ast_format_def::tell.
Referenced by __ast_play_and_record(), ast_stream_rewind(), handle_getoption(), and waitstream_core().
int ast_truncstream | ( | struct ast_filestream * | fs | ) |
Trunc stream at current location.
fs | filestream to act on |
0 | on success. |
-1 | on failure. |
Definition at line 1080 of file file.c.
References ast_filestream::fmt, and ast_format_def::trunc.
Referenced by __ast_play_and_record().
int ast_waitstream | ( | struct ast_channel * | c, |
const char * | breakon | ||
) |
Waits for a stream to stop or digit to be pressed.
c | channel to waitstream on |
breakon | string of DTMF digits to break upon Begins playback of a stream... Wait for a stream to stop or for any one of a given digit to arrive, |
0 | if the stream finishes |
character | if it was interrupted by the channel. |
-1 | on error |
Definition at line 1840 of file file.c.
References waitstream_core().
Referenced by ast_play_and_wait(), ast_say_date_da(), ast_say_date_de(), ast_say_date_en(), ast_say_date_fr(), ast_say_date_gr(), ast_say_date_he(), ast_say_date_hu(), ast_say_date_ka(), ast_say_date_nl(), ast_say_date_th(), ast_say_date_with_format_gr(), ast_say_datetime_en(), ast_say_datetime_fr(), ast_say_datetime_from_now_en(), ast_say_datetime_from_now_fr(), ast_say_datetime_from_now_he(), ast_say_datetime_from_now_ka(), ast_say_datetime_gr(), ast_say_datetime_he(), ast_say_datetime_nl(), ast_say_datetime_pt(), ast_say_datetime_th(), ast_say_datetime_zh(), ast_say_enumeration_full_da(), ast_say_enumeration_full_de(), ast_say_enumeration_full_en(), ast_say_enumeration_full_is(), ast_say_number_full_cs(), ast_say_number_full_da(), ast_say_number_full_de(), ast_say_number_full_en_GB(), ast_say_number_full_es(), ast_say_number_full_fr(), ast_say_number_full_gr(), ast_say_number_full_hu(), ast_say_number_full_is(), ast_say_number_full_it(), ast_say_number_full_ka(), ast_say_number_full_nl(), ast_say_number_full_no(), ast_say_number_full_ru(), ast_say_number_full_se(), ast_say_number_full_th(), ast_say_number_full_vi(), ast_say_number_full_zh(), ast_say_time_de(), ast_say_time_en(), ast_say_time_fr(), ast_say_time_gr(), ast_say_time_he(), ast_say_time_hu(), ast_say_time_ka(), ast_say_time_nl(), ast_say_time_zh(), ast_stream_and_wait(), conf_exec(), gr_say_number_female(), leave_voicemail(), and setup_privacy_args().
int ast_waitstream_exten | ( | struct ast_channel * | c, |
const char * | context | ||
) |
Waits for a stream to stop or digit matching a valid one digit exten to be pressed.
c | channel to waitstream on |
context | string of context to match digits to break upon Begins playback of a stream... Wait for a stream to stop or for any one of a valid extension digit to arrive, |
0 | if the stream finishes. |
character | if it was interrupted. |
-1 | on error. |
Definition at line 1859 of file file.c.
References waitstream_core().
int ast_waitstream_fr | ( | struct ast_channel * | c, |
const char * | breakon, | ||
const char * | forward, | ||
const char * | rewind, | ||
int | ms | ||
) |
Same as waitstream but allows stream to be forwarded or rewound.
c | channel to waitstream on |
breakon | string of DTMF digits to break upon |
forward | DTMF digit to fast forward upon |
rewind | DTMF digit to rewind upon |
ms | How many miliseconds to skip forward/back Begins playback of a stream... Wait for a stream to stop or for any one of a given digit to arrive, |
0 | if the stream finishes. |
character | if it was interrupted, |
-1 | on error. |
Definition at line 1809 of file file.c.
References waitstream_core().
int ast_waitstream_fr_w_cb | ( | struct ast_channel * | c, |
const char * | breakon, | ||
const char * | forward, | ||
const char * | rewind, | ||
int | ms, | ||
ast_waitstream_fr_cb | cb | ||
) |
Same as waitstream_fr but allows a callback to be alerted when a user fastforwards or rewinds the file.
c | channel to waitstream on |
breakon | string of DTMF digits to break upon |
forward | DTMF digit to fast forward upon |
rewind | DTMF digit to rewind upon |
ms | How many milliseconds to skip forward/back |
cb | to call when rewind or fastforward occurs. Begins playback of a stream... Wait for a stream to stop or for any one of a given digit to arrive, |
0 | if the stream finishes. |
character | if it was interrupted, |
-1 | on error. |
Definition at line 1798 of file file.c.
References waitstream_core().
int ast_waitstream_full | ( | struct ast_channel * | c, |
const char * | breakon, | ||
int | audiofd, | ||
int | monfd | ||
) |
Same as waitstream, but with audio output to fd and monitored fd checking.
1 | if monfd is ready for reading |
Definition at line 1849 of file file.c.
References waitstream_core().
Referenced by ast_say_enumeration_full_da(), ast_say_enumeration_full_de(), ast_say_enumeration_full_en(), ast_say_enumeration_full_is(), ast_say_number_full_cs(), ast_say_number_full_da(), ast_say_number_full_de(), ast_say_number_full_en_GB(), ast_say_number_full_es(), ast_say_number_full_fr(), ast_say_number_full_gr(), ast_say_number_full_hu(), ast_say_number_full_is(), ast_say_number_full_it(), ast_say_number_full_ka(), ast_say_number_full_nl(), ast_say_number_full_no(), ast_say_number_full_ru(), ast_say_number_full_se(), ast_say_number_full_th(), ast_say_number_full_vi(), ast_say_number_full_zh(), and handle_getoption().
struct ast_filestream* ast_writefile | ( | const char * | filename, |
const char * | type, | ||
const char * | comment, | ||
int | flags, | ||
int | check, | ||
mode_t | mode | ||
) |
Starts writing a file.
filename | the name of the file to write to |
type | format of file you wish to write out to |
comment | comment to go with |
flags | output file flags |
check | (unimplemented, hence negligible) |
mode | Open mode Create an outgoing file stream. oflags are flags for the open() command, and if check is non-zero, then it will not write a file if there are any files that start with that name and have an extension Please note, this is a blocking function. Program execution will not return until ast_waitstream completes it's execution. |
NULL | on failure. |
Definition at line 1423 of file file.c.
References ast_closestream(), ast_malloc, AST_RWLIST_RDLOCK, AST_RWLIST_UNLOCK, ast_strdup, ast_filestream::buf, build_filename(), ast_format_def::exts, ast_filestream::fmt, ast_format_def::seek, ast_filestream::trans, and ast_filestream::vfs.
Referenced by __ast_play_and_record(), ast_writestream(), and handle_cli_file_convert().
int ast_writestream | ( | struct ast_filestream * | fs, |
struct ast_frame * | f | ||
) |
Writes a frame to a stream.
fs | filestream to write to |
f | frame to write to the filestream Send a frame to a filestream – note: does NOT free the frame, call ast_frfree manually |
0 | on success. |
-1 | on failure. |
Definition at line 244 of file file.c.
References ao2_replace, ast_debug, ast_format_cmp(), AST_FORMAT_CMP_EQUAL, AST_FORMAT_CMP_NOT_EQUAL, ast_format_get_name(), ast_format_get_type(), AST_FRAME_VIDEO, AST_FRAME_VOICE, AST_LIST_NEXT, ast_translate(), ast_translator_build_path(), ast_translator_free_path(), ast_writefile(), ast_filestream::fmt, ast_format_def::format, ast_frame_subclass::format, ast_frame::frametype, ast_format_def::name, ast_frame::subclass, ast_filestream::trans, ast_filestream::vfs, and ast_format_def::write.
Referenced by __ast_play_and_record(), and handle_cli_file_convert().