#include <asterisk/channel.h>
#include <asterisk/frame.h>
#include <fcntl.h>
Include dependency graph for file.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Defines | |
#define | AST_DIGIT_ANY "0123456789#*" |
Convenient for waiting. | |
#define | SEEK_FORCECUR 10 |
#define | AST_RESERVED_POINTERS 20 |
Functions | |
int | ast_format_register (char *name, char *exts, int format, struct ast_filestream *(*open)(int fd), struct ast_filestream *(*rewrite)(int fd, char *comment), int(*write)(struct ast_filestream *, struct ast_frame *), int(*seek)(struct ast_filestream *, long offset, int whence), int(*trunc)(struct ast_filestream *), long(*tell)(struct ast_filestream *), struct ast_frame *(*read)(struct ast_filestream *, int *timetonext), void(*close)(struct ast_filestream *), char *(*getcomment)(struct ast_filestream *)) |
Registers a new file format. | |
int | ast_format_unregister (char *name) |
Unregisters a file format. | |
int | ast_streamfile (struct ast_channel *c, char *filename, char *preflang) |
Streams a file. | |
int | ast_stopstream (struct ast_channel *c) |
Stops a stream. | |
int | ast_fileexists (char *filename, char *fmt, char *preflang) |
Checks for the existence of a given file. | |
int | ast_filerename (char *oldname, char *newname, char *fmt) |
Renames a file. | |
int | ast_filedelete (char *filename, char *fmt) |
Deletes a file. | |
int | ast_filecopy (char *oldname, char *newname, char *fmt) |
Copies a file. | |
char | ast_waitstream (struct ast_channel *c, char *breakon) |
Waits for a stream to stop or digit to be pressed. | |
char | ast_waitstream_fr (struct ast_channel *c, char *breakon, char *forward, char *rewind, int ms) |
Same as waitstream but allows stream to be forwarded or rewound. | |
char | ast_waitstream_full (struct ast_channel *c, char *breakon, int audiofd, int monfd) |
ast_filestream * | ast_readfile (char *filename, char *type, char *comment, int flags, int check, mode_t mode) |
Starts reading from a file. | |
ast_filestream * | ast_writefile (char *filename, char *type, char *comment, int flags, int check, mode_t mode) |
Starts writing a file. | |
int | ast_writestream (struct ast_filestream *fs, struct ast_frame *f) |
Writes a frame to a stream. | |
int | ast_closestream (struct ast_filestream *f) |
Closes a stream. | |
ast_filestream * | ast_openstream (struct ast_channel *chan, char *filename, char *preflang) |
Opens stream for use in seeking, playing. | |
ast_filestream * | ast_openvstream (struct ast_channel *chan, char *filename, char *preflang) |
Opens stream for use in seeking, playing. | |
int | ast_applystream (struct ast_channel *chan, struct ast_filestream *s) |
Applys a open stream to a channel. | |
int | ast_playstream (struct ast_filestream *s) |
play a open stream on a channel. | |
int | ast_seekstream (struct ast_filestream *fs, long sample_offset, int whence) |
Seeks into stream. | |
int | ast_truncstream (struct ast_filestream *fs) |
Trunc stream at current location. | |
int | ast_stream_fastforward (struct ast_filestream *fs, long ms) |
Fast forward stream ms. | |
int | ast_stream_rewind (struct ast_filestream *fs, long ms) |
Rewind stream ms. | |
long | ast_tellstream (struct ast_filestream *fs) |
Tell where we are in a stream. | |
ast_frame * | ast_readframe (struct ast_filestream *s) |
Read a frame from a filestream. |
|
Convenient for waiting.
Definition at line 28 of file file.h. Referenced by ast_readstring(), and ast_readstring_full(). |
|
|
|
Definition at line 30 of file file.h. Referenced by ast_read(), and ast_write(). |
|
Applys a open stream to a channel.
Definition at line 596 of file file.c. References s. Referenced by ast_streamfile().
|
|
Closes a stream.
Definition at line 641 of file file.c. References AST_FORMAT_MAX_AUDIO, ast_sched_del(), ast_settimeout(), ast_translator_free_path(), ast_format::close, ast_filestream::filename, ast_filestream::fmt, ast_format::format, free, ast_filestream::owner, ast_channel::sched, ast_channel::stream, ast_channel::streamid, ast_filestream::trans, ast_channel::vstream, and ast_channel::vstreamid. Referenced by ast_app_getvoice(), ast_hangup(), and ast_stopstream().
|
|
Copies a file.
Definition at line 723 of file file.c. References ACTION_COPY.
|
|
Deletes a file.
Definition at line 713 of file file.c. References ACTION_DELETE.
|
|
Checks for the existence of a given file.
Definition at line 673 of file file.c. References ACTION_EXISTS, and MAX_LANGUAGE. Referenced by ast_openstream(), and ast_openvstream().
|
|
Renames a file.
Definition at line 718 of file file.c. References ACTION_RENAME.
|
|
Registers a new file format. Register a new file format capability Adds a format to asterisk's format abilities. Fill in the fields, and it will work. For examples, look at some of the various format code. returns 0 on success, -1 on failure |
|
Unregisters a file format.
Definition at line 137 of file file.c. References ast_log(), ast_mutex_lock, ast_mutex_unlock, ast_verbose(), free, LOG_WARNING, ast_format::next, option_verbose, and VERBOSE_PREFIX_2.
|
|
Opens stream for use in seeking, playing.
Definition at line 424 of file file.c. References ACTION_OPEN, ast_deactivate_generator(), ast_fileexists(), ast_log(), ast_set_write_format(), ast_stopstream(), ast_channel::generator, LOG_WARNING, ast_channel::oldwriteformat, and ast_channel::writeformat. Referenced by ast_streamfile().
|
|
Opens stream for use in seeking, playing.
Definition at line 477 of file file.c. References ACTION_OPEN, ast_fileexists(), ast_log(), LOG_WARNING, and MAX_LANGUAGE. Referenced by ast_streamfile().
|
|
play a open stream on a channel.
Definition at line 602 of file file.c. References AST_FORMAT_MAX_AUDIO, and s. Referenced by ast_streamfile().
|
|
Starts reading from a file.
Definition at line 756 of file file.c. References ast_log(), ast_mutex_lock, ast_mutex_unlock, free, LOG_WARNING, strdup, and type.
|
|
Read a frame from a filestream.
Definition at line 520 of file file.c. References s.
|
|
Seeks into stream.
Definition at line 611 of file file.c. References ast_filestream::fmt, and ast_format::seek. Referenced by ast_read(), ast_stream_fastforward(), ast_stream_rewind(), and ast_write().
|
|
Stops a stream.
Definition at line 164 of file file.c. References ast_closestream(), ast_log(), ast_set_write_format(), LOG_WARNING, ast_channel::oldwriteformat, ast_channel::stream, and ast_channel::vstream. Referenced by ast_control_streamfile(), ast_openstream(), ast_readstring(), ast_readstring_full(), ast_say_character_str(), ast_say_character_str_full(), ast_say_digit_str(), ast_say_digit_str_full(), ast_say_phonetic_str(), ast_say_phonetic_str_full(), ast_waitstream(), ast_waitstream_fr(), and ast_waitstream_full().
|
|
Fast forward stream ms.
Definition at line 626 of file file.c. References ast_seekstream(). Referenced by ast_control_streamfile(), and ast_waitstream_fr().
|
|
Rewind stream ms.
Definition at line 634 of file file.c. References ast_seekstream(). Referenced by ast_waitstream_fr().
|
|
Streams a file.
Definition at line 728 of file file.c. References ast_applystream(), ast_getformatname(), ast_log(), ast_openstream(), ast_openvstream(), ast_playstream(), ast_verbose(), LOG_DEBUG, LOG_WARNING, ast_channel::nativeformats, option_verbose, and VERBOSE_PREFIX_3. Referenced by ast_app_getdata(), ast_app_getdata_full(), ast_app_getvoice(), ast_control_streamfile(), ast_say_character_str(), ast_say_character_str_full(), ast_say_digit_str(), ast_say_digit_str_full(), ast_say_phonetic_str(), and ast_say_phonetic_str_full().
|
|
Tell where we are in a stream.
Definition at line 621 of file file.c. References ast_filestream::fmt, and ast_format::tell.
|
|
Trunc stream at current location.
Definition at line 616 of file file.c. References ast_filestream::fmt, and ast_format::trunc.
|
|
Waits for a stream to stop or digit to be pressed.
Definition at line 860 of file file.c. References ast_channel::_softhangup, AST_CONTROL_ANSWER, AST_CONTROL_HANGUP, AST_CONTROL_RINGING, AST_FRAME_CONTROL, AST_FRAME_DTMF, ast_frfree(), ast_log(), ast_read(), ast_sched_runq(), ast_sched_wait(), ast_stopstream(), ast_waitfor(), LOG_DEBUG, LOG_WARNING, ast_channel::sched, ast_channel::stream, and ast_channel::timingfunc. Referenced by ast_app_getvoice(), ast_readstring(), ast_say_character_str(), ast_say_digit_str(), and ast_say_phonetic_str().
|
|
Same as waitstream but allows stream to be forwarded or rewound.
Definition at line 915 of file file.c. References ast_channel::_softhangup, AST_CONTROL_ANSWER, AST_CONTROL_HANGUP, AST_CONTROL_RINGING, AST_FRAME_CONTROL, AST_FRAME_DTMF, ast_frfree(), ast_log(), ast_read(), ast_sched_runq(), ast_sched_wait(), ast_stopstream(), ast_stream_fastforward(), ast_stream_rewind(), ast_waitfor(), LOG_DEBUG, LOG_WARNING, ast_channel::sched, ast_channel::stream, and ast_channel::timingfunc. Referenced by ast_control_streamfile().
|
|
Definition at line 976 of file file.c. References ast_channel::_softhangup, AST_CONTROL_ANSWER, AST_CONTROL_HANGUP, AST_CONTROL_RINGING, AST_FRAME_CONTROL, AST_FRAME_DTMF, AST_FRAME_VOICE, ast_frfree(), ast_log(), ast_read(), ast_sched_runq(), ast_sched_wait(), ast_stopstream(), ast_waitfor_nandfds(), LOG_DEBUG, LOG_WARNING, ast_channel::sched, ast_channel::stream, and ast_channel::timingfunc. Referenced by ast_readstring_full(), ast_say_character_str_full(), ast_say_digit_str_full(), and ast_say_phonetic_str_full().
|
|
Starts writing a file.
Definition at line 805 of file file.c. References ast_log(), ast_mutex_lock, ast_mutex_unlock, free, LOG_WARNING, strdup, and type. Referenced by ast_app_getvoice(), and ast_writestream().
|
|
Writes a frame to a stream.
Definition at line 177 of file file.c. References AST_FORMAT_MAX_AUDIO, AST_FRAME_VIDEO, AST_FRAME_VOICE, ast_getformatname(), ast_log(), ast_translate(), ast_translator_build_path(), ast_translator_free_path(), ast_writefile(), ast_filestream::filename, ast_filestream::flags, ast_filestream::fmt, ast_format::format, ast_frame::frametype, ast_filestream::lastwriteformat, LOG_DEBUG, LOG_WARNING, ast_filestream::mode, ast_format::name, ast_frame::subclass, ast_filestream::trans, type, ast_filestream::vfs, and ast_format::write. Referenced by ast_read(), and ast_write().
|