178 if (!strncasecmp(
data,
"http://", 7)) {
191 res =
timed_read(fds[0], myf.frdata,
sizeof(myf.frdata), timeout);
196 myf.f.samples = res / 2;
199 myf.f.src = __PRETTY_FUNCTION__;
200 myf.f.delivery.tv_sec = 0;
201 myf.f.delivery.tv_usec = 0;
202 myf.f.data.ptr = myf.frdata;
223 ast_debug(1,
"Null frame == hangup() detected\n");
243 if (!res && owriteformat)
static int timed_read(int fd, void *data, int datalen, int timeout)
struct ast_frame * ast_read(struct ast_channel *chan)
Reads a frame.
struct timeval ast_tvnow(void)
Returns current timeval. Meant to replace calls to gettimeofday().
int64_t ast_tvdiff_ms(struct timeval end, struct timeval start)
Computes the difference (in milliseconds) between two struct timeval instances.
int ast_set_write_format(struct ast_channel *chan, format_t format)
Sets write format on channel chan Set write format for channel to whichever component of "format" is ...
#define ast_debug(level,...)
Log a DEBUG message.
#define AST_FRIENDLY_OFFSET
Offset into a frame's data buffer.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
struct timeval ast_samp2tv(unsigned int _nsamp, unsigned int _rate)
Returns a timeval corresponding to the duration of n samples at rate r. Useful to convert samples to ...
struct timeval ast_tvadd(struct timeval a, struct timeval b)
Returns the sum of two timevals a + b.
void ast_log(int level, const char *file, int line, const char *function, const char *fmt,...)
Used for sending a log message This is the standard logger function. Probably the only way you will i...
int ast_write(struct ast_channel *chan, struct ast_frame *frame)
Write a frame to a channel This function writes the given frame to the indicated channel.
static int mp3play(const char *filename, int fd)
#define AST_FORMAT_SLINEAR
int ast_waitfor(struct ast_channel *chan, int ms)
Wait for input on a channel.
Data structure associated with a single frame of data.
enum ast_frame_type frametype
union ast_frame::@172 data
int ast_stopstream(struct ast_channel *c)
Stops a stream.