"Protected" change to dialplan

Newbie question: We want to modify the dialplan in freepbx to allow fax detection for all configured extensions. What section of the dialplan can we make the changes without it being overwritten in future updates and/or when freepbx writes out its dialplan?

Thanks in advance…

_custom.conf files
or create your own files and use the #includes

I figured I would have to use some of the _custom files and that makes sense. To do the fax properly the extension must be answered and then NVFaxDetect run to see if it is a fax. The problem is I’m trying to figure out an approach to do this without breaking the normal flow of the dialplan.

It seems like all the processing for local extensions is in ext-local so I was thinking to create a custom ext-local-custom. What I’m not sure is:

  • How to make sure all extensions have the fax detection done.
  • If answering to detect the fax will create a problem
  • What the Goto() after the NVFaxDetect should be

I’ll experiment around but if you have suggestions I’d appreciate it!

The dialplan macro for receiving faxes is there ready for use. So just add

exten => fax,1,Goto(ext-fax,in_fax,1)
exten => h,1,Hangup

The lines you listed are already in the [from-pstn] section and I also tried adding them as indicated in a [ext-local-custom] section. I’m still not getting the faxes detected. I’m pretty sure that this is because the follow-me option is getting invoked before it hits this section.

I’ll experiment some more with the [ext-local-custom] and see if I can get it to work. Thanks for your help.

Does your 666 (incoming fax test) work?

No, 666 does not work. I am able to receive faxes in our main IVR. When I dial 666 I get a busy signal and the last line reported by Asterisk is Goto(ext-local,666,1).

[quote=“kgtee”]The dialplan macro for receiving faxes is there ready for use. So just add

exten => fax,1,Goto(ext-fax,in_fax,1)
exten => h,1,Hangup[/quote]

Sorry, this one is not going to work. I realised this ext-fax will only fax to one destination fixed by the inbound route, not to individual extension. Mmm…tricky.

By adding these lines in the extensions_custom.conf I can get any DID’s that are not defined elsewhere to work the way I want. I just need to figure out how to make the wildcard’s get processed before the specified extensions.

exten => _X.,1,set(FROM_DID=s)
exten => _X.,n,Set(FAX_RX=system)
exten => _X.,n,Set(FAX_RX=${DB(AMPUSER/${EXTEN}/faxemail)})
exten => _X.,n,Answer
exten => _X.,n,Playtones(ring)
exten => _X.,n,NVFaxDetect(0)

FYI, the DB call is based on an enhancement I made to the ARI interface to store the emaila address of the specific extension.

I put this in the ext-did-custom but I think it should be in the ext-local to impact all extensions.

I think that the problem is the dialplan uses a Goto statement to get into the ext-local context. The Goto points to the extension, 1 line. I’m not sure I can override this at all with a wildcard and/or the ext-local-custom configuration. I’ll keep trying and let you know what I find out.

I can’t find a way to work around the Goto statement. I did, however, find a way to modify the PHP code to generate the additional statements that I have found work. I modified the /var/www/html/admin/modules/core/functions.inc.php to put the additional lines I want included starting at line 268. I know this isn’t a “protected” method but maybe I can generate a patch file for it. The initial test worked great…doing some additional testing now.

The version FreePBX I’m running already has the ability to have fax email and detection settings per user. I’m using it to direct fax calls on a user DID to HylaFax for each user.

I’m not sure why you’re patching for this?

Which version are you using? I must be missing something pretty basic which wouldn’t surprise me.

My boxes are on 2.2, I believe. I’m not at work yet, so I can’t check. I know that I’m in device/user mode and on the User page, I set a DID for each user, a fax extension (I use IAXmodems and HylaFax), fax email and detection type/timeout.

I use NVFaxDetect, a 4 second timeout and I direct fax calls to IAXmodem extensions for each user.

I’m on 2.1.2 which may be the issue. I’ll try to upgrade and see what happens! :slight_smile:

I’m on FreePBX 2.2 Beta1, but I see Beta2 has been released.

the 2.2 release has whole host of improvements including the fax features. i’ll look further into this…looks like it is all there!

Everything I was attempting to accomplish is done with 2.2. I haven’t had any issues! Thanks!

i want to achieve the above described (configure fax handling per user). my box is trixbox 2.2, asteirsk 1.2.22, freepbx 2.2.3.

aparently this worked in 2.2, anybody has this working in 2.2.3?

it does not work here. the fields are filled in the db (ej. Fax extension: system, Fax Email: [email protected], Fax detection type: NVFax, Pause after answer: 4) but there aren’t any respective lines added in the extensions_additional.conf.

is anybody using this? thanks for any feedback.

There are plenty of people who have fax detection enabled in the extension configuration and it is working (to the extent that Asterisk is happy with faxing). If your conf files are not getting written out then? If they are getting written out then the appropriate changes should be made. Do you know what you are looking for?

Philippe Lindheimer - FreePBX Project Lead
http//freepbx.org - IRC #freepbx