T.38 Gateway for SIP Trunks

Ok - This may be obvious to some but I searched and searched to make this work.

The Setup - I have BluIP Trunks (Fabulous by the way - http://www.bluip.com) and I wanted to use HylaFAX with my Asterisk 10 box to send outbound FAXes through the BluIP SIP Trunk.

But every time I tried to send one, it would start the negotiation and then try and re-invite (even though canreinvite=no was set in the trunk) and then fail.

I knew that Asterisk 10 would Gateway, but no matter where I put it in the Dialplan, it never worked - until the lightbulb finally went off and I added the code to the [macro-dialout-trunk-predial-hook] in /etc/asterisk/extensions_custom.conf - I already had to have it to set P-Asserted-Identity to control caller ID - Here is what mine looks like:

exten => s,1,NoOp(Adding P-Asserted-Identity)
exten => s,n,SipAddHeader(P-Asserted-Identity: sip:[email protected] )
exten => s,n,Set(FAXOPT(gateway)=yes)
exten => s,n,MacroExit()

And then it started working!!! Woot! If you don’t need the P-Asserted part, it should look like this:

exten => s,1,NoOp(Enabling FAX Gateway Mode)
exten => s,n,Set(FAXOPT(gateway)=yes)
exten => s,n,MacroExit()

In case anyone else stumbles across this you will need the above in your /etc/asterisk/extensions_custom.conf - You will also need to enable T.38 in SIP Settings - Here also is my SIP Trunk definition in case anyone else wonders:


The last three lines are from here: http://www.asterisk-pbx.hk/2012/08/working-with-asterisk-10-t38-gateway.html - They don’t seem to be necessary but in sending LOTS of faxes, they seem to help.


T.38 FAX Outbound Gateway FreePBX SIP Trunks

Just noticed that the P-Asserted line dropped the tag - here is what is missing spaced out so it doesn’t get munged:

“<” sip:[email protected] ">"

Or you can use Fax Pro which gives you full gateway settings from the FreePBX GUI for each outbound route and extension plus all the other features of Fax Pro.

Just noticed this typo as I was looking through the logs - faxdetect=yes for SIP things, faxdetect=both for Dahdi…

Carry on…

What I posted above works perfectly for IAX Channels (HylaFAX) but only works about 1 out of 3 times from a FAX machine connected to a DAHDI FXS port - Tony, does Fax Pro fix this problem?


I am not sure as I have never seen that problem before. I know we have users using it that way. But all we do is set all the proper gateway settings. We dont do anything special.

I really would like to know…Hook me up and I will report back with results!


You can purchase the module from the FreePBX Store. http://www.schmoozecom.com/fax-pro.php