Echo in the line

I’ve been working in an emergency action plan to switch from Avaya to Asterisk. After working for 7.5 years uninterruptedly the Avaya died, actually the S8300 Media Server died the rest of the box still working.

After setting up the new Asterisk box some users were complaining that they can hear their own voices in some calls, but not all of them.

After some research we found that the echo was related to analog PSTN lines using 2-wire somewhere in far endpoint and the E1 board installed did not have echo cancellation. I’ve suggested the customer to get an echo cancellation module but configured OSLEC software echo cancellation as workaround.

As OSLEC is part of linux kernel, you have to follow few steps to get it working with Asterisk.

Building OSLEC

  • Download kernel 2.6.28 source
  • Download latest DAHDI sources

Create a directory called staging inside the DAHDI source tree

1
mkdir linux/drivers/staging

Copy the OSLEC code from the 2.6.28 source tree into the staging directory you just created.

1
2
cd linux/drivers/staging
cp -R ~/linux-2.6.32-504.3.3.el6/drivers/staging/echo linux/drivers/staging

Compile DAHDI and install it

1
2
make
make install

Configuring OSLEC

Adjust DAHDI configuration /etc/dahdi/system.conf

1
2
3
4
5
6
7
8
span=1,0,0,CCS,HDB3,CRC4
span=2,1,0,CAS,HDB3
bchan=1-15,17-31
cas=32-46,48-62:1101
dchan=16,47
loadzone=br
defaultzone=br
echocanceller=oslec,1-15,17-31,32-46,48-62

Restart DAHDI

1
service dahdi restart

At first try I got some noise instead of echo, got it solved by adjusting the txgain in the chan_dadhdi.conf.

1
txgain=-10.0