diff options
author | Shaun Ruffell <sruffell@digium.com> | 2011-01-18 20:25:26 +0000 |
---|---|---|
committer | Shaun Ruffell <sruffell@digium.com> | 2011-01-18 20:25:26 +0000 |
commit | 805932df1568b87d6caa4040abf9f7cc5be601d9 (patch) | |
tree | 30b924539756b91c07e90a8c0029585f16ef9337 /drivers | |
parent | fc1091425e767da197c39113ec880370bb0cddcd (diff) |
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
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/dahdi/dahdi-base.c | 39 |
1 files changed, 38 insertions, 1 deletions
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;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; } } } |