BreadCrumbs: Asterisk Echo

Asterisk Echo

From Luke Jackson

Revision as of 22:37, 1 December 2006; Ljackson (Talk | contribs)
(diff) ←Older revision | Current revision | Newer revision→ (diff)
Jump to: navigation, search

Contents

Visually Monitor a Zaptel channel:

[root@asterisk ~]# ztmonitor <channel num> -v

Record a Zaptel channel:

[root@asterisk ~]# ztmonitor <channel num> -f <filename.raw>

Convert the raw file to a wav file for review.

sox -r 8000 -s -w -c 1 <filename.raw> <filename.wav>

eMail the recording to yourself:

uuencode <filename.wav> <filename.wav> | mail -s <filename.wav> <email@server.ext>

Next we need to make sure our echo settings, these settings are in /etc/asterisk/zapata.conf

The settings we will be looking at are listed below with typical default settings.

echocancel=yes echocancelwhenbridged=no echotraining=800 rxgain=0.0 txgain=0.0

Let's take a look at what these settings actually do.

echocancel Obviously this disables or enables echo cancellation, it is recommended to not turn this off. The yes setting sets the value to 128, this is the number of taps that are used. Each tap is one sample from the data stream. You can specify the number of taps to use as 16, 32, 64, 128, or 256. It is very rare that you need anything other than setting this to the yes setting.

echocancelwhenbridged This enabled or disabled echo cancellation when TDM calls are bridged. TDM calls should not need any echo cancellation but some people report improved call quality with this option turned on.

echotraining A common echo symptom is that at the beginning of a conversation there is a good deal of echo and then it fades away as it it trains itself. If this delay is too long, you can adjust the training cycle. The setting is represented as milliseconds and can accept any value between 10 to 4000. Making the setting to low will not enable the system to train properly. I find that setting this to 128 is often a good starting point.

rxgain This adjust the gain of the inbound signal. While Asterisk will accept any number from -100 to 100 (-100% to 100% of capacity) it is recommended to never put the values to more than -11 to +11 and in some case anything outside of the -5 to +5 range will actually cause audio loss (mostly on the TDM400 cards).

txgain This adjusts the audio gain for the signal being sent out to the phone line. While Asterisk will accept any number from -100 to 100 (-100% to 100% of capacity) it is recommended to never put the values to more than -11 to +11 and in some case anything outside of the -5 to +5 range will actually cause audio loss (mostly on the TDM400 cards).

One of the first questions commonly asked is "what is the best settings for the rxgain/txgain?" and simply put, there is no "best settings" that will work for everyone. Every installation is different as there is no perfect consistency between telephone line quality, impendence, line length, etc. So how do you know what settings to use to make the system work properly? Well, the zaptel developers have created some handy tools to help us with that. The primary tool we will use is ztmonitor This tool allows us to visually see the audio levels on the RX and TX sides allowing us a guide to adjusting the levels in the zapata.conf file.

The command format is: ztmonitor <zap channel> -v

An example of monitoring zap channel 3 during a conversation is shown here:

[root@asterisk1 ~]# ztmonitor 3 -v

Visual Audio Levels

Use zapata.conf file to adjust the gains if needed.

( # = Audio Level * = Max Audio Hit ) <-------------(RX)-------------> <-------------(TX)-------------> ################ * ######################### *

If those were the maximum levels that we were seeing during a call, we would know that the RX gain is set pretty good but the TX level is way too high. What we are looking for are peaks that don't go past the middle of the meter.

Although this may sound complicated, it is fairly simple to adjust these settings on the fly. My prefered way is to use an SSH client such as Putty to have three sessions open at the same time. One window will have the Asterisk CLI, the second will be running ztmonitor, and the third will have zapata.conf file open in an editor. During the call, if you need to adjust a setting, make the change to the file and save it, then switch to the Asterisk CLI and type the following:

asterisk1*CLI> reload chan_zap.so

This will reload the zap module without hanging up the call. When you have made you adjustment, stop and restart Asterisk just to make sure you have the right settings. With a little practice you should be able to do these basic echo adjustments in just a few minutes.

Again, this will not solve every echo problem, but for the majority of installations we have done, this was all we needed to do to virtually eliminate the echo problems from the TDM and TE connections.

Personal tools