One of our friends contributed this today. A quick howto on how to configure TXGAIN and RXGAIN on Asterisk 1.4. Now, he’s got a analogue trunks from Bell Canada, so YMMV and you will almost certainly have to change all of the values mentioned here to be customized to your environment. From what we’ve read, some phone companies may even know this information when you call one of their tech’s and ask for it, bypassing the need for this work all together. However, echo and voip have long been battling siblings for many people, so we hope this little howto will help in that battle.

Here’s the Howto:

  1. Dialed the miliwatt test number from every zap channel

  2. Adjusted RXGAIN on each channel until ztmonitor gave me a value as close to 14844 as possible. This number is the “magic number” according to many sites on the Internet. We won’t link to them here, use Google. We ran this command to actually monitor each channel while testing:

     # ztmonitor <zap line> -vv
    
  3. Now we need to test and verify TXGAIN settings. In our case, we are using FreePBX, so we made modifications to extensions_custom.conf. In your environment things may be different. Just add the following to your extensions configuration file in Asterisk.

     # nano /etc/asterisk/extensions_custom.conf
    
     [from-milliwatt]  
     exten => s,1,Answer()  
     exten => s,2,Milliwatt()  
     exten => s,3,Hangup()
    
  4. Then we set all Zap channels to go directly to that context – “from-milliwatt” in our case. By editing the default zapata configuration file in /etc/asterisk

     # nano /etc/asterisk/zapata.conf  
     <your zap channels>  
     context=from-milliwatt
    
  5. Then a singular Zap channel was chosen to do all testing/dialing from.

  6. Then we dialed into each of the other Zap Channels.

  7. While we were on the line from the Zap Out –> Zap, we did the following.

a. We ran ZTMonitor on the channel we were dialing FROM

b. We adjusted TXGAIN on the channel we were dialing into via zapata.conf. Note that Asterisk will accept changes in realtime, and simply requires a “reload” or “module reload” instead of a full start/stop to test these values in zapata.conf.

  1. This continued for each channel, trying to attain the same value as before in ZTMonitor – 14844.

This is a lengthy, and boring task to complete, but, if you are having echo problems it’s definately one to try out for your Asterisk Phone System.