Generating mmilliwatt test tone on a zap channel using FreePBX?

I’m trying to adjust some of my gains for my zap channels. My card has 8 ports. Two are direct lines to the outside world and the rest go to an old PBX. I removed the txgain and rxgain options from the zapata.conf file. I then edited all the channels in the zapata-auto.conf file to contain their own gain vales. I hope this is safe to do since that file does state “do not hand edit this file.” (I have my file backed up in case I auto generate over top of it accidentally.) This is working and I can now control the gain on each channel separately. My question is how can I set up an incoming rout to generate the “type 102 milliwatt test line” tone via FreePBX? I really don’t want to dig into the extensions.conf file unless I need to.

I also wanted to get some opinions on the usefulness of the ztmonitor app. Some say using it is pointless just go by ear. Others say the graphical bar is useless and to patch it to spit out a numeric value instead. Some say to adjust the gain so the bar graph is at about %50 some say to adjust to %100. Personally I’m just adjusting the gain still I get %100 without clipping above that using a milliwatt test line. This seems to be plenty loud without distorting anything.

All input is greatly appreciated.

Thanks for all the hard work FreePBX!


Or how can I set up a a FreePBX zap channel to pickup a ringing line and simply play a dial tone until the caller hangs up?


I did this by placing the following lines in extensions_custom.conf:

exten => s,1,Answer()
exten => s,n,Milliwatt()

Then I created an inbound route that pointed to a Custom App containing “custom-testtone,s,1”.


Ah ha perfect. How about just generating a ring tone rather than a test tone? Thanks for your input. Very helpful.


I haven’t tried it, but you should be able to do that by replacing Milliwatt() with Playtones(ring). Playtones() returns immediately, though, so you’ll need to follow it with a Wait(999) or something.

Playtones() takes as an argument a tone name listed in your indications.conf file or a list of frequencies and durations, so you should be able to play just about any tone you want this way.