Custom .conf files


I am a bit of a newbie when it comes to using FXO cards with FreePBX, I’ve only ever used SIP trunks before.

I have just installed a TDM400 FXO/FXS Card into my new FreePBX box. After playing around I have found 2 problems. The first is that CallerID in the UK doesn’t work and there is a bad echo.

However I have found that I can fix them by adding/updating the following to the following files:


cidsignalling=v23 ; Added for UK CLI detection
cidstart=polarity ; Added for UK CLI detection
callerid=asreceived ; propagate the CID received from BT.



The problem that I am experiencing is that if I reboot the box all is fine, however if I make a change to the FreePBX and click apply changes they all get overwritten.

Which custom files should I be adding these settings to?



Assuming you’re using one of the latest distros, you can add the chan_dahdi.conf entries through the web interface…

Connectivity / DAHDI - then select Global Settings from the menu on the right hand side. Some of the parameters are pre defined, and you just need to select the correct value. The others can be added through the ‘Other Global Dahdi Settings’ entry.

These settings generally survive a FreePBX change, but I’ve noticed that they sometimes revert back to default.

Another couple of useful options to add in this field (for UK BT) are:
Enable Echo Training (echotraining in the conf file)=800

I’m not so sure about the best way to avoid the system.conf entry from being over-written. I have similar issues, but notice that this entry is only lost if I’m making specific DAHDI config changes. I just go back into the file and re-add the entry then restart DAHDI from the web interface.

Like you, I would like to find a way to avoid having to do this!

tm1000 is working on giving us the option of saving something to system.conf


Until then…you can always try to make root the owner/group of the file, This should prevent freepbx to make changes (I am not sure if freepbx changes the permissions of that file on a restart yet)

Thanks for the pointers guys. I’ll take a look at it over the weekend and see how I get on :slight_smile:

Yes it will change permissions on an amportal start or restart.

I see that an update last night now allows custom system.conf settings which is great news! :slight_smile:

Does anyone have any tips or recommendations on things I should try when trying to reduce echo on calls through the TDM400 card?


You should set up your system.conf file (which you can now do from the Connectivity / DAHDI / System settings via the web interface) with echocanceller=mg2,x

where x = the channel of the FXO port that is connecting to your BT line. More parameter options for echocanceller (for specifying multiple ports) can be found here:

Per my earlier post, you should also set up your chan_dahdi.conf file (which again you can do under the Connectivity / DAHDI / Global settings via the web interface) with the Enable Echo Training=800 (this is actually written to the chan_dahdi.conf file as echotraining=800)

With these two parameters set correctly you should see a marked improvement with echo on the line.

There are usually two main causes for echo on a 2-4 wire hybrid, impedance mismatch and level imbalance, dahdi provides a tool to help the first problem documented here:-

Level mismatch needs that rxgain and txgain be set to appropriate levels, this is best done using what is called a millwatt test, there is an application in Asterisk named milliwatt() that will provide the local level at 1kHz, you will need to find a “local” number on your provider’s network that you can call and be provided with a far end milliwatt signal at 1khz.

Make a callfile that will call that number and connect it on answer to milliwatt(), then adjust the gains so

dahdi_monitor (monitored channel) -vv

show about 70% for tx and rx. This is an iterative process as dahdi needs to be reloaded on each rx/tx setting cjhange (at least it used to so be needed :slight_smile: )

Once those settings are made, then your echo-canceller hardware or software will have a MUCH better chance of being effective.