208 if (strcasecmp(data,
"rx") && strcasecmp(data,
"tx")) {
232 si = datastore->
data;
235 if (!strcasecmp(data,
"rx")) {
251 if (!strcasecmp(cmd,
"agc")) {
252 if (!sscanf(
value,
"%30f", &(*sdi)->agclevel))
255 if ((*sdi)->agclevel > 32768.0) {
256 ast_log(
LOG_WARNING,
"AGC(%s)=%.01f is greater than 32768... setting to 32768 instead\n",
257 ((*sdi == si->
rx) ?
"rx" :
"tx"), (*sdi)->agclevel);
258 (*sdi)->agclevel = 32768.0;
261 (*sdi)->agc = !!((*sdi)->agclevel);
264 speex_preprocess_ctl((*sdi)->state, SPEEX_PREPROCESS_SET_AGC, &(*sdi)->agc);
266 speex_preprocess_ctl((*sdi)->state, SPEEX_PREPROCESS_SET_AGC_LEVEL, &(*sdi)->agclevel);
269 }
else if (!strcasecmp(cmd,
"denoise")) {
273 speex_preprocess_ctl((*sdi)->state, SPEEX_PREPROCESS_SET_DENOISE, &(*sdi)->denoise);
277 if (!(*sdi)->agc && !(*sdi)->denoise) {
279 speex_preprocess_state_destroy((*sdi)->state);
285 if (!si->
rx && !si->
tx) {
300 datastore->
data = si;
#define ast_channel_lock(chan)
int ast_audiohook_remove(struct ast_channel *chan, struct ast_audiohook *audiohook)
Remove an audiohook from a specified channel.
static int speex_callback(struct ast_audiohook *audiohook, struct ast_channel *chan, struct ast_frame *frame, enum ast_audiohook_direction direction)
int ast_audiohook_attach(struct ast_channel *chan, struct ast_audiohook *audiohook)
Attach audiohook to channel.
Structure for a data store object.
struct ast_datastore * ast_channel_datastore_find(struct ast_channel *chan, const struct ast_datastore_info *info, const char *uid)
Find a datastore on a channel.
static const struct ast_datastore_info speex_datastore
int ast_datastore_free(struct ast_datastore *datastore)
Free a data store object.
ast_audiohook_manipulate_callback manipulate_callback
int ast_audiohook_init(struct ast_audiohook *audiohook, enum ast_audiohook_type type, const char *source, enum ast_audiohook_init_flags flags)
Initialize an audiohook structure.
struct ast_audiohook audiohook
int ast_audiohook_detach(struct ast_audiohook *audiohook)
Detach audiohook from channel.
int attribute_pure ast_true(const char *val)
Make sure something is true. Determine if a string containing a boolean value is "true". This function checks to see whether a string passed to it is an indication of an "true" value. It checks to see if the string is "yes", "true", "y", "t", "on" or "1".
struct speex_direction_info * tx
#define DEFAULT_AGC_LEVEL
#define ast_channel_unlock(chan)
#define ast_calloc(num, len)
A wrapper for calloc()
struct speex_direction_info * rx
#define ast_datastore_alloc(info, uid)
int ast_channel_datastore_add(struct ast_channel *chan, struct ast_datastore *datastore)
Add a datastore to a channel.
int ast_channel_datastore_remove(struct ast_channel *chan, struct ast_datastore *datastore)
Remove a datastore from a channel.