|
|
|
|
@ -1978,7 +1978,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
|
|
|
|
|
int res;
|
|
|
|
|
int retrydahdi;
|
|
|
|
|
int origfd;
|
|
|
|
|
int musiconhold = 0;
|
|
|
|
|
int musiconhold = 0, mohtempstopped = 0;
|
|
|
|
|
int firstpass = 0;
|
|
|
|
|
int lastmarked = 0;
|
|
|
|
|
int currentmarked = 0;
|
|
|
|
|
@ -2018,6 +2018,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
|
|
|
|
|
struct timeval nexteventts = { 0, };
|
|
|
|
|
int to;
|
|
|
|
|
int setusercount = 0;
|
|
|
|
|
int confsilence = 0, totalsilence = 0;
|
|
|
|
|
|
|
|
|
|
if (!(user = ast_calloc(1, sizeof(*user))))
|
|
|
|
|
return ret;
|
|
|
|
|
@ -2448,6 +2449,11 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
|
|
|
|
|
|
|
|
|
|
conf_flush(fd, chan);
|
|
|
|
|
|
|
|
|
|
if (!(dsp = ast_dsp_new())) {
|
|
|
|
|
ast_log(LOG_WARNING, "Unable to allocate DSP!\n");
|
|
|
|
|
res = -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (confflags & CONFFLAG_AGI) {
|
|
|
|
|
/* Get name of AGI file to run from $(MEETME_AGI_BACKGROUND)
|
|
|
|
|
or use default filename of conf-background.agi */
|
|
|
|
|
@ -2484,10 +2490,6 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
|
|
|
|
|
x = 1;
|
|
|
|
|
ast_channel_setoption(chan, AST_OPTION_TONE_VERIFY, &x, sizeof(char), 0);
|
|
|
|
|
}
|
|
|
|
|
if (confflags & (CONFFLAG_OPTIMIZETALKER | CONFFLAG_MONITORTALKER) && !(dsp = ast_dsp_new())) {
|
|
|
|
|
ast_log(LOG_WARNING, "Unable to allocate DSP!\n");
|
|
|
|
|
res = -1;
|
|
|
|
|
}
|
|
|
|
|
for (;;) {
|
|
|
|
|
int menu_was_active = 0;
|
|
|
|
|
|
|
|
|
|
@ -2856,8 +2858,6 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (confflags & (CONFFLAG_OPTIMIZETALKER | CONFFLAG_MONITORTALKER)) {
|
|
|
|
|
int totalsilence;
|
|
|
|
|
|
|
|
|
|
if (user->talking == -1) {
|
|
|
|
|
user->talking = 0;
|
|
|
|
|
}
|
|
|
|
|
@ -3198,7 +3198,11 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
|
|
|
|
|
if ((conf->transframe[idx]->frametype != AST_FRAME_NULL) &&
|
|
|
|
|
can_write(chan, confflags)) {
|
|
|
|
|
struct ast_frame *cur;
|
|
|
|
|
|
|
|
|
|
if (musiconhold && !ast_dsp_silence(dsp, conf->transframe[index], &confsilence) && confsilence < MEETME_DELAYDETECTTALK) {
|
|
|
|
|
ast_moh_stop(chan);
|
|
|
|
|
mohtempstopped = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* the translator may have returned a list of frames, so
|
|
|
|
|
write each one onto the channel
|
|
|
|
|
*/
|
|
|
|
|
@ -3208,6 +3212,10 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (musiconhold && mohtempstopped && confsilence > MEETME_DELAYDETECTENDTALK) {
|
|
|
|
|
mohtempstopped = 0;
|
|
|
|
|
ast_moh_start(chan, NULL, NULL);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
ast_mutex_unlock(&conf->listenlock);
|
|
|
|
|
@ -3215,13 +3223,21 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
|
|
|
|
|
}
|
|
|
|
|
ast_mutex_unlock(&conf->listenlock);
|
|
|
|
|
} else {
|
|
|
|
|
bailoutandtrynormal:
|
|
|
|
|
bailoutandtrynormal:
|
|
|
|
|
if (musiconhold && !ast_dsp_silence(dsp, &fr, &confsilence) && confsilence < MEETME_DELAYDETECTTALK) {
|
|
|
|
|
ast_moh_stop(chan);
|
|
|
|
|
mohtempstopped = 1;
|
|
|
|
|
}
|
|
|
|
|
if (user->listen.actual) {
|
|
|
|
|
ast_frame_adjust_volume(&fr, user->listen.actual);
|
|
|
|
|
}
|
|
|
|
|
if (can_write(chan, confflags) && ast_write(chan, &fr) < 0) {
|
|
|
|
|
ast_log(LOG_WARNING, "Unable to write frame to channel %s\n", chan->name);
|
|
|
|
|
}
|
|
|
|
|
if (musiconhold && mohtempstopped && confsilence > MEETME_DELAYDETECTENDTALK) {
|
|
|
|
|
mohtempstopped = 0;
|
|
|
|
|
ast_moh_start(chan, NULL, NULL);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
ast_log(LOG_WARNING, "Failed to read frame: %s\n", strerror(errno));
|
|
|
|
|
|