[asterisk-users] SIP / Echo Cancellation

Vinícius Fontes vinicius at canall.com.br
Thu Mar 4 19:42:47 CST 2010


----- "Chandrakant Solanki" <solanki.chandrakant at gmail.com> escreveu:

> Hello
> 
> I have successfully compiled OSLEC for echo cancellation for DAHDI
> channel.
> 
> Is there any way to do echo cancellation for SIP Channel.
> 
> Is any, please suggest me.??
> 
> Thanks in advance..
> 
> --
> Regards,
> 
> Chandrakant Solanki

Short answer: Maybe. Depends on the SIP device you're using.

Long answer:
*takes a deep breath*

First you gotta understand why echo occurs. Every single call you've ever made on your life has echo. You can hear yourself when you're speaking. If that was not the case, it would feel like talking on a push-to-talk system. So echo is a natural and even desirable phenomenom. What makes echo unconfortable is when the echo is *delayed* too much.

There's a number of causes for this to happen. First and foremost, sometimes a part of the signal you're transmitting is reflected back to you. That usually happens on the analog part of the system (analog phones as a whole, the handset of an IP phone, the headset connected to your computer's sound card, etc). When we're talking about VoIP, the latencies involved are much higher than a completely TDM system. There's the encoding latency, easily understood as the time the device takes to convert the analog signal (your voice) in RTP packets, then there's the transmission latency, inherent to any network, and so on. All those latencies add up to each other, making the total latency go skyhigh and making you hear your own voice delayed by some milisseconds - the infamous echo.

Asterisk cannot cancel echo when the call is entirely IP, from an IP phone to another, for example. There's simply no need for that. That's because it's the device's job to cancel the echo caused by its own TX reflections or analog/digital conversions. On the other hand, Asterisk can and will cancel echo if you have a hardware echo canceller or a software based one, like OSLEC -- which is by far the best software echo canceller I've ever seen.

Finally, in order to solve your problem, you'll need to check a few things. If the call is entirely VoIP, from one end to other, then the IP phones, ATAs, gateways, softphones, whatever, are the sole responsibles on cancelling the echo. You'll need to turn on echo cancelling on this devices or tweak its parameters. Also, don't forget that latency makes echo much worse. If you control the entire network between the two phones, you MUST set up a QoS policy in order to minimize the latency as much as possible. I've solved many echo problems by just implementing end-to-end QoS on the network.

Lastly (I swear I'm finishing this essay right here :), if that's not your case and you're having echo issues calling from a SIP phone to an external number, double check if OSLEC is indeed set as the echo canceller on /etc/dahdi/system.conf and enabled with echocancel=yes on your chan_dahdi.conf. You can always check if the echo canceller is active on a certain DAHDI channel by issuing the command "dahdi show channel XX" on Asterisk CLI, where XX of course is the said DAHDI channel.



More information about the asterisk-users mailing list