Distorted echo inside the network on FXO channels

Hello Community,
I am having a strange problem with a deployment of FreePBX 13.0.190.7
i have 20+ Aastra 6731i and one Cisco 508G, the aastra phones create a distorted echo only audible by the person who is talking on the phone, and only echo the person’s own voice. the receiving party does not hear the echo and it is not audible on recordings, on speaker phone the problem seems to be less pronounced. Cisco phones had no problems at first but today they too have some distorted feedback. the problem is more pronounced for external calls, and it builds up over time for long conversations. I tried replacing the handset, the phone, the codecs used (i tried g711 and g722). I also tried settings: handset tx gain: -10 in the provisioning file (aastra phones). The gain parameter helped a little but the distortion is still audible and annoying.
I have exhausted the limits of my asterisk knowledge, i was thinking of replacing the catalyst PoE switch, but i don’t see how this could affect call quality. any ideas would be greatly appreciated.
Thank you

Did this happen in a previous version of FreePBX or Asterisk?

Did you do a firmware update recently on your phones?

If the playback volume has significantly increased as of a software update then it is possible that the headset/handset on the other end is too loud. As a result of being in close proximity to the mic the audio is picked up and re-transmitted back to the other end.

I’ve seen this on software updates to soft-phone apps. Solution is to turn the volume and/or gain down.

the phones are not close to one another, they are on different floors (within the same network). it is a fresh installation, i tried replicating in my lab, i could not replicate. It is mostly on external calls using DAHDI channels (FXO) i did not try disabling or tinkering with the DAHDI echo cancellation yet. bu the fact that it is intermittent and only audible by the person who is speaking makes it very difficult to weed out…

I understand the phones may be on different floors but if one person has their volume too high you can get one-way echo. Some mics these days are really sensitive. You may want to try playing with the gain settings if you have access to them.

This can occur if the echo cancellelor built into the handsets themselves or your dadhi hardware isn’t good enough or working properly.

it seems to be related to the dahdi echo cancellation, when i disable it the distortion disappears, but the echo is very pronounced. activating echo cancellation introduces distortion. i tried reducing the transmit gain with EC enabled, the distortion got attenuated but it is still there and rather annoying, reducing transmit gain also (naturally) made the user’s voice lower and harder to hear on the receiving end.

is there a way to do EC on SIP rather than DAHDI? what other areas exist to adjust volume options?

this thread is being discussed in >>> DAHDI audio problem with analog OpenVOX A400E FXO card

UPDATE:
after much coffee, sweat, and hair pulling i fell on this amazing post >>> http://kb.digium.com/articles/Troubleshooting/how-to-basic-fxotune

FXOTUNE ROCKS! problem solved just like that!

Luckily SIP is a standard that enables integration with different third party solutions. And yes there are EC solutions that can be configured as Sip Trunk or Sip Proxy. Usually configuration as Sip Proxy is simpler since it only requires changing the proxy on the phone. One example for SIP based echo cancellation is PBXMate.

Well it is 90% solved, still some echo bursts happen every now and then. not crippling but very annoying nevertheless… still looking for a solution. Ideas anyone?

the phones are on the latest firmware, this echo is audible on softphones and sip apps as well.

As I previously advised, next step after fxotune, is to tune your rx/tx against a milliwatt test, it probably won’t get better than that if dahdi is involved, generally any echo in SIP is either underlying echo that is as yet unconstrained or inappropriate acoustic coupling as rx/tx are separate streams that can of course be asynchronous but that causes delayed audio, not echo

i was just reading your post at >>>DAHDI and fxotune.vals
i never dug this deep, i am setting myself up for the milliwatt test, but not sure what you mean by the far end test… should i call into another FXO on the same box and run a monitor on both channels?
also this is what my fxotune.conf looks like:
1=5,3,251,250,2,254,0,0,255
2=5,3,251,250,3,254,255,255,255
3=5,3,251,250,2,253,255,255,255
4=5,3,251,250,2,253,255,255,254

11=5,3,251,251,2,253,255,255,255
12=5,3,251,250,2,253,255,255,254

are these values in the realm of the reasonable?
Thank you for following up dicko, your knowledge is paramount!

No you need to connect to a milliwatt signal on another PSTN connection, ideally one on your local office harware, (hard to find but most all CO’s have them, ask an engineer, make sure he is over 55 :slight_smile: ) but because of the digital nature of the PSTN nowadays, most any will be usable.

Echo has been a problem on phone lines for the last 150 years, it is just physics, largely now the only remaining cause is on the “last mile” between you and the CO which is an unconstrained “transmission line”, spurious inductance or capacitance will unbalance it against the CO hardware as will longer distances , but matching the perceived impedance (fxotume) and balancing the RX/TX will best tune your 2-4 wire hybrid (the FXO pair) for best effort. it is best to consider each FXO as a separate circuit when adjusting gains as the can be surprisingly different.

this is a small deployment, i do not have the equipment nor the human resources this requires… i am trying to isolate the problem, if my reasoning is correct, the fact that it is intermittent rules out card/motherboard incompatibilities. it can vary by a lot, from near grade-a to total garbage. the average is somewhere around a tolerable annoyance. an interesting fact is that the voice quality is much better on the CISCO phones than on the aastra.Even if the ciscos still give hints of distant echo.
I am using a 2 wire connector, what do you think of the values of fxotune.conf? they seem to be at 255 for the most part.

I can’t speak for the specific values of the issue of fxotune -d , apart from they are different, hence so are your FXO’s.

The only resource you need to make those test calls is an FXO (you have a few) and a phone number.(perhaps 1-213-621-0002) and a quick rtfm of dahdi_monitor, no equipment required.

this will have to be my next step, i ran a dahdi monitor when the internal user speaks the TX on the FXO blows up. my transmit gain in freepbx dahdi config is at -8 my receive gain at 9 (for some reason the voice is low) RX levels on FXO are normal, i don’t see how i can further reduce TX levels

That is why you need to do a milliwatt test.(1kHz nominal at one milliwatt) you have the milliwatt application in Asterisk, connect it to another external milliwatt number, balance the rx/tx at 0db (perhaps about 75% in dahdi_monitor) , that is all it takes

no need for equipment for a milliwatt?

http://www.voip-info.org/wiki/view/Asterisk+cmd+Milliwatt dahdi_monitor is your “test equipment”

i get it, i generate a tone, monitor the levels and adjust values to reach what? 75%? how do i separate the gain per channel? the option is not in freepbx any usefull links? big thanks for your help

Yes, I don’t believe there is that granularity in the FreePBX dahdi helper module, but it is intrinsic in dahdi if you need to be that specific , think of dahdi monitor as an old fashioned VU meter…

1kHz( 1024 or 1004 depending) is midband logarithmically in the 300-3000 hertz bandwidth of a standard ulaw/alaw phone channel.