mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-07 10:28:32 +00:00
Merged revisions 217199 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r217199 | tilghman | 2009-09-08 15:28:41 -0500 (Tue, 08 Sep 2009) | 14 lines Merged revisions 217156 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r217156 | tilghman | 2009-09-08 15:01:45 -0500 (Tue, 08 Sep 2009) | 7 lines When MOH is playing on the channel, announcements sent through the conference are not heard. (closes issue #14588) Reported by: voipas Patches: 20090716__issue14588__2.diff.txt uploaded by tilghman (license 14) Tested by: lmadsen, twisted, tilghman ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.0@217209 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1616,7 +1616,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
|
|||||||
int res;
|
int res;
|
||||||
int retrydahdi;
|
int retrydahdi;
|
||||||
int origfd;
|
int origfd;
|
||||||
int musiconhold = 0;
|
int musiconhold = 0, mohtempstopped = 0;
|
||||||
int firstpass = 0;
|
int firstpass = 0;
|
||||||
int lastmarked = 0;
|
int lastmarked = 0;
|
||||||
int currentmarked = 0;
|
int currentmarked = 0;
|
||||||
@@ -1656,6 +1656,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
|
|||||||
struct timeval nexteventts = { 0, };
|
struct timeval nexteventts = { 0, };
|
||||||
int to;
|
int to;
|
||||||
int setusercount = 0;
|
int setusercount = 0;
|
||||||
|
int confsilence = 0, totalsilence = 0;
|
||||||
|
|
||||||
if (!(user = ast_calloc(1, sizeof(*user))))
|
if (!(user = ast_calloc(1, sizeof(*user))))
|
||||||
return ret;
|
return ret;
|
||||||
@@ -2063,6 +2064,11 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
|
|||||||
|
|
||||||
conf_flush(fd, chan);
|
conf_flush(fd, chan);
|
||||||
|
|
||||||
|
if (!(dsp = ast_dsp_new())) {
|
||||||
|
ast_log(LOG_WARNING, "Unable to allocate DSP!\n");
|
||||||
|
res = -1;
|
||||||
|
}
|
||||||
|
|
||||||
if (confflags & CONFFLAG_AGI) {
|
if (confflags & CONFFLAG_AGI) {
|
||||||
/* Get name of AGI file to run from $(MEETME_AGI_BACKGROUND)
|
/* Get name of AGI file to run from $(MEETME_AGI_BACKGROUND)
|
||||||
or use default filename of conf-background.agi */
|
or use default filename of conf-background.agi */
|
||||||
@@ -2096,10 +2102,6 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
|
|||||||
x = 1;
|
x = 1;
|
||||||
ast_channel_setoption(chan, AST_OPTION_TONE_VERIFY, &x, sizeof(char), 0);
|
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 (;;) {
|
for (;;) {
|
||||||
int menu_was_active = 0;
|
int menu_was_active = 0;
|
||||||
|
|
||||||
@@ -2414,8 +2416,6 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
|
|||||||
ast_frame_adjust_volume(f, user->talk.actual);
|
ast_frame_adjust_volume(f, user->talk.actual);
|
||||||
|
|
||||||
if (confflags & (CONFFLAG_OPTIMIZETALKER | CONFFLAG_MONITORTALKER)) {
|
if (confflags & (CONFFLAG_OPTIMIZETALKER | CONFFLAG_MONITORTALKER)) {
|
||||||
int totalsilence;
|
|
||||||
|
|
||||||
if (user->talking == -1)
|
if (user->talking == -1)
|
||||||
user->talking = 0;
|
user->talking = 0;
|
||||||
|
|
||||||
@@ -2703,6 +2703,10 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
|
|||||||
if ((conf->transframe[index]->frametype != AST_FRAME_NULL) &&
|
if ((conf->transframe[index]->frametype != AST_FRAME_NULL) &&
|
||||||
can_write(chan, confflags)) {
|
can_write(chan, confflags)) {
|
||||||
struct ast_frame *cur;
|
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
|
/* the translator may have returned a list of frames, so
|
||||||
write each one onto the channel
|
write each one onto the channel
|
||||||
@@ -2713,6 +2717,10 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (musiconhold && mohtempstopped && confsilence > MEETME_DELAYDETECTENDTALK) {
|
||||||
|
mohtempstopped = 0;
|
||||||
|
ast_moh_start(chan, NULL, NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ast_mutex_unlock(&conf->listenlock);
|
ast_mutex_unlock(&conf->listenlock);
|
||||||
@@ -2721,11 +2729,19 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
|
|||||||
ast_mutex_unlock(&conf->listenlock);
|
ast_mutex_unlock(&conf->listenlock);
|
||||||
} else {
|
} else {
|
||||||
bailoutandtrynormal:
|
bailoutandtrynormal:
|
||||||
|
if (musiconhold && !ast_dsp_silence(dsp, &fr, &confsilence) && confsilence < MEETME_DELAYDETECTTALK) {
|
||||||
|
ast_moh_stop(chan);
|
||||||
|
mohtempstopped = 1;
|
||||||
|
}
|
||||||
if (user->listen.actual)
|
if (user->listen.actual)
|
||||||
ast_frame_adjust_volume(&fr, user->listen.actual);
|
ast_frame_adjust_volume(&fr, user->listen.actual);
|
||||||
if (can_write(chan, confflags) && ast_write(chan, &fr) < 0) {
|
if (can_write(chan, confflags) && ast_write(chan, &fr) < 0) {
|
||||||
ast_log(LOG_WARNING, "Unable to write frame to channel %s\n", chan->name);
|
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
|
} else
|
||||||
ast_log(LOG_WARNING, "Failed to read frame: %s\n", strerror(errno));
|
ast_log(LOG_WARNING, "Failed to read frame: %s\n", strerror(errno));
|
||||||
|
|||||||
Reference in New Issue
Block a user