38 #include "asterisk/translate.h"
43 #ifdef HAVE_GSM_HEADER
45 #elif defined(HAVE_GSM_GSM_HEADER)
49 #include "../formats/msgsm.h"
51 #define BUFFER_SAMPLES 8000
52 #define GSM_SAMPLES 160
53 #define GSM_FRAME_LEN 33
54 #define MSGSM_FRAME_LEN 65
69 return (tmp->
gsm = gsm_create()) ? 0 : -1;
82 for (x=0; x < f->
datalen; x += flen) {
103 if (gsm_decode(tmp->
gsm, src, dst + pvt->
samples)) {
167 gsm_destroy(tmp->
gsm);
struct ast_frame * ast_trans_frameout(struct ast_trans_pvt *pvt, int datalen, int samples)
generic frameout function
int datalen
actual space used in outbuf
Asterisk main include file. File version handling, generic pbx functions.
union ast_trans_pvt::@213 outbuf
int16_t buf[BUFFER_SAMPLES]
Descriptor of a translator.
static struct ast_translator lintogsm
static int unload_module(void)
static struct ast_frame * lintogsm_frameout(struct ast_trans_pvt *pvt)
encode and produce a frame
Configuration File Parser.
static void gsm_destroy_stuff(struct ast_trans_pvt *pvt)
#define AST_MODULE_INFO(keystr, flags_to_set, desc, fields...)
static struct ast_frame * slin8_sample(void)
static int gsmtolin_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
decode and store in outbuf.
static struct ast_translator gsmtolin
#define ast_register_translator(t)
See __ast_register_translator()
int ast_unregister_translator(struct ast_translator *t)
Unregister a translator Unregisters the given tranlator.
static void conv65(wav_byte *c, gsm_byte *d)
Default structure for translators, with the basic fields and buffers, all allocated as part of the sa...
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
static int gsm_new(struct ast_trans_pvt *pvt)
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...
static int reload(void)
standard module glue
#define AST_FORMAT_SLINEAR
Data structure associated with a single frame of data.
static int lintogsm_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
store samples into working buffer for later decode
static int load_module(void)
#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.
static struct ast_frame * gsm_sample(void)