Echo and voice Clipping on external calls over a UK BT ISDN Channel


I’m hoping someone can point me in the right direction on this one - we have a FreePBX distro ( running on an HP ML110 server. We have an OpenVox BE200E BRI card with the additional H/W E/C module loaded. Our phones are mostly Linksys SPA301/901 and reception staff have SPA962 with the 16 button sidecars - all running latest firmware.

Two members of staff make and receive most of our inbound / outbound calls over a pair of BT ISDN 2e lines (4 channels) on two SPA962’s, and are both reporting two problems - local echo (hearing themselves speaking) and voice clipping when both parties talk at the same time. It appears to be happening almost exclusively on inbound calls coming in over the BT lines and it’s not on all calls, but more than enough to be a real nuisance.

We’re running the Dahdi module, and in all other respects it’s all working perfectly. As can be seen from the system.conf and chan_dahdi.conf below EC is enabled - the dhadi module shows version 2.6.2 with Echo Canceller: HWEC.

If I run ‘dahdi show channel x’ from the Asterisk console (where channel x is currently in use), I can see the echo cancellation is running:

Echo Cancellation:
128 taps
currently ON

All appears to be configured correctly, but I’m still getting echo and voice clipping. I did switch EC to off in chan_dahdi.conf for a day or so and this appeared to make the problem worse. I’d also be tempted to try removing the H/W board and running one of the S/W echo cancellers but as this is a live system it’s not easy to do and I don’t want to end up making the problem worse (although I’ll bite the bullet if this is the best way forward).

Any suggestions as to where I could go from here and what to try next would be gratefully received - should I speak to BT and get a line test done, should I try S/W EC, is there a setting that I’m missing in terms of echo training or something similar, should I try a different codec (can I even do this on an ISDN line).

Since adding the echocanceller line to the system.conf I have noticed the following in the logs when the dahdi module starts up…

Loading DAHDI hardware modules:
wct4xxp: [ OK ]
opvxd115: [ OK ]
wcte12xp: [ OK ]
wct1xxp: [ OK ]
wcte11xp: [ OK ]
tor3e: FATAL: Module tor3e not found. [FAILED]
r1t1: FATAL: Module r1t1 not found. [FAILED]
rxt1: FATAL: Module rxt1 not found. [FAILED]
wctdm24xxp: [ OK ]
wcfxo: [ OK ]
wctdm: [ OK ]
opvxa24xx: [ OK ]
opvxa1200: [ OK ]
rcbfx: FATAL: Module rcbfx not found. [FAILED]
zaphfc: [ OK ]
wcb4xxp: [ OK ]
wctc4xxp: [ OK ]
xpp_usb: [ OK ]

Running dahdi_cfg: [ OK ]
Dahdi Started

Do the failed modules relate to Echo cancellation - I have tried searching for info on these, but could find nothing relevant.

If you need any more information to help out, please let me know - I’m fairly new to this (first IP phone server), but have been hugely impressed with everything it can do, even with the echo cancellation issues - I’m definitely a convert !


more /etc/dahdi/system.conf


Do NOT edit this file as it is auto-generated by FreePBX. All modifications to ;

this file must be done via the web gui. There are alternative files to make ;

custom modifications, details at: ;




more /etc/asterisk/chan_dahdi.conf

; Do NOT edit this file as it is auto-generated by FreePBX. All modifications to ;
; this file must be done via the web gui. There are alternative files to make ;
; custom modifications, details at: ;


; generated by module
#include chan_dahdi_general.conf

; for user additions not provided by module
#include chan_dahdi_general_custom.conf


; for user additions not provided by module
#include chan_dahdi_channels_custom.conf

; include dahdi groups defined by DAHDI module of FreePBX
#include chan_dahdi_groups.conf

; include dahdi extensions defined in FreePBX
#include chan_dahdi_additional.conf



to taste.

Thanks for that - been looking at how to do this and fxotune seems to be the way forward (well one way at least). I tried running fxotune and get the following…

fxotune -i -b 1 -e 6 -p -vvv

Tuning module /dev/dahdi/1
Unable to set impedance on fd 4
Tuning module /dev/dahdi/2
Unable to set impedance on fd 4
Tuning module /dev/dahdi/3
Unable to set impedance on fd 4
Tuning module /dev/dahdi/4
Unable to set impedance on fd 4
Tuning module /dev/dahdi/5
Unable to set impedance on fd 4
Tuning module /dev/dahdi/6
Unable to set impedance on fd 4

I’m clearly doing something wrong, but can’t work out what ??

Any chance of another nudge in the right direction ??

fxotune is for fxo (analog lines) your’s are not such a beast.

Turn off hardware echo cancelling, find a milliwatt test number for rx and connect it to the internal milliwatt application, then use dahdi_monitor -vv (channel num) and adjust tx and rxgain to look much like an old vu-meter (about 70 percent) it is best to fully restart dahdi (means stopping asterisk first) after changing the rx/tx gains. Once the “hybrid” is properly balanced, then the hwec will work much better and your clients will stop shouting (or whispering) at you :wink:

(repeat for each B-channel if necessary)

Firstly, thanks a lot for the advice so far, it is really appreciated - I would never have got my system up and running without the information I’ve found on these forums already.

Now onto the additional plea for help - does anyone know of a WORKING milliwatt test number in the UK. I have searched everywhere and keep drawing blanks. The main telco in the uk (BT) has a test line (17070) but this is for quiet line tests - I can’t find an option for a test tone.

All of the numbers I have found online appear to be old posts, and when dialed I get a number not in service message (or service no longer available in the case of the last one) - e.g.

(0) 1-523 London LADbroke 0002 Milliwatt Test Tone
(0) 1-647 Wallington and Carshalton 0002 Milliwatt Test Tone
(0) 253 Blackpool 20002 Blackpool Milliwatt Test Tone

I found the following number from voip-info… (UK) Echo and audio quality tests sip:[email protected] or PSTN:+441483604781 - Allows test / connection from anywhere.

This has an echo test option, but the line is quiet and as you talk your voice is echoed back to you.

In desperation, I’ve also tried trial and error in the tx and rxgain settings, setting them both to 5, then 3 then -3 to see what difference it would make - in each instance, our receptionist reported that the problem was worse with more voice clipping. I can see (or at least hear) that the tx/rxgain settings are having an effect as the handset volume changes with the settings, I just need to find out what the optimum setting is for FreePBX and our OpenVox H/W EC module to do the necessary on the echo front.

OK, So I’ve made some progress. I’m using a milliwatt test number from the US (001 313 937 9996) which is working - yay ! Not exactly local, but at least I have a tone I can use to tune.

Running dadhi_monitor 1 -vv whilst calling the test line has allowed me to tune the rxgain - here are the results so far:

Rx: 14400 rxgain = 0 EC ON
Rx: 13400 rxgain = 0 EC OFF
Rx: 11400 rxgain = -2 EC OFF

Rx: 4500 rxgain = -10 (this is about 70% full on the rx meter)

I read elsewhere of a magic number of 14800, but was unsure if this again referred to FXO ports ? With the gain down at -10 external calls are very quiet even with the handset volume up at max.

My question is, how do I connect the external milliwatt test number to the internal milliwatt application ?

From info on similar posts, I have added the following to extensions_custom.conf

exten => 88888,1,Answer()
exten => 88888,n,Milliwatt()

If I call the test number then try to transfer the call to ext 8888, I get “Service not Available”. Checking the logs shows

“Channel ‘SIP/250-0000000a’ sent into invalid extension ‘8888’ in context ‘outbound-allroutes’, but no invalid handler”

I know I’m probably being thick here, but do I need to setup an extension 8888 under extensions as well and if so should it have any specific settings ?

I do feel I’m getting closer, albeit slowly. I’ve been reading loads but have probably missed something obvious. Can anyone point me in the right direction ?


make a “call.file” with the contents of

Channel: DAHDI/1/0013139379996
Application: milliwatt

chown asterisk:asterisk call.file

then to trigger:-

cp call.file call.out;mv call.out /var/spool/asterisk/outgoing;dahdi_monitor 1 -vv

repeat for each dahdi channel.