Difference between revisions of "Send Receive Fax-T38"

From Kolmisoft Wiki
Jump to navigationJump to search
(Howto send&receive faxes with T.38 with almost 100% success rate)
 
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[File:t38_schema.png]]
== Passthrough ==
Asterisk supports T38 over SIP ONLY as passthrough:
Device1 --- (T38) ---> Asterisk --- (T38) ---> Device2
E.g. both devices which send fax and receive fax should support T38.
Terminating or originating T38 from/to Asterisk is not supported.
e.g. such way is NOT possible:
Device --- (T38) ---> Asterisk
or
Asterisk --- (T38) ---> Device
== Howto send&receive faxes with T.38 with almost 100% success rate ==
== Howto send&receive faxes with T.38 with almost 100% success rate ==


Line 5: Line 27:
You can send & receive faxes with almost 100% success rate, even if you're using a low-quality codec (g726,g729).
You can send & receive faxes with almost 100% success rate, even if you're using a low-quality codec (g726,g729).
   
   
The main technology is simple: Because standard FAX is mainly designed for POTS media, it's very sensitive to quality of the line.
The main technology is simple: Because standard FAX is mainly designed for POTS media, it's very sensitive to quality of the line.
From the view of VoIP it works only with g711u/a (PCM) and with very good network conditions (no packet loss, very low round-trip).
From the view of VoIP it works only with g711u/a (PCM) and with very good network conditions (no packet loss, very low round-trip).
The T.38 makes a tunnel between two (T.38 capable) devices and code-decode the fax at the ends of that tunnel.  
The T.38 makes a tunnel between two (T.38 capable) devices and code-decode the fax at the ends of that tunnel.  
Line 13: Line 35:
----
----


Because of it's mechanism, you will need a device (ATA) with T.38 support and your provider must support T.38 too.
Because of it's mechanism, you will need a device (ATA) with T.38 support and your provider must support T.38 too.


My device is a '''Linksys SPA2102''' (settings are the same for SPA3000). Of course you can use other ATA, which supports T38.
My device is a '''Linksys SPA2102''' (settings are the same for SPA3000). Of course you can use other ATA, which supports T38.




1. First, you'll need the source tarball of Asterisk (same version as installed). (My version: 1.4.17)
* 1. First, you'll need the source tarball of Asterisk (same version as installed). (My version: 1.4.17)


   After you untar it, edit chan_sip.c file located in '''channels/''' directory of the source tree.
   After you untar it, edit chan_sip.c file located in ''channels/'' directory of the source tree.
    
    
   Search for this line:   
   Search for this line:   
Line 41: Line 63:
       '''cp channels/chan_sip.so /usr/lib/asterisk/modules/'''
       '''cp channels/chan_sip.so /usr/lib/asterisk/modules/'''


2. Turn on T.38 in MOR gui at both the provider and the device!
* 2. Turn on T.38 in MOR gui at both the provider and the device!




3. Make sure T.38 is enabled in '''/etc/asterisk/sip.conf'''!
* 3. Make sure T.38 is enabled in ''/etc/asterisk/sip.conf''!
    
    
   T.38 can be enabled by this setting:
   T.38 can be enabled by this setting:
   '''t38pt_udptl = yes'''
   '''t38pt_udptl = yes'''


4. Edit '''/etc/asterisk/udptl.conf''' like this:
* 4. Edit ''/etc/asterisk/udptl.conf'' like this:


   ;
   ;
Line 83: Line 105:




5. Settings on SPA2102
* 5. Settings on SPA2102


   Make sure you have "FAX Enable T.38" enabled in your device! You should also set other settings to make it work:
   Make sure you have "FAX Enable T.38" enabled in your device! You should also set other settings to make it work:


   FAX Passtru method: ReINVITE
   FAX Passtru method: ReINVITE
    FAX Passtru method: NSE (if ReINVITE does not work and Asterisk presents error)
   Call Waiting: Disable
   Call Waiting: Disable
   Jitter level: Very High
   Jitter level: Very High
   Silence Supp: Disable
   Silence Supp: Disable
   Echo Cancel: Disable
   Echo Cancel: Disable
  FAX Tone Detect Mode: caller or callee


   By the way, it should work with factory settings out-of-box (T.38 is enabled by default).
   By the way, it should work with factory settings out-of-box (T.38 is enabled by default).
Line 99: Line 123:


--[[User:Szab100|Szab100]] 14:22, 12 March 2008 (CET)
--[[User:Szab100|Szab100]] 14:22, 12 March 2008 (CET)
<br><br>
= See also=
* T38 app_fax    http://www.asteriskforum.ru/viewtopic.php?t=1761&start=30
* [http://tools.ietf.org/wg/sipping/draft-ietf-sipping-realtimefax/draft-ietf-sipping-realtimefax-01.txt|SIP Support for Real-time Fax: Call Flow Examples And Best Current Practices]

Latest revision as of 10:32, 22 January 2013

T38 schema.png

Passthrough

Asterisk supports T38 over SIP ONLY as passthrough:

Device1 --- (T38) ---> Asterisk --- (T38) ---> Device2

E.g. both devices which send fax and receive fax should support T38.

Terminating or originating T38 from/to Asterisk is not supported.

e.g. such way is NOT possible:

Device --- (T38) ---> Asterisk

or

Asterisk --- (T38) ---> Device


Howto send&receive faxes with T.38 with almost 100% success rate

In this article i will show you how to enable fax -ing with T.38 support. For those who don't know what T.38 is, it's a protocol especially for FAX over VoIP. You can send & receive faxes with almost 100% success rate, even if you're using a low-quality codec (g726,g729).

The main technology is simple: Because standard FAX is mainly designed for POTS media, it's very sensitive to quality of the line. From the view of VoIP it works only with g711u/a (PCM) and with very good network conditions (no packet loss, very low round-trip). The T.38 makes a tunnel between two (T.38 capable) devices and code-decode the fax at the ends of that tunnel. The data-sending protocol of T.38 is (in most cases) UDP based and it can be sent via very poor network environments.



Because of it's mechanism, you will need a device (ATA) with T.38 support and your provider must support T.38 too.

My device is a Linksys SPA2102 (settings are the same for SPA3000). Of course you can use other ATA, which supports T38.


  • 1. First, you'll need the source tarball of Asterisk (same version as installed). (My version: 1.4.17)
 After you untar it, edit chan_sip.c file located in channels/ directory of the source tree.
 
 Search for this line:  
    static int global_t38_capability = T38FAX_VERSION_0 | T38FAX_RATE_2400 |
                          T38FAX_RATE_4800 | T38FAX_RATE_7200 | T38FAX_RATE_9600;


 and replace with this line (If your provider & ATA supports T.38 version 1, change T38FAX_VERSION_0 to T38FAX_VERSION_1):
    static int global_t38_capability = T38FAX_VERSION_0 | T38FAX_RATE_2400 |
                          T38FAX_RATE_4800 | T38FAX_RATE_7200 | T38FAX_RATE_9600 | T38FAX_RATE_12000 | T38FAX_RATE_14400;
 Save the file and change directory to the root of the source tree:
    
     cd ..
 Build the source:
     make
 Copy the newly created chan_sip.so over the old one:
     cp channels/chan_sip.so /usr/lib/asterisk/modules/
  • 2. Turn on T.38 in MOR gui at both the provider and the device!


  • 3. Make sure T.38 is enabled in /etc/asterisk/sip.conf!
  T.38 can be enabled by this setting:
  t38pt_udptl = yes
  • 4. Edit /etc/asterisk/udptl.conf like this:
 ;
 ; 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
 ;
 T38FaxMaxDatagram = 200
 ;
 ; 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


  • 5. Settings on SPA2102
 Make sure you have "FAX Enable T.38" enabled in your device! You should also set other settings to make it work:
 FAX Passtru method: ReINVITE
   FAX Passtru method: NSE (if ReINVITE does not work and Asterisk presents error)
 Call Waiting: Disable
 Jitter level: Very High
 Silence Supp: Disable
 Echo Cancel: Disable
 FAX Tone Detect Mode: caller or callee
 By the way, it should work with factory settings out-of-box (T.38 is enabled by default).

I hope you will get working for now. If not, try to tune settings in udptl.conf!


--Szab100 14:22, 12 March 2008 (CET)




See also