25 #ifndef _ASTERISK_FILE_H
26 #define _ASTERISK_FILE_H
36 #if defined(__cplusplus) || defined(c_plusplus)
44 #define AST_MAX_FORMATS 10
47 #define AST_DIGIT_ANY "0123456789#*ABCD"
48 #define AST_DIGIT_ANYNUM "0123456789"
50 #define SEEK_FORCECUR 10
95 int ast_fileexists(
const char *filename,
const char *fmt,
const char *preflang);
105 int ast_filerename(
const char *oldname,
const char *newname,
const char *fmt);
122 int ast_filecopy(
const char *oldname,
const char *newname,
const char *fmt);
329 #define AST_RESERVED_POINTERS 20
339 #if defined(__cplusplus) || defined(c_plusplus)
int ast_filecopy(const char *oldname, const char *newname, const char *fmt)
Copies a file.
Main Channel structure associated with a channel.
int ast_streamfile(struct ast_channel *c, const char *filename, const char *preflang)
Streams a file.
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.
int ast_filedelete(const char *filename, const char *fmt)
Deletes a file.
int ast_stream_fastforward(struct ast_filestream *fs, off_t ms)
Fast forward stream ms.
off_t ast_tellstream(struct ast_filestream *fs)
Tell where we are in a stream.
int ast_playstream(struct ast_filestream *s)
Play a open stream on a channel.
struct ast_filestream * ast_openvstream(struct ast_channel *chan, const char *filename, const char *preflang)
Opens stream for use in seeking, playing.
char * ast_format_str_reduce(char *fmts)
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.
int ast_applystream(struct ast_channel *chan, struct ast_filestream *s)
Applys a open stream to a channel.
struct ast_frame * ast_readframe(struct ast_filestream *s)
Read a frame from a filestream.
int ast_stream_rewind(struct ast_filestream *fs, off_t ms)
Rewind stream ms.
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.
int ast_seekstream(struct ast_filestream *fs, off_t sample_offset, int whence)
Seeks into stream.
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.
int ast_closestream(struct ast_filestream *f)
Closes a stream.
int ast_truncstream(struct ast_filestream *fs)
Trunc stream at current location.
int ast_waitstream_full(struct ast_channel *c, const char *breakon, int audiofd, int monfd)
This structure is allocated by file.c in one chunk, together with buf_size and desc_size bytes of mem...
int ast_writestream(struct ast_filestream *fs, struct ast_frame *f)
Writes a frame to a stream.
int ast_waitstream(struct ast_channel *c, const char *breakon)
Waits for a stream to stop or digit to be pressed.
int ast_fileexists(const char *filename, const char *fmt, const char *preflang)
Checks for the existence of a given file.
Data structure associated with a single frame of data.
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.
int ast_filerename(const char *oldname, const char *newname, const char *fmt)
Renames a file.
static char context[AST_MAX_CONTEXT]
int ast_stopstream(struct ast_channel *c)
Stops a stream.
struct ast_filestream * ast_openstream(struct ast_channel *chan, const char *filename, const char *preflang)
Opens stream for use in seeking, playing.
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.