Asterisk echo avoidance

Asterisk Echo Avoidance

Basic tips:
  • reduce your microphone volume and see if the echo on the other side goes away by that
  • introduce QoS on your part of the network to reduce latency (latency makes echo audible)
  • use only A-law or u-law because those are less lossy/compressing codecs that an echo canceller can much better deal with
  • see if you can reduce jitter (or stabilize it), as varying jitter is a challenge for every echo canceller
  • control/avoid packet loss as much as possible on your network because echo cancellers can usually not deal with that
  • headsets and software VoIP clients are often causing echo themselves (due to bad mixer settings, cheap headsets, ...), so better run your tests with a hardware VoIP phone

The problem arises when:
- you have some echo induced somewhere (your call goes through a 2 wire line)
- you have some delay induced somewhere (you use VoIP for instance)
In this scenario, echo becomes noticeable, and disturbing. You need to echo cancel at the closest from the source (in the ATA, for instance).

The following should not result in noticable echo:
VOIP Phone <-> Asterisk <-> VOIP Phone
VOIP Phone <-> Asterisk <-> T100P <-> PRI

I'm extremely dubious about the second of these claims. It's very likely that the telco won't bother doing any echo cancellation on a local call, on the basis that the echo path should be sufficiently short that you won't notice it; however, because you're using VOIP, the echo delay becomes noticeable, and the user of the VOIP phone will hear echo.

Assuming that the VOIP Phones do adequate echo cancellation at their end (which any VOIP phone worth its salt should), agreed that neither party will hear echo for the first situation.

Richard van der Hoff, July 2005

These have the potential for noticeable echo. An analog phone is a 2-4 wire hybrid (ear and mike -> 2 wire). FXS and FXO modules have 2-4 wire hybrids:
Analog phone <-> TDM10B-FXS <-> Asterisk <-> TDM01B-FXO <-> PSTN
Analog phone <-> ATA <-> Asterisk <-> TDM01B-FXO <-> PSTN
VOIP Phone <-> Asterisk <-> PSTN

It's often an issue of quality of the hybrids. I have been very happy with the TDMxxx hybrids, and very unhappy with the X100/101P hybrids.

In this setup, the channel bank provide the needed, and adequate echo cancellation:
Analog phone <-> Adtran TA750 <-> T100P <-> Asterisk <-> TDM01B-FXO <-> PSTN
Analog phone <-> Adtran TA750 <-> T100P <-> Asterisk <-> T100P <->PRI>

VOIP phones can throw a DSP at the echo problem and will generally have great success since the ear and mike interfaces are pretty much standard - you don't have unpredictable interfaces like you do on the PSTN side.

One other thing not often mentioned regarding Asterisk and echo, is the #define AGGRESSIVE_SUPPRESSOR in zconfig.h in the zaptel-source. If you have lots of trouble with echo, that cant seem to be solved any other way, try to uncomment this.

Also see the (somewhat obscure) reference to the same thing in Hunting the Echo: What to do if you have echo problems in Asterisk for some not-so-positive comments on the same thing.

Martin Kihlgren, 2004

One reason that AGGRESSIVE_SUPPRESSOR is less commonly talked about is because it switches your T1 to half-duplex mode, meaning you can hear OR talk, but not both (no interruptions). Sure, if we were all polite, this wouldn't matter, but in a functional phone system this simply isn't a tolerable scenario.

If you are unable to get rid of echo it is worth trying this: In the zconfig.h file a new zaptel echo canceller called ECHO_CAN_MG2 (MG2), Edit this file (found in /usr/src/zaptel on AAH) compile the driver end compile Asterisk - no echo at either end!!!

See also:

Asterisk | Tips & Tricks | FAQ
Created by: flavour, Last modification: Sat 26 of Jun, 2010 (07:19 UTC) by valer77
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+