Howto: OSLEC echo canceling + DAHDI 2.1.0.4 + Asterisk 1.4

Aloha,

I recently compiled/installed OSLEC in our Asterisk 1.4.23.1 server using DAHDI 2.1.0.4 and I thought I would share some info and my experience as documentation out there is pretty sparse.

If you don’t know what you are doing, then I don’t suggest trying this. USE AT YOUR OWN RISK.

Step 1: Download the latest DAHDI and unpack it.

Step 2: Download Linux kernel source 2.6.28 or newer and unpack it.

Step 3: Make the staging/echo directories in your DADHI source tree.
$mkdir /dahdi-linux-2.1.0.4/drivers/staging
$mkdir /dahdi-linux-2.1.0.4/drivers/staging/echo

Step 4: Copy the OSLEC code from the 2.6.28 source tree into your DAHDI source tree.
$cp linux-2.6.28/drivers/staging/echo/* /dahdi-linux-2.1.0.4/drivers/staging/echo/

Step 5: Uncomment the 2 OSLEC lines in the DAHDI Kbuild file.
$vi /dahdi-linux-2.1.0.4/drivers/dahdi/Kbuild
The two lines are referenced for OSLEC. Uncomment them.
obj-m += dahdi_echocan_oslec.o
obj-m +=

Step 6: Modify the second commented line and include your path to the kernel code and the module echo.o. It should look like this:
obj-m += …/staging/echo/echo.o

Step 7: compile DAHDI
$make
One of the lines that will scroll by should look like this:
CC [M] /usr/src/asterisk/dahdi-linux-2.1.0.4/drivers/dahdi/dahdi_echocan_oslec.o

If you get the following error messages: WARNING: “oslec_create” [/usr/src/asterisk/dahdi-linux-2.1.0.4/drivers/dahdi/dahdi_echocan_oslec.ko] undefined!
WARNING: “oslec_free” [/usr/src/asterisk/dahdi-linux-2.1.0.4/drivers/dahdi/dahdi_echocan_oslec.ko] undefined!
WARNING: “oslec_update” [/usr/src/asterisk/dahdi-linux-2.1.0.4/drivers/dahdi/dahdi_echocan_oslec.ko] undefined!

It means that the second line in Kbuild is incorrect and not pointing to the echo.o code/module. Check your path.

Step 8: install DAHDI
$make install

Step 9: edit your DADHI config file. Change mg2 to oslec
$vi /etc/dahdi/system.conf

Span 1: WCT1/0 “Digium Wildcard TE110P T1/E1 Card 0” (MASTER) B8ZS/ESF

span=1,1,0,esf,b8zs
bchan=1-23
dchan=24
#echocanceller=mg2,1-23
echocanceller=oslec,1-23

Step 10: Restart DAHDI
/etc/init.d/dahdi stop/start

Step 11: Check your config
$dahdi_cfg -vvv
DAHDI Tools Version - 2.1.0.2

DAHDI Version: 2.1.0.4
Echo Canceller(s): OSLEC, MG2
Configuration

SPAN 1: ESF/B8ZS Build-out: 0 db (CSU)/0-133 feet (DSX-1)

Channel map:

Channel 01: Clear channel (Default) (Echo Canceler: oslec) (Slaves: 01)
Channel 02: Clear channel (Default) (Echo Canceler: oslec) (Slaves: 02)
~
Channel 23: Clear channel (Default) (Echo Canceler: oslec) (Slaves: 23)
Channel 24: D-channel (Default) (Slaves: 24)

Setting echocan for channel 1 to oslec
Setting echocan for channel 2 to oslec
~
Setting echocan for channel 22 to oslec
Setting echocan for channel 23 to oslec

Step 12: Launch Asterisk
$asterisk

Your system should be using the OSLEC algorithm now :smile: I hope that helps out some people. It took me a bit to figure it all out.

And part of the reason I’m posting this is to ask some questions now that I have it installed and running. The Zaptel OSLEC module has some settings that you can configure. But now that I have it compiled into DAHDI is it possible to adjust those same settings? And if so, how do I do that?

Reason being is that while echo is now at a minimum, we do get an occasional occurrence of echo, and wanting to see if I can eliminate those cases.

Thanks in advance!
Herb

Hi Herb,

I have compiled OSLEC into various versions of DAHDI, with the latest being 2.2.1.1. The compile and install seems to be fine, and returns no errors. However, when I place a call I always get the following in the asterisk log:

WARNING[18989] chan_dahdi.c: Unable to enable echo cancellation on channel 3 (No such device)

I have scoured the Internet searching for any kind of solution for this, or actually any kind of hint as to where to look to try and resolve this.

Other people seem to be getting this message, but they always seem to be focusing on other errors within their logs.

Do you have ANY idea what device this is referring to. I have a TDM422p without hardware echo cancellation. I can see the following modules which loaded correctly:

Module Size Used by
dahdi_echocan_oslec 6784 2
echo 9984 1 dahdi_echocan_oslec
wctdm 43248 4
dahdi 201296 12 dahdi_echocan_oslec,wctdm

I would appreciate any hint as to where to look!!

Thanks.

François (francois.gendron@gendron.ca)

DAHDI Tools Version - 2.2.1.1

DAHDI Version: 2.2.1.1
Echo Canceller(s): OSLEC
Configuration

Channel map:

Channel 01: FXO Kewlstart (Default) (Echo Canceler: oslec) (Slaves: 01)
Channel 02: FXO Kewlstart (Default) (Echo Canceler: oslec) (Slaves: 02)
Channel 03: FXS Kewlstart (Default) (Echo Canceler: none) (Slaves: 03)
Channel 04: FXS Kewlstart (Default) (Echo Canceler: none) (Slaves: 04)

4 channels to configure.

Setting echocan for channel 1 to oslec
Setting echocan for channel 2 to oslec
Setting echocan for channel 3 to none
Setting echocan for channel 4 to none

hi:
please show system.conf file and chan_dahdi file?

Hi,

System.conf

fxoks=1-2
fxsks=3-4

loadzone=us
defaultzone=us

echocanceller=oslec,1-2

Chan_Dahdi.conf

;
signalling=fxo_ks
;
rxwink=300 ; Atlas seems to use long (250ms) winks
;
usecallerid=yes
;
hidecallerid=no
;
callwaiting=yes
;
usecallingpres=yes
;
callwaitingcallerid=yes
;
transfer=yes
;
canpark=yes
;
cancallforward=yes
;
callreturn=yes
;
echocancel=256 (I have tried multiple values)
;
echocancelwhenbridged=no
;
rxgain=0.0
txgain=0.0
;
group=1
;
callgroup=1
pickupgroup=1
;
signalling=fxo_ks
rxgain=3.0
txgain=1.0
language=fr
context=Family
adsi=no
immediate=no
callwaiting=yes
callwaitingcallerid=yes
threewaycalling=yes
transfer=yes
cancallforward=yes
callreturn=yes
callgroup=1
pickupgroup=1,2
useincomingcalleridonzaptransfer=yes
usecallerid=yes
callerid=“Postes Famille”
channel=>1

signalling=fxo_ks
rxgain=0.0
txgain=0.0
language=fr
context=SIG
adsi=no
immediate=no
callwaiting=yes
callwaitingcallerid=yes
threewaycalling=yes
transfer=yes
cancallforward=yes
callreturn=yes
callgroup=2
pickupgroup=1,2
useincomingcalleridonzaptransfer=yes
usecallerid=yes
callerid=“Fax SIG”
channel=>2

signalling=fxs_ks
rxgain=0.0
txgain=0.0
language=fr
context=Family
usedistinctiveringdetection=no
busydetect=no
busycount=3
callprogress=no
usecallerid=no
callerid=“Famille”
channel=>3

signalling=fxs_ks
rxgain=0.0
txgain=0.0
language=fr
context=SIG
usedistinctiveringdetection=no
busydetect=no
busycount=3
callprogress=no
usecallerid=no
callerid=“SIG”
channel=>4

Thanks for your help!

François

hello:
you missed channel 3and 4, please add that and reload everything.

Hi voip88,

Yes… That removed the message. (A bit weird, as I was setting channel 3 to NOT echo cancel).

However, I’m not sure if this is what I want. Maybe I don’t understand things correctly.

If I set all channels to use OSLEC, when a call comes in, it will bridge Channel 1 (PSTN) to Channel 3 (Phone).

Since I have ‘echocancelwhenbridged=no’ does that not mean that there will be NO echocancelling on the call??

That’s why I had set channels 3-4 to ‘none’.

Thanks for your help!!