dahdi: Fix recent regression with native bridging.

This fixes a regression introduced in r9603.  That commit removed
DAHDI_CONF_DIGITALMON handling (which is used to natively bridge two
channels that cannot be crossed in the board driver / hardware) since I
mistakenly thought that it was only part of the DACS handling.  The
symptom of the regression is muted audio when Asterisk tries to natively
bridge two channels.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9642 a0bf4364-ded3-4de4-8d8a-66a801d63aff
This commit is contained in:
Shaun Ruffell 2011-01-18 20:25:26 +00:00
parent 4fea8415d6
commit f2b7303161

View File

@ -1444,6 +1444,8 @@ static void close_channel(struct dahdi_chan *chan)
oldconf = chan->confna;
/* initialize conference variables */
chan->_confn = 0;
chan->confna = 0;
chan->confmode = 0;
if ((chan->sig & __DAHDI_SIG_DACS) != __DAHDI_SIG_DACS)
chan->dacs_chan = NULL;
@ -2084,7 +2086,8 @@ static unsigned long _chan_cleanup(struct dahdi_chan *pos, unsigned long data)
if (((pos->confna == chan->channo) &&
is_monitor_mode(pos->confmode)) ||
(pos->dacs_chan == chan)) {
(pos->dacs_chan == chan) ||
(pos->conf_chan == chan)) {
/* Take them out of conference with us */
/* release conference resource if any */
if (pos->confna)
@ -6974,6 +6977,30 @@ static inline void __dahdi_process_getaudio_chunk(struct dahdi_chan *ss, unsigne
for (x=0;x<DAHDI_CHUNKSIZE;x++)
txb[x] = DAHDI_LIN2X(getlin[x], ms);
break;
case DAHDI_CONF_DIGITALMON:
/* Real digital monitoring, but still echo cancel if
* desired */
if (!conf_chan)
break;
if (is_pseudo_chan(conf_chan)) {
if (ms->ec_state) {
for (x = 0; x < DAHDI_CHUNKSIZE; x++)
txb[x] = DAHDI_LIN2X(conf_chan->getlin[x], ms);
} else {
memcpy(txb, conf_chan->getraw, DAHDI_CHUNKSIZE);
}
} else {
if (ms->ec_state) {
for (x = 0; x < DAHDI_CHUNKSIZE; x++)
txb[x] = DAHDI_LIN2X(conf_chan->putlin[x], ms);
} else {
memcpy(txb, conf_chan->putraw,
DAHDI_CHUNKSIZE);
}
}
for (x = 0; x < DAHDI_CHUNKSIZE; x++)
getlin[x] = DAHDI_XLAW(txb[x], ms);
break;
}
}
if (ms->confmute || (ms->ec_state && (ms->ec_state->status.mode) & __ECHO_MODE_MUTE)) {
@ -8049,6 +8076,16 @@ static inline void __dahdi_process_putaudio_chunk(struct dahdi_chan *ss, unsigne
for (x=0;x<DAHDI_CHUNKSIZE;x++)
rxb[x] = DAHDI_LIN2X((int)conf_sums_prev[ms->_confn][x], ms);
break;
case DAHDI_CONF_DIGITALMON:
/* if not a pseudo-channel, ignore */
if (!is_pseudo_chan(ms))
break;
/* Add monitored channel */
if (is_pseudo_chan(conf_chan))
memcpy(rxb, conf_chan->getraw, DAHDI_CHUNKSIZE);
else
memcpy(rxb, conf_chan->putraw, DAHDI_CHUNKSIZE);
break;
}
}
}