From 805932df1568b87d6caa4040abf9f7cc5be601d9 Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Tue, 18 Jan 2011 20:25:26 +0000 Subject: 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 git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9642 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- drivers/dahdi/dahdi-base.c | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) (limited to 'drivers/dahdi/dahdi-base.c') diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c index 156b5ee..c1a16ef 100644 --- a/drivers/dahdi/dahdi-base.c +++ b/drivers/dahdi/dahdi-base.c @@ -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;xec_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_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; } } } -- cgit v1.2.3