Send Called Number to external faxmodems

Hi All,

I’m running Elastix 2 with FreePBX

The system is configured with a T1 (10 channels) and one 4 port FXS card.

The 4 ports on the fxs card are all hooked up an external fax server running a Mainpine 4 port modem board (analog)

I setup 4 zap extensions 701, 702, 703 and 704 and they all belong to ring group 700. Fax comes in the first available modem answers.

I set up my inbound routes for various fax numbers we have to terminate on the ring group. All this works very well without any issues.

My issue/Problem. Since the mainpine fax modems are analog I can’t pass the DNIS (the fax number they called). The fax modems do allow you to pass this information via DTMF and that’s what we did with our old pbx before we switched to asterisk.

I’m a bit lost on how to do with inside of freepbx and what files to modify. I did read over some docs and I came across the following:


But I’m still lost any help would be appreciated. My problem is we have to sort and store the incoming faxes based on the fax number called as we assign that to larger customers.

thanks for your reply but many higher end fax boards do support this. It’s called DTMF routing and we used to do with with out Mitel PBX. I’m just looking for a way to replicate is in Asterisk.

Can anyone point me in some direction so I can research this myself ? :slight_smile:

What you are trying to do sounds like analog DID’s…FXS does not support DNIS signaling.

PRI’s support DNIS.

Anyone ?

I too need to know how to send out DTMF to my fax device hanging off an FXS port.

When the call comes in to FreePbx, there is a ANI/DNIS signaling from the pstn context trunk, I need to send the dialed digits from the DNIS as DTMF out the FXS port to my fax device so it can route by DID.

In my case I have both Audio Codes and Grandstream SIP-FXS gateways available to me.

Grandstream support tells me that if FreePBX sends either SIP-INFO or RFC2833, the Grandstream will relay that as DTMF tones out the FXS port to the attached device.

The question is, how does one instruct FreePBX to send out the DTMF digits upon answer of the FXS port?

I would think that an external voice mail server might work similarly too.

If a call for box 4567 went to the Voicemail server and FreePBX could send “4567” as DTMF, my external voicemail server could play the right greeting.

Thanks for any help you can offer.

I would use a custom trunk for that Zap channel.

Select trunk type custom, then use DAHDI/xx/$outnum$

Substitute xx for the channel number shown in “dahdi show channels”

Any calls you send to the trunk will have the current extension data (such as the DID) send via DTMF when the system goes off hook to dial.

As it turns out, this is a lot simpler than it looks.

All you need is some custom extensions in a file like (extensions-dtmf.conf):

exten => 9165551212,1,Dial(SIP/9200,D(www${CALLERID(dnid)})r)
exten => 3105551212,1,Dial(SIP/9200,D(www${CALLERID(dnid)})r)
exten => 2105551212,1,Dial(SIP/9200,D(www${CALLERID(dnid)})r)
exten => 7855551212,1,Dial(SIP/9200,D(www${CALLERID(dnid)})r)

and include it in the from-pstn-custom context like (in extensions_custom.conf)

include => pstn-inbound-custom

#include extensions-dtmf.conf

In the above example, I am receiving calls with DID’s of 9165551212,3105551212,2105551212,7855551212 and sending out the SIP extension 9200 AFTER its answered and while the caller still hears ringing, then the audio is connected after the DTMF is finished.

The 3 w’s on the front add a 1.5 second delay. (.5 sec for each w)

In my example above, I used SIP because in my case, the DID routing capable fax server is on an ATA with T.38 capability and my SIP provider supports T.38 and Asterisk can pass T.38 through it. (Grandstream in this case)

For the OP’s original request, obviously the ZAP/DAHDI channels can probably be substituted for internal FXS cards.

I wonder if there is a way to include this extra dial command in the “Dial Command” section of the Extension in Freepbx’s GUI so one could avoid this text file hack…

I tried every manner I could think of and nothing worked, so I did the hack instead.

Next Im going to try hunting with my ATA device across multiple ports, and also as a ring group in Asterisk as an alternative.

I wonder too if there is a way to just send the last 4 or 7 digits of the dnid variable instead of the whole 10 digit DNIS…