Setting TXGAIN and RXGAIN

How or where do I set the TXGAIN and RXGAIN for an FXO port on a TDM410P while using FreePBX? I have 1 FXO port and 3 FXS ports. The gain values need to ONLY be set for the FXO port. I know how to manually edit the config files to accomplish this. What I cannot figure out is where to do it so that FreePBX does not overwrite the changes.

I’ll remove DAHDI configuration module. Thanks for the suggestion. I assumed there would be a way to do a custom configuration within the module. Perhaps in a future update… thanks again!!!

First off. Don’t use the DAHDI module written by FreePBX if you want your settings to stay

Then edit “chan_dahdi.conf”. I’m running 2.9 and I just checked a remote machine and everything is still there and in the right places. Even after a reload.


;# Flash Operator Panel will parse this file for dahdi trunk buttons
;# AMPLABEL will be used for the display labels on the buttons

;# %c Dahdi Channel number
;# %n Line number
;# %N Line number, but restart counter
;# Example:
;# ;AMPLABEL:Channel %c - Button %n

;# For Dahdi/* buttons use the following
;# (where x=number of buttons to dislpay)
;# ;AMPWILDCARDLABEL(x):MyLabel 
;rxgain=8.0
;txgain=4.0
  


[channels]
language=en

; include dahdi extensions defined in FreePBX
#include chan_dahdi_additional.conf

; Span 1: WCTDM/4 "Wildcard TDM400P REV I Board 5" (MASTER) 
;;; line="1 WCTDM/4/0 FXSKS  (In use) (SWEC: MG2)"
signalling=fxs_ks
callerid=asreceived
group=0
context=from-pstn
;context=to-milliwatt
rxgain=10.5
txgain=10.5
channel => 1
callerid=
group=
context=default

;;; line="2 WCTDM/4/1 FXSKS  (In use) (SWEC: MG2)"
signalling=fxs_ks
callerid=asreceived
group=0
context=from-pstn
;context=to-milliwatt
rxgain=10.5
txgain=10.5
channel => 2
callerid=
group=
context=default

;;; line="3 WCTDM/4/2 FXSKS  (In use) (SWEC: MG2)"
signalling=fxs_ks
callerid=asreceived
group=0
context=from-pstn
;context=to-milliwatt
rxgain=10.5
txgain=10.5
channel => 3
callerid=
group=
context=default

;;; line="4 WCTDM/4/3 FXSKS  (In use) (SWEC: MG2)"
signalling=fxs_ks
callerid=asreceived
group=0
context=from-pstn
;context=to-milliwatt
rxgain=10.5
txgain=10.5
channel => 4
callerid=
group=
context=default

FXOTUNE optimizes the impedance of the line interface to reduce reflections which cause an audible echo. It does nothing to compensate for line losses which result in low audio levels. The function of txgain and rxgain in the chan_dahdi.conf is to compensate for these losses. I can find NO way to set these values while using FreePBX that does not get overwritten. The placement of the custom configuration files does not seem to be useful for setting these values either.

You should use the FXOTUNE utility to set the levels. It will optimize them for least echo.

Hello there I followed the steps above. I disabled the dahdi config. module and edited “chan_dahdi.conf” accordingly.

rxgain=80
txgain=80

[channels]
language=en

line="1 WCTDM/4/0 FXSKS (In use) (SWEC: MG2)"
signalling=fxs_ks
callerid=asreceived
group=0
context=from-pstn
context=to-milliwatt
rxgain=50
txgain=50
channel => 1
callerid=
group=0
context=default

line="2 WCTDM/4/1 FXSKS (In use) (SWEC: MG2)"
signalling=fxs_ks
callerid=asreceived
group=0
context=from-pstn
context=to-milliwatt
rxgain=50
txgain=50
channel => 2
callerid=
group=0
context=default

line="3 WCTDM/4/2 FXSKS (In use) (SWEC: MG2)"
signalling=fxs_ks
callerid=asreceived
group=0
context=from-pstn
context=to-milliwatt
rxgain=50
txgain=50
channel => 3
callerid=
group=0
context=default

line="3 WCTDM/4/2 FXSKS (In use) (SWEC: MG2)"
signalling=fxs_ks
callerid=asreceived
group=0
context=from-pstn
context=to-milliwatt
rxgain=50
txgain=50
channel => 3
callerid=
group=0
context=default

Nothing changes with the volume level.
Thanks for the help.

Please pay attention to what you are trying to do, you have comment lines that you uncommented, you have multiple context’s that will super-cede the previous one, given that, I doubt that you even have a [from-milliwatt] context that works.

Further, rx and txgain are in db’s so 50 or 80 is generally “an awful lot” and might well be rejected as valid, even if it was however, nothing will change until asterisk is stopped, dahdi is restarted and asterisk is started again.

Perhaps you need to start over after a little study maybe?