Merge "Modules: Fix issues with CLI completion."

pull/9/head
Joshua Colp 8 years ago committed by Gerrit Code Review
commit 92b3ed4d32

@ -2386,22 +2386,13 @@ static int confbridge_exec(struct ast_channel *chan, const char *data)
user.tech_args.drop_silence = 1; user.tech_args.drop_silence = 1;
} }
if (ast_test_flag(&user.u_profile, USER_OPT_JITTERBUFFER)) { if (ast_test_flag(&user.u_profile, USER_OPT_JITTERBUFFER) && ast_module_check("func_jitterbuffer.so")) {
char *func_jb;
if ((func_jb = ast_module_helper("", "func_jitterbuffer", 0, 0, 0, 0))) {
ast_free(func_jb);
ast_func_write(chan, "JITTERBUFFER(adaptive)", "default"); ast_func_write(chan, "JITTERBUFFER(adaptive)", "default");
} }
}
if (ast_test_flag(&user.u_profile, USER_OPT_DENOISE)) { if (ast_test_flag(&user.u_profile, USER_OPT_DENOISE) && ast_module_check("codec_speex.so")) {
char *mod_speex;
/* Reduce background noise from each participant */
if ((mod_speex = ast_module_helper("", "codec_speex", 0, 0, 0, 0))) {
ast_free(mod_speex);
ast_func_write(chan, "DENOISE(rx)", "on"); ast_func_write(chan, "DENOISE(rx)", "on");
} }
}
/* if this user has a intro, play it before entering */ /* if this user has a intro, play it before entering */
if (!ast_strlen_zero(user.name_rec_location)) { if (!ast_strlen_zero(user.name_rec_location)) {

@ -3198,7 +3198,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
struct timeval now; struct timeval now;
struct ast_dsp *dsp = NULL; struct ast_dsp *dsp = NULL;
struct ast_app *agi_app; struct ast_app *agi_app;
char *agifile, *mod_speex; char *agifile;
const char *agifiledefault = "conf-background.agi", *tmpvar; const char *agifiledefault = "conf-background.agi", *tmpvar;
char meetmesecs[30] = ""; char meetmesecs[30] = "";
char exitcontext[AST_MAX_CONTEXT] = ""; char exitcontext[AST_MAX_CONTEXT] = "";
@ -3588,9 +3588,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
} }
/* Reduce background noise from each participant */ /* Reduce background noise from each participant */
if (!ast_test_flag64(confflags, CONFFLAG_DONT_DENOISE) && if (!ast_test_flag64(confflags, CONFFLAG_DONT_DENOISE) && ast_module_check("func_speex.so")) {
(mod_speex = ast_module_helper("", "func_speex", 0, 0, 0, 0))) {
ast_free(mod_speex);
ast_func_write(chan, "DENOISE(rx)", "on"); ast_func_write(chan, "DENOISE(rx)", "on");
} }

@ -708,8 +708,9 @@ char *ast_module_helper(const char *line, const char *word, int pos, int state,
int i, which=0, l = strlen(word); int i, which=0, l = strlen(word);
char *ret = NULL; char *ret = NULL;
if (pos != rpos) if (pos != rpos) {
return NULL; return NULL;
}
AST_DLLIST_LOCK(&module_list); AST_DLLIST_LOCK(&module_list);
AST_DLLIST_TRAVERSE(&module_list, cur, entry) { AST_DLLIST_TRAVERSE(&module_list, cur, entry) {
@ -722,12 +723,13 @@ char *ast_module_helper(const char *line, const char *word, int pos, int state,
} }
AST_DLLIST_UNLOCK(&module_list); AST_DLLIST_UNLOCK(&module_list);
if (!ret) { if (!ret && needsreload) {
for (i=0; !ret && reload_classes[i].name; i++) { for (i=0; !ret && reload_classes[i].name; i++) {
if (!strncasecmp(word, reload_classes[i].name, l) && ++which > state) if (!strncasecmp(word, reload_classes[i].name, l) && ++which > state) {
ret = ast_strdup(reload_classes[i].name); ret = ast_strdup(reload_classes[i].name);
} }
} }
}
return ret; return ret;
} }

Loading…
Cancel
Save