Be aware: T.38 is not T.38, there are still a great many interoperability issues out there!
A: See below
Q: Can I terminate T.38 calls to PSTN with Asterisk T.38 passthrough(via Zaptel)?
A: yes, http://bugs.digium.com/view.php?id=13405
Install the DAHDI drivers as documented elsewhere, then:
Get the latest version of Spandsp 0.0.5 (0.0.6 does not work with 1.6.0.3) from: http://www.soft-switch.org/downloads/spandsp/
The commands below were written for version Spandsp 0.0.5pre4 and Debian operating systems. The same packages are available for other distros.
apt-get install libtiff4 libtiff4-dev libtiff-tools
wget http://www.soft-switch.org/downloads/spandsp/spandsp-0.0.5pre4.tgz
tar -xzvf spandsp-0.0.5pre4.tgz
cd spandsp-0.0.5
./configure --prefix=/usr
make
make install
After this, proceed with a standard installation of Asterisk 1.6, then make sure that sip.conf contains:
[general]
t38pt_udptl = yes
This must be in the [general] section or it will not work. You can disable it on a per-device basis, but it cannot be enabled in the device sections (as of Asterisk 1.6rc6). ;
Sample receive context in extensions.conf:
exten => _X.,n,ReceiveFax(faxfilename)
Important note : you should wait a few seconds between Answer() and ReceiveFAX() in order for the fax to send a tone that asterisk can pick up to switch to t.38.
Your dialplan would then look something like
exten => _X.,1,Answer()
exten => _X.,n,Wait(3)
exten => _X.,n,ReceiveFAX(faxfilename)
/*!< This is default: NO MMR and JBIG trancoding, NO fill bit removal, transferredTCF TCF, UDP FEC, Version 0 and 9600 max fax rate */
static int global_t38_capability = T38FAX_VERSION_0 | T38FAX_RATE_2400 | T38FAX_RATE_4800 | T38FAX_RATE_7200 | T38FAX_RATE_9600;
To make changes to the T38 configuration, simply add in the changes as described in the sections above that line. For example, if you need T38FAX_VERSION_1 simply edit the file and change the 0 to 1. If you can support 12000 and 14400, simply add it to the end of the line. An example configuration with T38 verison 1 and adding 12000 and 14400 follows:
static int global_t38_capability = T38FAX_VERSION_1 | T38FAX_RATE_2400 | T38FAX_RATE_4800 | T38FAX_RATE_7200 | T38FAX_RATE_9600 | T38FAX_RATE_12000 | T38FAX_RATE_14400;
svn checkout http://svn.digium.com/svn/asterisk/branches/1.4 asterisk-1.4
(or for trunk:
svn checkout http://svn.digium.com/svn/asterisk/trunk asterisk-trunk
)
cd asterisk-1.4 (cd asterisk-trunk)
./configure;make;make install
asterisk -vvvdc
[general]
;NEEDED!!!
t38pt_udptl = yes
[200]
type=friend
context=from-sip
host=dynamic
secret=200
canreinvite=yes
t38pt_udptl = yes
or take a look at a NATted variant:
[200]
type=friend
context=from-sip
host=dynamic
secret=200
canreinvite=no
nat=yes
t38pt_udptl = yes
[201]
type=friend
context=from-sip
host=dynamic
secret=201
canreinvite=yes
t38pt_udptl = yes
/etc/asterisk/extensions.conf:
[from-sip]
exten => 200,1,Dial(SIP/${EXTEN}|300)
exten => 201,1,Dial(SIP/${EXTEN}|300)
Now dial 201 from 200.
Depending on your fax device (such as the Linksys 3102) you may have to edit the udptl.conf file. The error correction type that is sent is usually the culprit of many problems with ATAs and T.38 providers.
Also, try using:
t38pt_udptl=yes
t38pt_rtp=no
t38pt_tcp=no
... in the general section of the sip.conf and under the VoIP provider account as well as the fax account.
Also, crank down the speed of the fax machine to the slowest speed possible. Some ATAs work better like this.
-For the SPA2102 (probably the same for 3102) and Asterisk 1.4 make sure that in the SPA web admin utility, the FAX Passthrough method = ReINVITE. In asterisk's sip.conf make sure canreinvite=yes.
-Zoiper softphone supports T.38 faxing only, which is a great way to test if T38 is actually working (and that you are not fooled by a sneaky G711 fallback). For Zoiper (version 2.*) configuration in sip.conf, it is important that canreinvite=no.
Step 2 basically tells asterisk that ALL of your SIP peers are T.38 capable (which is probably not true, but not really harmful either)
1) Prepare test environment (reduce the ammount of unrelated traffic on the server);
2) Make sure your logger.conf has the following line:
console => notice,warning,error,debug
3) restart Asterik.
4) Enable SIP transaction logging with the following CLI commands:
set debug 4 (latest trunk "core debug 4")
set verbose 4 (latest trunk "core verbose 4")
sip debug
5) Save complete console log to file
6) Create bugreport at http://bugs.digium.com
7) Attach saved file to the bug.
Version information
- Asterisk 1.2 has no support for T.38.
- Asterisk 1.4 supports only T.38 fax pass through; there is however a third party way using HylaFax and OPAL to send and receive fax through Asterisk 1.4. See also rejected patch 12931 that includes a T.38 gateway. Attractel offers a commercial T.38 gateway solution for Asterisk.
- In Asterisk 1.6 also origination and termination features will be added (with gateway functionality still missing)
FAQ
Q: Does Asterisk support T.38 ATAs behind NAT with canreinvite=no ?A: See below
Q: Can I terminate T.38 calls to PSTN with Asterisk T.38 passthrough(via Zaptel)?
A: yes, http://bugs.digium.com/view.php?id=13405
ATA COMPATIBILITY
| ATA1(CALLER) | FIRMWARE | NAT | ASTERISK VERSION | ATA2/GW(CALLED) | FIRMWARE | NAT | works? | notes |
|---|---|---|---|---|---|---|---|---|
| HT496 | 1.0.3.44 | yes | SVN TRUNK 40000 | HT496 | 1.0.3.44 | yes | yes | example |
| HT496 | 1.0.3.64 | yes | SVN-branch-1.4-r53152 | Patton SN4960 | T4 | no | yes* | sometimes bad quality(ht496 unregister after fax is sent) |
| SPA2100 | 3.3.6 | no | Branch 1.2+patches | Cisco AS5300 | IOS 12.3 | no | yes | example |
| Kapanga | 2152b | no | SVN-branch-1.4-r47911 | Kapanga | 2152b | no | yes* | *receiving kapanga crash |
| Kapanga | 2156 | yes | SVN-branch-1.4-r53152 | Patton SN4960 | T4 | no | yes | |
| Patton SN4524 | 3.20 | yes | Asterisk 1.4.1 | Patton SN4524 | 3.20 | yes | yes | |
| SPA2102 | 5.1.6 | yes | Asterisk 1.4.2 | Patton SN4960 | R4.1 | no | NO | |
| SPA2102 | 5.1.1 | yes | Asterisk 1.4.2 | Patton SN4960 | R4.1 | no | yes | |
| SPA2102 | 5.2.5 | yes | Asterisk 1.4.19 | Gafachi | * | no | yes | |
| SPA2102 | 5.2.5 | no | Asterisk 1.4.21.2 / astlinux | Zoiper Softphone | ver 2.* | no | yes | Tested in own private LAN. For zoiper: canreinvite=no, for the spa2102: canreinvite=yes and in the spa2102 configuration,the FAX passthrough method must be ReINVITE - then it works both ways. Obviously t38pt_udptl=yes must be set in sip.conf as described in the sip.conf.sample file (or google it) |
| Zoiper | 2.09 (linux) | no | Asterisk 1.4.21.2 | SPA2102 | 5.2.5 | no | yes | |
| Micronet SP5002/S | 113 | yes | Asterisk 1.4.3 | CISCO IOS | N/A | yes | yes | |
| Grandstream HT502 | 1.0.0.39 | yes | Asterisk 1.4.3 | Patton SN4960 | 4.1 | yes | yes | |
| Grandstream HT502 | 1.0.0.39 | yes | Asterisk 1.4.4 | Grandstream HT502 | 1.0.0.39 | yes | yes | |
| Grandstream GXW4004 | 1.0.0.39 | yes | Asterisk 1.4.4 | Grandstream HT502 | 1.0.0.39 | yes | yes | |
| Gafachi UAS | 110.05 | yes | Asterisk 1.4.6+ | Grandstream HT287 (aka HT286 v3.0) | 1.1.0.3 | no | yes | |
| Grandstream HT287 (aka HT286 v3.0) | 1.1.0.3 | no | Asterisk 1.4.6+ | Gafachi UAS | 110.05 | yes | yes | |
| Grandstream HT503 | Prg.1.0.0.5 | yes | Asterisk 1.4.17 | Grandstream HT503 | Prg.1.0.0.5 | yes | yes | |
| Mediatrix 1102 | v5.0.19.124 | yes | Asterisk 1.4.18 | Mediatrix 1102 | v5.0.19.124 | yes | yes | Same behaviour for all of mediatrix products line |
Installation Procedures for Asterisk 1.6 with T.38 termination & origination
Asterisk 1.6 includes the ability to send and receive faxes if you compile it after installing appropriate support. After running configure, run "make menuselect" and see if app_fax is available or crossed out. If it is crossed out, you have not installed the needed support (or have not installed it to Asterisk's satisfaction).Install the DAHDI drivers as documented elsewhere, then:
Get the latest version of Spandsp 0.0.5 (0.0.6 does not work with 1.6.0.3) from: http://www.soft-switch.org/downloads/spandsp/
The commands below were written for version Spandsp 0.0.5pre4 and Debian operating systems. The same packages are available for other distros.
apt-get install libtiff4 libtiff4-dev libtiff-tools
wget http://www.soft-switch.org/downloads/spandsp/spandsp-0.0.5pre4.tgz
tar -xzvf spandsp-0.0.5pre4.tgz
cd spandsp-0.0.5
./configure --prefix=/usr
make
make install
After this, proceed with a standard installation of Asterisk 1.6, then make sure that sip.conf contains:
[general]
t38pt_udptl = yes
This must be in the [general] section or it will not work. You can disable it on a per-device basis, but it cannot be enabled in the device sections (as of Asterisk 1.6rc6). ;
Sample receive context in extensions.conf:
exten => _X.,n,ReceiveFax(faxfilename)
Important note : you should wait a few seconds between Answer() and ReceiveFAX() in order for the fax to send a tone that asterisk can pick up to switch to t.38.
Your dialplan would then look something like
exten => _X.,1,Answer()
exten => _X.,n,Wait(3)
exten => _X.,n,ReceiveFAX(faxfilename)
Installation Procedures for Asterisk 1.4 with T.38
Installation Note: By default, Asterisk doesn't set many of the T.38 settings that may be required to interface with third party SIP trunks. You must make these changes within the chan_sip.c file before doing a make install. The T.38 configuration settings is located in chan_sip.c and can be edited with VI or your favorite text editor. The setting is modified with the line that reads as follows:/*!< This is default: NO MMR and JBIG trancoding, NO fill bit removal, transferredTCF TCF, UDP FEC, Version 0 and 9600 max fax rate */
static int global_t38_capability = T38FAX_VERSION_0 | T38FAX_RATE_2400 | T38FAX_RATE_4800 | T38FAX_RATE_7200 | T38FAX_RATE_9600;
To make changes to the T38 configuration, simply add in the changes as described in the sections above that line. For example, if you need T38FAX_VERSION_1 simply edit the file and change the 0 to 1. If you can support 12000 and 14400, simply add it to the end of the line. An example configuration with T38 verison 1 and adding 12000 and 14400 follows:
static int global_t38_capability = T38FAX_VERSION_1 | T38FAX_RATE_2400 | T38FAX_RATE_4800 | T38FAX_RATE_7200 | T38FAX_RATE_9600 | T38FAX_RATE_12000 | T38FAX_RATE_14400;
Install
cd /usr/srcsvn checkout http://svn.digium.com/svn/asterisk/branches/1.4 asterisk-1.4
(or for trunk:
svn checkout http://svn.digium.com/svn/asterisk/trunk asterisk-trunk
)
cd asterisk-1.4 (cd asterisk-trunk)
./configure;make;make install
asterisk -vvvdc
Config
/etc/asterisk/sip.conf:[general]
;NEEDED!!!
t38pt_udptl = yes
[200]
type=friend
context=from-sip
host=dynamic
secret=200
canreinvite=yes
t38pt_udptl = yes
or take a look at a NATted variant:
[200]
type=friend
context=from-sip
host=dynamic
secret=200
canreinvite=no
nat=yes
t38pt_udptl = yes
[201]
type=friend
context=from-sip
host=dynamic
secret=201
canreinvite=yes
t38pt_udptl = yes
/etc/asterisk/extensions.conf:
[from-sip]
exten => 200,1,Dial(SIP/${EXTEN}|300)
exten => 201,1,Dial(SIP/${EXTEN}|300)
Now dial 201 from 200.
Additional Troubleshooting
Depending on your fax device (such as the Linksys 3102) you may have to edit the udptl.conf file. The error correction type that is sent is usually the culprit of many problems with ATAs and T.38 providers.
Also, try using:
t38pt_udptl=yes
t38pt_rtp=no
t38pt_tcp=no
... in the general section of the sip.conf and under the VoIP provider account as well as the fax account.
Also, crank down the speed of the fax machine to the slowest speed possible. Some ATAs work better like this.
-For the SPA2102 (probably the same for 3102) and Asterisk 1.4 make sure that in the SPA web admin utility, the FAX Passthrough method = ReINVITE. In asterisk's sip.conf make sure canreinvite=yes.
-Zoiper softphone supports T.38 faxing only, which is a great way to test if T38 is actually working (and that you are not fooled by a sneaky G711 fallback). For Zoiper (version 2.*) configuration in sip.conf, it is important that canreinvite=no.
Installation Procedures for Asterisk T.38 Over FreePBX 2.4
- Setup /etc/asterisk/udptl.conf manually
- add "t38pt_udptl=yes" to /etc/asterisk/sip_general_custom.conf
Step 2 basically tells asterisk that ALL of your SIP peers are T.38 capable (which is probably not true, but not really harmful either)
HowTo debug & send bugreports
Please read http://www.digium.com/bugguidelines.html1) Prepare test environment (reduce the ammount of unrelated traffic on the server);
2) Make sure your logger.conf has the following line:
console => notice,warning,error,debug
3) restart Asterik.
4) Enable SIP transaction logging with the following CLI commands:
set debug 4 (latest trunk "core debug 4")
set verbose 4 (latest trunk "core verbose 4")
sip debug
5) Save complete console log to file
6) Create bugreport at http://bugs.digium.com
7) Attach saved file to the bug.
See also
- Asterisk fax
- T.38
- T38modem configuration with Asterisk
- Zoiper: SIP /IAX softphone with T.38 support incl. print2fax driver

Comments
333Gafachi T.38
Thanks!
333
333
I made some test and it looks like but I hope it's just because I made mistakes...