34 #include "asterisk/mod_format.h"
44 #define GSM_FRAME_SIZE 33
45 #define GSM_SAMPLES 160
50 {0xD8,0x20,0xA2,0xE1,0x5A,0x50,0x00,0x49,0x24,0x92,0x49,0x24,0x50,0x00,0x49
51 ,0x24,0x92,0x49,0x24,0x50,0x00,0x49,0x24,0x92,0x49,0x24,0x50,0x00,0x49,0x24
111 off_t
offset = 0, min = 0, cur, max, distance;
113 if ((cur = ftello(fs->
f)) < 0) {
118 if (fseeko(fs->
f, 0, SEEK_END) < 0) {
123 if ((max = ftello(fs->
f)) < 0) {
130 if (whence == SEEK_SET) {
133 offset = distance + cur;
134 }
else if (whence == SEEK_END) {
135 offset = max - distance;
139 offset = (offset < min)?min:offset;
141 offset = (offset > max)?max:offset;
142 }
else if (offset > max) {
144 fseeko(fs->
f, 0, SEEK_END);
151 return fseeko(fs->
f, offset, SEEK_SET);
159 if ((fd = fileno(fs->
f)) < 0) {
163 if ((cur = ftello(fs->
f)) < 0) {
168 return ftruncate(fd, cur);
union ast_frame_subclass subclass
Asterisk main include file. File version handling, generic pbx functions.
#define AST_MODULE_INFO(keystr, flags_to_set, desc, fields...)
#define AST_FRAME_SET_BUFFER(fr, _base, _ofs, _datalen)
#define AST_FRIENDLY_OFFSET
Offset into a frame's data buffer.
Asterisk architecture endianess compatibility definitions.
static void conv65(wav_byte *c, gsm_byte *d)
char * ast_getformatname(format_t format)
Get the name of a format.
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
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...
This structure is allocated by file.c in one chunk, together with buf_size and desc_size bytes of mem...
Data structure associated with a single frame of data.
enum ast_frame_type frametype
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
union ast_frame::@172 data
#define ASTERISK_FILE_VERSION(file, version)
Register/unregister a source code file with the core.