How to edit wanpipe1.conf?

I have a problem with DTMF in FreePBX witch Sangoma Card.
Sangoma support suggest to enable TDMV_HW_DTMF in /etc/wanpipe/wanpipe1.conf. But this file is overwritten each time i start freePBX (even when i deny write permission).

How I can edit this file ?

The best idea is ask the customer engineer you are working with to do this for you. Simply provide them with SSH access and they can log in and get this going for you.

Marc Celsie

Why do I have to waste time technician if I can do it alone ?
I know what to change, I know where to change it.
Only after the changes in the latest version of FreePBX Disto card configuration is by the web panel, that overrides changes in text files (provide by sangoma drivers). And nowhere in the Panel, I see no possibility to change parameters of this particular file.
So this is a problem on FreePBX site not Sangoma

You could disable config writes or disable/uninstall the DAHDI module if you will not be using it.

I can also compile linux, asterisk and freepbx from sources but is not the point
I just want to edit a 1 file without overwriting.
If it is more than change some varible, permission or add something in database, and that option will be available after next update i will be grateful.

I know that ability to configure Sangoma card through web interface is new, but the update process is designed to eliminate the problemslike this

What does compile linux, asterisk and freepbx from sources have to do with this issue?

Some of the modules are designed to make it easier for most people to configure the system. Sometimes this easy of use limits what can be changed in the config files. If the module does not fit your needs the solution is to not use it and do the config by hand. IF you want to stop FreePBX from overwriting the file you need to go into advanced settings and disable the ability of the DAHDI module to write to the configs or disable/uninstall the module.

May I make a suggestion, this is probably just a good, old fashioned bug.

Submit a bug report and one of the dev’s will check it out and see what is up. It sure sounds like a bug if it worked and now you can’t add custom settings.

Bug reporting link on right side of page.

I am inclined to agree with Skyking. I have two very similar FreePBX systems, both running identical Sangoma DAHDI hardware, both with the wanpipe driver. These systems were set up a year apart so there are minor differences between asterisk versions and OS versions, but the main difference is that one uses the FreePBX DAHDI config module, and the other does not. Comparing date stamps on the file /etc/wanpipe/wanpipe1.conf on the two systems, the PBX running the FreePBX DAHDI config module is dated two days ago, the most recent reboot. On thhe other system, the file is dated from the day a year ago when the TDM card was installed.

At the moment I can’t confirm if changes to wanpipe1.conf persist between reboots, but can test after hours if requested. In any case, if this file is ‘owned’ by FreePBX, there is no header indicating as such, only the header generated by the Sangoma setup script:

Note: This file was generated automatically
by /usr/local/sbin/setup-sangoma program

Could there be something in the FreePBX DAHDI config module that forces the Sangoma setup to generate this file on every reboot?

I don’t know about that but you set the file read only until the devs have a look at it.

I have just discovered another difference between my two systems that may account for the differences. The FreePBX DAHDI Config module generates the content for the file /etc/wanpipe/global.con with defaults as follows:


The globals file is not present on the other system. The above settings are all configurable from the GUI, and I tried to research what they mean but without success. I don’t want to do a trial and error and reboot on a production system at the moment, perhaps OP can determine if any of the above settings might be responsible for overwriting the wanpipe1.conf file at boot.

My testing shows that browsing to FreePBX, Connectivity, DAHDI Config, Sangoma Settings and setting “Run wanpipe in DAHDI mode” to ‘False’ allows the file wanpipe1.conf changes to persist between reboots.

I am not sure at this point what the ramifications of this setting means.

To edit the wanpipe*.conf files in /etc/wanpipe/ and have the changes stick through a restart simply do the following.

  1. Edit /etc/wanpipe/global.conf and comment every line by placing a “#” in front of each line.
  2. Edit /etc/wanpipe/wanpipe*.conf files and make the changes you would like to do.
  3. Run “amportal stop”
  4. Run “wanrouter start”
  5. Run “amportal start”

You can now check /etc/wanpipe/wanpipe*.conf and the files will not have been overwritten as they previously were.

If you would like to make changs from the FreePBX webUI then simply reverse the producure in step #1 above and follow steps 2-5, then make the changes you wish in the webUI then follow steps 1-5 again.

If there is any questions please make a ticket at referencing this post.


This is wrong as next time they go into the DAHDI module those changes in global.conf get reverted back as that is a file we write out to and control at the request of your own LEAD engineer Nenad.

When wanpipe is in DAHDI mode it reads on boot whats in dahdi/system.conf and writes out wanpipe1.conf and so forth. This is a feature written by Sangoma inside wanpipe.

Hi Tony,

Yes you are correct, this is the way Nenad has designed this.

The steps I have posted here are how to make manual changes in our wanpipe*.conf files. Of course the changes will have to be redone this is why I have put the note below in my original post.

===After WebUI Changes are Done===
If you would like to make changes from the FreePBX webUI then simply reverse the procedure in step #1 above and follow steps 2-5, then make the changes you wish in the webUI then follow steps 1-5 again.

No that is my point. It will revert all your changed just by going into the module and making a change. FreePXB owns and controls that file just like asterisk.conf files.


I have that exact problem (DTMF problem and I want to enable the DTMF hardware detection of my A200 echo canceller).

Maybe I missed something but it doesn’t look like an actual solution to the problem was given, right?

Any suggestions?


It seems the wanrouter start script will build wanpipe1.cfg from /etc/wanpipe/wancfg_zaptel/templates/wanpipe.tdm.a200 (or the respective file…). So you would need to change that template file by hand.