42 #ifdef HAVE_GSM_HEADER 44 #elif defined(HAVE_GSM_GSM_HEADER) 48 #include "../formats/msgsm.h" 50 #define BUFFER_SAMPLES 8000 51 #define GSM_SAMPLES 160 52 #define GSM_FRAME_LEN 33 53 #define MSGSM_FRAME_LEN 65 68 return (tmp->
gsm = gsm_create()) ? 0 : -1;
81 for (x=0; x < f->
datalen; x += flen) {
102 if (gsm_decode(tmp->
gsm, src, dst + pvt->
samples)) {
176 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.
int16_t buf[BUFFER_SAMPLES]
Descriptor of a translator.
static struct ast_translator lintogsm
Support for translation of data formats. translate.c.
#define AST_LIST_NEXT(elm, field)
Returns the next entry in the list after the given entry.
static int unload_module(void)
static struct ast_frame * lintogsm_frameout(struct ast_trans_pvt *pvt)
encode and produce a frame
static void gsm_destroy_stuff(struct ast_trans_pvt *pvt)
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.
Configuration File Parser.
static struct ast_translator gsmtolin
struct sla_ringing_trunk * last
#define ast_register_translator(t)
See __ast_register_translator()
int ast_unregister_translator(struct ast_translator *t)
Unregister a translator Unregisters the given tranlator.
A set of macros to manage forward-linked lists.
static void conv65(wav_byte *c, gsm_byte *d)
union ast_trans_pvt::@327 outbuf
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)
Module has failed to load, may be in an inconsistent state.
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS|AST_MODFLAG_LOAD_ORDER, "HTTP Phone Provisioning",.support_level=AST_MODULE_SUPPORT_EXTENDED,.load=load_module,.unload=unload_module,.reload=reload,.load_pri=AST_MODPRI_CHANNEL_DEPEND,.requires="http",)
Data structure associated with a single frame of data.
union ast_frame::@263 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.
static struct ast_frame * gsm_sample(void)