WELCOME [ Log In · Register ]        SITE [ Search · Page Index · Recent Changes ]    RSS

Asterisk OSLEC


For those who wish to use OSLEC for echo cancellation instead of the dahdi/zaptel echo canceler, here are the instructions on how to properly install and configure OSLEC.

1) Download Dahdi/Zaptel Sources
2) Install OSLEC
3) Verify OSLEC Installation



Download Dahdi/Zaptel Sources

DAHDI METHOD
First find the version of Dahdi by running the command:
      #> dahdi_cfg -vvv
      DAHDI Tools Version - 2.2.0
      DAHDI Version: 2.2.0
      Echo Canceller(s):
      Configuration
     ======================

Now you will notice there will be two versions insure you note down the Dahdi version not the Dahdi-tools version. Then go to http://downloads.digium.com/pub/telephony/dahdi-linux/releases/ and search for your version of Dahdi there. The file name should be in the format "dahdi-linux-<version>.tar.gz". Once you find the version then run the command
        #> cd /usr/src/
and then run "wget <<URL of Dahdi-linux>>", so for this version it would be the following command. 
        #> wget http://downloads.digium.com/pub/telephony/dahdi-linux/releases/dahdi-linux-2.2.0.tar.gz
You would need to compile the dahdi source in order to install the wanpipe driver:
1. Extract the dahdi-linux-<version>.tar.gz file, by running the command:
        #> tar xvfz dahdi-linux-<version>.tar.gz
2. Run:
         #> cd dahdi-linux-<version>
    and then once in the directory run
        #> ./configure; make

3. The compiling is done, if there is any errors please contact techdesk@sangoma.com

ZAPTEL METHOD
First find the version of Zaptel by running the command:
     #>ztcfg -vvv
      Zaptel Version: 1.4.12.1
      Echo Canceller:
      Configuration
      ======================

Go to http://downloads.asterisk.org/pub/telephony/zaptel/releases/ and search for your version of Zaptel there. The file name should be in the format "zaptel-<version>.tar.gz". Once you find the version then run the command
        #> cd /usr/src/
and then run "wget <<URL of Zaptel>>", so for this version it would be the following command. 
        #> wget http://downloads.asterisk.org/pub/telephony/zaptel/releases/zaptel-1.4.12.1.tar.gz
You would need to compile the zaptel source in order to install the wanpipe driver:
1. Extract the zaptel-<version>.tar.gz file, by running the command:
        #> tar xvfz zaptel-<version>.tar.gz
2. Run:
         #> cd zaptel-<version>
    and then once in the directory run
        #> ./configure; make

3. The compiling is done, if there is any errors please contact techdesk@sangoma.com



Install OSLEC

In order to install OSLEC, you must do the following:
1) Run the following commands to shutdown Asterisk, Dahdi/Zaptel, and Wanrouter:
        #> asterisk -rx "stop when convenient"
        #> wanrouter stop all
        #> service dahdi stop
                 or for zaptel
        #> /etc/init.d/zaptel stop

NOTE: if you do have hardware echo cancellation on your sangoma hardware and wish to use OSLEC instead, you must disable echo cancellation. To do go into "/etc/wanpipe/wanpipeX.conf" (Where X stands for the wanpipe number) and set TDMV_HWEC, TDMV_HW_FAX_DETECT and TDMV_HW_DTMF to NO.

2) Create a script with the commands below or run the commands individually:
For DAHDI:
       #> cd /usr/src
       #> cp -fr /usr/src/dahdi-linux-<ver> /usr/src/dahdi
       #> wget http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.28.tar.bz2
       #> tar xjf linux-2.6.28.tar.bz2
       #> mkdir /usr/src/dahdi/drivers/staging
       #> cp -fR /usr/src/linux-2.6.28/drivers/staging/echo /usr/src/dahdi/drivers/staging
       #> sed -i "s|#obj-m += dahdi_echocan_oslec.o|obj-m += dahdi_echocan_oslec.o|" /usr/src/dahdi/drivers/dahdi/Kbuild
       #> sed -i "s|#obj-m += ../staging/echo/|obj-m += ../staging/echo/|" /usr/src/dahdi/drivers/dahdi/Kbuild
       #> echo 'obj-m += echo.o' > /usr/src/dahdi/drivers/staging/echo/Kbuild
       #> cd /usr/src/dahdi/
       #> make
       #> make install

Go into /etc/dahdi/system.conf  (they may appear more then once for the number of devices installed on the system):
     Change "echocanceller=mg2,1" to "echocanceller=OSLEC,1"

FOR ZAPTEL
      #> cd /usr/src
      #> svn co http://svn.astfin.org/software/oslec/trunk/ oslec
      #> cd oslec
      #> make
      #> cp kernel/oslec.ko /lib/modules/`uname -r`/misc/.
      #> insmod kernel/oslec.ko
      #> cd ../zaptel
      #> cp /usr/src/oslec/kernel/Module.symvers .
      #> ./configure
      #> patch -p1 < ../oslec/kernel/zaptel-1.4.11.patch
      #> make
      #> make install
      #> grep /lib/modules/`uname -r`/misc/zaptel.ko: /lib/modules/`uname -r`/modules.dep

Go into /etc/asterisk/zapata.conf :
     Change:
         echocancel=yes
         echocancelwhenbridged=no
         ;echotraining=400
     To:
         echocancel=256
         echocancelwhenbridged=no
         ;echotraining=400

4) Reboot your machine




Verify OSLEC Installation

Verify OSLEC is present by running the following:

     #> wanrouter start

    Dahdi Method:
      #> dahdi_cfg -vvv
      DAHDI Tools Version - 2.2.0
      DAHDI Version: 2.2.0
      Echo Canceller(s): OSLEC
      Configuration
     ======================   

   Zaptel Method:
      #>ztcfg -vvv
      Zaptel Version: 1.4.12.1
      Echo Canceller: OSLEC
      Configuration
      ======================