HOWTO compile and install DAHDI 2.3 with OSLEC enabled

One common issue that persists through all telecoms related business is echo.

In the early days of the telephone, telecoms companies spent a lot of money going to great lengths trying to find a solution to the problem which occurred frequently when the traditional telephone network was first deployed.

We have to deal with this issue fairly frequently during consultancy on customer sites with their Asterisk PBX’s.

The issue almost always occurs with calls over PSTN/ISDN hardware and rarely appears to affect VoIP (probably due to upstream trunking providers use of echo cancellation software).

There are several approaches we can take:

  • We can enable DAHDI’s echo cancellation (“mg2″) and tweak various settings to try and make it work.
  • We can pay serious money to Digium et al. for a hardware module that will cancel the echo on the card itself.
  • We can compile DAHDI with OSLEC.

OSLECOpen Source Line Echo Canceller – is pretty much what it says on the tin. It’s an echo canceller, written by the legendary David Rowe which is far superior to other open source line echo cancellors. Unfortunately, as one of Digium’s revenue streams is the sale of hardware echo cancellation modules, getting it working feels like a bit of a hack and isn’t fantastically documented.

I thought we’d share how we did it…

Firstly, the guys at BSM Development deserve a pat on the back – their article on OSLEC is what got us going and really helped us get it up and working.

First we switch to our source directory:
dmc-pbx:~# cd /usr/src/
Let’s now download BSM Development’s lovely dahdi-oslec tar.gz with the modification you need to make to the plain DADHI source:

dmc-pbx:/usr/src# wget -c

Let’s now download the complete dahdi-linux tar.gz from Digium
dmc-pbx:/usr/src# wget -c
Untar everything:
dmc-pbx:/usr/src# tar xvf dahdi-linux-complete-
dmc-pbx:/usr/src# tar xvf dahdi-linux-oslec-

Now lets just copy the OSLEC source into the correct part of the DAHDI source
dmc-pbx:/usr/src# cp dahdi-linux-oslec-* dahdi-linux-complete-

From here you need to edit one line in this file:
dmc-pbx:/usr/src# sensible-editor /usr/src/dahdi-linux-complete-

Search for OSLEC. Uncomment, the first line that mentions it, save and exit.

Now just change the root of the source package…
dmc-pbx:/usr/src# cd dahdi-linux-complete-
…and compile, install and install startup scripts:
dmc-pbx:/usr/src/dahdi-linux-complete- make all;make
install;make config

then reboot
dmc-pbx:~# reboot

When it’s back up, run
dmc-pbx:~# dahdi_cfg -v
to configure the dahdi interface

and then
dmc-pbx:~# sensible-editor /etc/dahdi/system.conf
and replace any mentions of “mg2″ with “oslec”.

After that you just need to restart dahdi
dmc-pbx:~# /etc/init.d/dahdi restart
and there you have it; a working OSLEC installation!

Fire up Asterisk and you are away and can start enjoying great quality echo cancellation without expensive hardware!

Do feel free to let us know how you get on in the comments! :)

This entry was posted in Asterisk, Open Source and tagged , , , , . Bookmark the permalink.

One Response to HOWTO compile and install DAHDI 2.3 with OSLEC enabled

  1. Pingback: Link: HOWTO compile and install DAHDI 2.3 with OSLEC enabled « The Michigan Telephone blog

Leave a Reply