I thought Id share my recent experience getting FreePBX Distro 2.11 and Asterisk 11 to receive faxes using T.38 from my SIP provider. (Instead of falling back to G711 every time)
There are a couple of less than fully documented things that need to be done for it all to work.
For one, a udptl.conf file needs to be created in the /etc/asterisk directory. FreePBX apparently doesnt ever create one for you and enabling T38 Passthrough doesnt create one either.
Here is my udptl.conf for example:
; ; UDPTL Configuration (UDPTL is one of the transports for T.38) ; [general] ; ; UDPTL start and UDPTL end configure start and end addresses ; udptlstart=4000 udptlend=4999 ; ; Whether to enable or disable UDP checksums on UDPTL traffic ; udptlchecksums=no ; ; The error correction type to be sent ; T38FaxUdpEC = t38UDPFEC ;T38FaxUdpEC = t38UDPRedundancy ; ; The maximum length of a UDPTL packet ; ; The number of error correction entries in a UDPTL packet ; udptlfecentries = 3 ; ; The span over which parity is calculated for FEC in a UDPTL packet ; udptlfecspan = 3
Enabling T38 Passthrough has FreePBX add the t38pt_udptl=yes value to the sip_general_additional.conf .
This is great, but apparently back in 2009, Asterisk was patched to allow other values in the sip.conf besides just “yes”.
Here is the article on Digium’s website regarding this.
This article further implies that the additional options available for sip.conf are also available for device settings to override the global settings in both sip.conf and udptl.conf in order to accommodate different SIP providers T38 implementations, or media gateways like Cisco’s that need the maxdatagram increased to overcome buffering errors, different error checking scheme, checksums, etc.
t38pt_udptl = yes ; Enables T.38 with FEC error correction.
t38pt_udptl = yes,fec ; Enables T.38 with FEC error correction.
t38pt_udptl = yes,redundancy ; Enables T.38 with redundancy error correction.
t38pt_udptl = yes,none ; Enables T.38 with no error correction.
t38pt_udptl = yes,fec,maxdatagram=400 ; Enables T.38 with FEC error correction and overrides
; the other endpoint’s provided value to assume we can
; send 400 byte T.38 FAX packets to it.
Since trunks in Freepbx can have any options typed into the web interface, how can one add the custom option to extensions officially without disturbing FreePBX files?
The extensions_custom.conf ?
or extensions_override_freepbx.conf ?
I suppose for the sip.conf, one could not use the FreePBX provided yes/no option in the web interface and add the option at the end of the Asterisk SIP Settings with the custom t38pt_udptl=xxx value.
Here is what I did, in order, to get FreePBX to receive T.38 faxes and email them.
- Add the field “faxdetect=yes” to the end of the Asterisk SIP Settings FreePBX page.
- Turn the t38 Passthrough = yes on the Asterisk SIP Settings FreePBX page.
- Create a “none (virtual extension)” type extension with fax enabled checked and an email set to forward received faxes to.
- Create an inbound route with “Detect Faxes YES”, type “SIP”, detection time “4 seconds”, and fax destination “Fax Receipient” “dropdown to fax extension created in step 3”
- Create udptl.conf in /etc/asterisk folder
- Amportal restart for good measure, although I think a “core reload” at the cli does fine or clicking the “apply” button on FreePBX web interface.
Next stop. T.38 passthrough with an external device and hopefully, one of my 4 SIP trunk providers supporting T.38 gateway to PSTN on their end for both local and long distance calls.
I would imagine that if I wanted both FreePBX receiving T.38 faxes and an external device on an ATA sending and receiving, then the only difference would be whether the incoming route would have fax detect set.
“yes” for FreePBX to answer it with res_fax_spandsp or “no” to allow my ATA device on an extension to detect the CNG tones and offer the T.38 re-invite or NSE session.