TIPS Any using t38modem?

erth64net

New Member
Joined
Mar 6, 2015
Messages
12
Reaction score
2
The existing iaxmodem option just isn't working for me (primary provider: Teliax), despite having an excellent, low latency & minimal jitter, broadband connection. Instead of using Teliax's SIP trunks (as their support has indicated no definite T38 support; faxing is best-effort only), I'm looking at switching faxing over to a provider such T38fax.com.

In the meantime, I need to add t38 support to Asterfax/hylafax. Is anyone using t38modem on a stock rPi2 build of IncrediblePBX 13?
 

islandtech

Wassamassaw
Joined
Jan 11, 2009
Messages
677
Reaction score
137
Not using t38, but have several customers that must use a fax machine.
We use www.faxsipit.com,
setup the account, put the audiocode ata on the network, activate the ata, plug in the fax machine, done.
 

dicko

Still learning but earning
Joined
Oct 30, 2015
Messages
1,607
Reaction score
826
T38modem works fine with Hylafax.

BUT installing t38modem on Debian based systems is as easy as "apt-get install t38modem" doing it on RH based systems is, to say the least, a little more of a PITA.

WHEN it is installed fully, I start the t38modems with

t38modem -tt -o /var/log/t38modem0.log --no-h323 -u T38modem --route "modem:.*=sip:<dn>@127.0.0.1:38000" \
--route "sip:.*=modem:<dn>" --sip-listen udp\$127.0.0.1:38000 --ptty +/dev/ttyT0 --sip-register [email protected],password > /dev/null 2>&1 &

t38modem -tt -o /var/log/t38modem1.log --no-h323 -u T38modem --route "modem:.*=sip:<dn>@127.0.0.1:38001" \
--route "sip:.*=modem:<dn>" --sip-listen udp\$127.0.0.1:38001 --ptty +/dev/ttyT1 --sip-register [email protected],password > /dev/null 2>&1 &

and append to /etc/initttab

#T38 modems
tfx0:2345:respawn:/usr/sbin/faxgetty ttyT0
tfx1:2345:respawn:/usr/sbin/faxgetty ttyT1

expand as necessary with the incremental port, device and extension and of course add sip extensions in Asterisk to suit.

There is an example file for the hylafax /var/spool/hylafax/etc/config.ttyTn files in the source of t38modem

If you use Avantfax, add these new modems to itself so it can "patch" the hylafax config file to suit itself.

(You might want to also add an appropriate /etc/logrotate.d/t38modem file for the handling those -tt logfiles . . . )

As an endnote , be aware that t38 requires end to end connectivity until it hands off to the PSTN for it to have a chance to work well, so choose your VSP well ;-)
 
Last edited:

erth64net

New Member
Joined
Mar 6, 2015
Messages
12
Reaction score
2
Wow - thank you for such wonderfully helpful followups!

The staff at t38fax.com have been quite responsive @islandtech, and I keyed on them because of very useful setup details they openly provide for various ATAs, as well as various platforms, including FreePBX, straight-Asterisk, and even Dialogic's FoIP interop processes. For the T38 layer on an existing fax machine, I'm hoping an existing SPA232D works just as well as an SPA112. Your recommendation for www.faxsipit.com looks wonderful - I assume you're using their provided "HTTPS fax over IP" gateway?

The rPi2 is running raspabian @dicko, and I already installed the packaged t38modem before opening this thread. Although I hadn't looked at package versions, nor even tried setting things up yet. Thanks for the reassuring info, and especially for the setup/config details.
 

atsak

Guru
Joined
Sep 7, 2009
Messages
2,381
Reaction score
436
Just to help you - I have spent literally dozens of hours on this, T38, non T38 etc etc t38faxmodem and the works. In asterisk 11 the t38 modem wouldn't work. I don't know why . . . Also SPA112's wouldn't work, Obi 220's seemed good though. faxsipit (or vfax from Vitelity) that uses the https over fax service is the only thing I've been able to get working nearly as well as a regular phone line. Sometimes you get lucky without it, but a lot of the time you just don't.
 

dicko

Still learning but earning
Joined
Oct 30, 2015
Messages
1,607
Reaction score
826
Seriously @atsak, it is not luck, it is just the network you have bought, Fax'es are vicious , T30 needs an unimpeachable G711 network, T38 needs an unimpeachable "end to end to PSTN" network, The Asterisk method is a "try once and succeed or fail" method to email a tif file to a designate email, hylafax is a LOT more mature and can retry, reroute, bitch and complain if it's not working solution if your network is in any way "peachable" :) this actually applies to flakey G711 iaxmodem connections, it just works better with t38modems IMHO, it can easily handle fax2email, email2fax and almost any document format that libreoffice/openoffice is aware of and there are even windoze compliant fax print drivers for it. I believe that this distro even offers a basic GUI with Avantfax to it.

So, I m suggesting just use the asterisk (since 1.6 at least) T38 pass-through and send faxes to t38modems on hylafax (you will of course need a real t38 to PSTN VSP, (some lie) ) or useful T30 (I get 97%+ from Vitelity on there trunking) , 99% problems gone, the other 1% fixable. As a benefit all your t38 compliant ATA's like OBI and Cisco's will suddenly not need help ifrouted through hylafax.This is JM2CWAE but I have also spent a few hours making it work, in my case, I believe successfully. Just try it . . . .
 
Last edited:

islandtech

Wassamassaw
Joined
Jan 11, 2009
Messages
677
Reaction score
137
Yes, I've got six customers using the "HTTPS fax over IP" gateway and AudioCodes MP202B/SIP/HTTPSFAX
 

atsak

Guru
Joined
Sep 7, 2009
Messages
2,381
Reaction score
436
@dicko - I tried it - it would work flawlessly for a while, then stop. It would work 99% of the time. But that's not good enough for a lot of people.

If you have better outcomes, that's fantastic - I really am glad it works for you. It just doesn't for me. You're absolutely right about the faxes being vicious - that's a great way to describe their behaviour in VOIP world.

I really just wish they'd go away and people would realize TLS encrypted email is equally or more secure than a fax.
 

dicko

Still learning but earning
Joined
Oct 30, 2015
Messages
1,607
Reaction score
826
What would "stop/not work", the t38modems? then look to your log file (add a few tt's) . Reliable requeueing? , then look to hylafax' rescheduling settings, just not always working? either look to a better t38 provider or failover to an iaxmodem on perhaps Vitelity.

I'd have to say that 99% is about as good as you will get from t30 over PSTN though, With sufficient retries we only get a very few absolute failures out of thousands of faxes weekly and it is always the receiving fax service (occasionally physical machines, mostly fax services, so if T38modem fails send it iaxmodem) That's where the log files will help identify the failed communication phase.
 
Last edited:

krzykat

Telecom Strategist
Joined
Aug 2, 2008
Messages
3,145
Reaction score
1,235
I've struggled this weekend with T.38 and have educated myself on the subject a bit as well. I've not had a problem with T.38 faxes coming inbound - it works now with the latest PIAF (Asterisk 13) and can grab them, convert to PDF and e-mail without the hylafax setup, simply by using the FreePBX. What I had issues with was outbound faxes - making sure they work with T.38 so that they go through every time. I tried all the normal big vendors around here and none seemed to work .... UNTIL I tried T38fax.com ... they WORK. I'm using an ATA that is T.38 compliant (Grandstream HT702 in my case), and its now working. The only pain is that it looks like it'll cost me 2.5 cents per minute - which is multiple times the rate I pay others. But ... It works.

They even have a nice how-to guide for different vendors ATA's as well as your flavors of Asterisk. Here's the link I used for the latest incrediblePBX:

https://www.t38fax.com/?s=freepbx
 

erth64net

New Member
Joined
Mar 6, 2015
Messages
12
Reaction score
2
...I tried T38fax.com ... they WORK. I'm using an ATA that is T.38 compliant (Grandstream HT702 in my case), and its now working. The only pain is that it looks like it'll cost me 2.5 cents per minute - which is multiple times the rate I pay others. But ... It works.

They even have a nice how-to guide for different vendors ATA's as well as your flavors of Asterisk. Here's the link I used for the latest incrediblePBX:

https://www.t38fax.com/?s=freepbx

This has been my experience as well - we've passed a few faxes successfully, using t38modem, running iPBX13, all running on an rPi2B. More aggressive testing is planned for this coming week...but so-far, www.T38fax.com seems to walk the talk. Their staff have also been a pleasure to work with as well.
 

jackal

New Member
Joined
Sep 17, 2015
Messages
25
Reaction score
2
Running Asterisk 13.13.0 with Incredible GUI 12.0.39. I've installed Incredible Fax 11 and AvantFax with IAXmodem seems to be working OK, but I'd like to go with T38modem.

After spending a combined probably 30+ hours in the last five days on this, I feel like I'm so close...but am just stuck.

I've gotten T38modem 2.0.0 compiled and installed (with opal), config files all in the right places for it to talk to Hylafax via faxgetty, and everything, none of which seems well documented for CentOS* ("Just switch to Debian and apt-get it!"), so it was a ton of trial and error (mostly error) and Googling. Just one step seems to be left in the process, and that's to register the modem with Asterisk.

I've created a SIP extension 6060 with no secret. (Made the extension number and listening port number the same for the heck of it.)

When I launch t38modem with the following command:

Code:
/bin/t38modem -tt -o /var/log/t38modem0.log --no-h323 -u T38modem --route modem:.*=sip:@127.0.0.1 --route sip:.*=modem: --sip-listen udp$127.0.0.1:6060 --ptty +/dev/ttyT0 --sip-register [email protected]:5061

It does start up with:

Code:
T38Modem Version 2.0.0
 (OPAL-3.9.0/3.9beta0, PTLIB-2.9.0/2.9beta0 (svn:24165)) by Vyacheslav Frolov on Unix Linux (2.6.32-642.11.1.el6.i686-i686)

Disabled H.323 protocol
Waiting for incoming SIP calls from udp27.0.0.1:6060
Route table:
  modem:.*=sip:@127.0.0.1
  sip:.*=modem:

I get the following text in sip debug:

Code:
<--- SIP read from UDP:127.0.0.1:53662 --->
REGISTER sip:127.0.0.1:5061 SIP/2.0
CSeq: 1 REGISTER
Via: SIP/2.0/UDP 127.0.0.1:53662;branch=z9hG4bK902b9bac-5ebf-e611-8a80-aa00f83a4f01;rport
User-Agent: T38Modem/2.0.0
From: <sip:[email protected]:5061>;tag=28ad9aac-5ebf-e611-8a80-aa00f83a4f01
Call-ID: [email protected]
Organization: Vyacheslav Frolov
To: <sip:[email protected]:5061>
Contact: <sip:[email protected]:6060>;q=1, <sip:[email protected]:6060;transport=tcp>;q=0.500
Allow: INVITE,ACK,OPTIONS,BYE,CANCEL,SUBSCRIBE,NOTIFY,REFER,MESSAGE,INFO,PING
Expires: 300
Content-Length: 0
Max-Forwards: 70

<------------->
--- (13 headers 0 lines) ---
Sending to 127.0.0.1:53662 (NAT)
Sending to 127.0.0.1:53662 (NAT)
    -- Registered SIP '6060' at 127.0.0.1:53662
Reliably Transmitting (no NAT) to 127.0.0.1:53662:
OPTIONS sip:[email protected]:6060 SIP/2.0
Via: SIP/2.0/UDP 67.xx.xx.xx:5061;branch=z9hG4bK2ca7636e
Max-Forwards: 70
From: "Unknown" <sip:[email protected]:5061>;tag=as063bab20
To: <sip:[email protected]:6060>
Contact: <sip:[email protected]:5061>
Call-ID: [email protected]:5061
CSeq: 102 OPTIONS
User-Agent: FPBX-12.0.74(13.13.0)
Date: Tue, 13 Dec 2016 05:00:02 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


---

<--- Transmitting (no NAT) to 127.0.0.1:53662 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 127.0.0.1:53662;branch=z9hG4bK902b9bac-5ebf-e611-8a80-aa00f83a4f01;received=127.0.0.1;rport=53662
From: <sip:[email protected]:5061>;tag=28ad9aac-5ebf-e611-8a80-aa00f83a4f01
To: <sip:[email protected]:5061>;tag=as048c5a47
Call-ID: [email protected]
CSeq: 1 REGISTER
Server: FPBX-12.0.74(13.13.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Expires: 300
Contact: <sip:[email protected]:6060>;expires=300
Date: Tue, 13 Dec 2016 05:00:02 GMT
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog '[email protected]' in 32000 ms (Method: REGISTER)

<--- SIP read from UDP:127.0.0.1:53662 --->
REGISTER sip:127.0.0.1:5061 SIP/2.0
CSeq: 1 REGISTER
Via: SIP/2.0/UDP 127.0.0.1:53662;branch=z9hG4bK902b9bac-5ebf-e611-8a80-aa00f83a4f01;rport
User-Agent: T38Modem/2.0.0
From: <sip:[email protected]:5061>;tag=28ad9aac-5ebf-e611-8a80-aa00f83a4f01
Call-ID: [email protected]
Organization: Vyacheslav Frolov
To: <sip:[email protected]:5061>
Contact: <sip:[email protected]:6060>;q=1, <sip:[email protected]:6060;transport=tcp>;q=0.500
Allow: INVITE,ACK,OPTIONS,BYE,CANCEL,SUBSCRIBE,NOTIFY,REFER,MESSAGE,INFO,PING
Expires: 300
Content-Length: 0
Max-Forwards: 70

<------------->
--- (13 headers 0 lines) ---
Sending to 127.0.0.1:53662 (no NAT)
[2016-12-13 00:00:03] NOTICE[2445]: chan_sip.c:30035 sip_poke_peer: Still have a QUALIFY dialog active, deleting
Reliably Transmitting (no NAT) to 127.0.0.1:53662:
OPTIONS sip:[email protected]:6060 SIP/2.0
Via: SIP/2.0/UDP 67.xx.xx.xx:5061;branch=z9hG4bK717db221
Max-Forwards: 70
From: "Unknown" <sip:[email protected]:5061>;tag=as2faa0d05
To: <sip:[email protected]:6060>
Contact: <sip:[email protected]:5061>
Call-ID: [email protected]:5061
CSeq: 102 OPTIONS
User-Agent: FPBX-12.0.74(13.13.0)
Date: Tue, 13 Dec 2016 05:00:03 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


---

<--- Transmitting (no NAT) to 127.0.0.1:53662 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 127.0.0.1:53662;branch=z9hG4bK902b9bac-5ebf-e611-8a80-aa00f83a4f01;received=127.0.0.1;rport=53662
From: <sip:[email protected]:5061>;tag=28ad9aac-5ebf-e611-8a80-aa00f83a4f01
To: <sip:[email protected]:5061>;tag=as048c5a47
Call-ID: [email protected]
CSeq: 1 REGISTER
Server: FPBX-12.0.74(13.13.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Expires: 300
Contact: <sip:[email protected]:6060>;expires=300
Date: Tue, 13 Dec 2016 05:00:03 GMT
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog '[email protected]' in 32000 ms (Method: REGISTER)
Really destroying SIP dialog '[email protected]:5061' Method: OPTIONS

<--- SIP read from UDP:127.0.0.1:53662 --->
REGISTER sip:127.0.0.1:5061 SIP/2.0
CSeq: 1 REGISTER
Via: SIP/2.0/UDP 127.0.0.1:53662;branch=z9hG4bK902b9bac-5ebf-e611-8a80-aa00f83a4f01;rport
User-Agent: T38Modem/2.0.0
From: <sip:[email protected]:5061>;tag=28ad9aac-5ebf-e611-8a80-aa00f83a4f01
Call-ID: [email protected]
Organization: Vyacheslav Frolov
To: <sip:[email protected]:5061>
Contact: <sip:[email protected]:6060>;q=1, <sip:[email protected]:6060;transport=tcp>;q=0.500
Allow: INVITE,ACK,OPTIONS,BYE,CANCEL,SUBSCRIBE,NOTIFY,REFER,MESSAGE,INFO,PING
Expires: 300
Content-Length: 0
Max-Forwards: 70

<------------->
--- (13 headers 0 lines) ---
Sending to 127.0.0.1:53662 (no NAT)
[2016-12-13 00:00:04] NOTICE[2445]: chan_sip.c:30035 sip_poke_peer: Still have a QUALIFY dialog active, deleting
Reliably Transmitting (no NAT) to 127.0.0.1:53662:
OPTIONS sip:[email protected]:6060 SIP/2.0
Via: SIP/2.0/UDP 67.xx.xx.xx:5061;branch=z9hG4bK18065c55
Max-Forwards: 70
From: "Unknown" <sip:[email protected]:5061>;tag=as1b6d61be
To: <sip:[email protected]:6060>
Contact: <sip:[email protected]:5061>
Call-ID: [email protected]:5061
CSeq: 102 OPTIONS
User-Agent: FPBX-12.0.74(13.13.0)
Date: Tue, 13 Dec 2016 05:00:04 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


---

<--- Transmitting (no NAT) to 127.0.0.1:53662 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 127.0.0.1:53662;branch=z9hG4bK902b9bac-5ebf-e611-8a80-aa00f83a4f01;received=127.0.0.1;rport=53662
From: <sip:[email protected]:5061>;tag=28ad9aac-5ebf-e611-8a80-aa00f83a4f01
To: <sip:[email protected]:5061>;tag=as048c5a47
Call-ID: [email protected]
CSeq: 1 REGISTER
Server: FPBX-12.0.74(13.13.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Expires: 300
Contact: <sip:[email protected]:6060>;expires=300
Date: Tue, 13 Dec 2016 05:00:04 GMT
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog '[email protected]' in 32000 ms (Method: REGISTER)
Retransmitting #1 (no NAT) to 127.0.0.1:53662:
OPTIONS sip:[email protected]:6060 SIP/2.0
Via: SIP/2.0/UDP 67.xx.xx.xx:5061;branch=z9hG4bK717db221
Max-Forwards: 70
From: "Unknown" <sip:[email protected]:5061>;tag=as2faa0d05
To: <sip:[email protected]:6060>
Contact: <sip:[email protected]:5061>
Call-ID: [email protected]:5061
CSeq: 102 OPTIONS
User-Agent: FPBX-12.0.74(13.13.0)
Date: Tue, 13 Dec 2016 05:00:03 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0

(Code snippet snipped due to forum complaining about message length. I can provide more if needed.)

So it appears that it is registering but then not responding to the SIP/2.0 200 OK response, as far as I can tell.

I can telnet 127.0.0.1 6060 and the connection opens up just fine.

(I've set the extension up with no secret and with chan_sip so I can use the deny/permit functions to restrict access to only the localhost (not currently enabled; will add that once this is working). I had previously tried it with chan_pjsip and a secret using the format --sip-register [email protected],secret, but I just kept getting "unauthorized" so switched to chan_sip and no secret.)

FWIW, faxstat shows a status of:
Modem ttyT38-0 (): Waiting for modem to come ready

I'm hopeful that getting it registered to Asterisk via SIP will turn the modems to "Running and idle," but I guess we'll cross that bridge next if not. :)

(The T38modem did successfully respond to testing during "faxaddmodem.")

Any ideas/suggestions? Maybe it's just exhaustion that's precluding me from seeing what's wrong here, but any hints for where to go from here would be helpful. Thanks!

*Kudos to dicko, whose posts upthread here and in a few other places here and elsewhere proved to be among the most helpful. Thanks!
 
Last edited:

dicko

Still learning but earning
Joined
Oct 30, 2015
Messages
1,607
Reaction score
826
If you have enough -tt's then the log file will explain what's gone wrong.
 

Members online

No members online now.

Forum statistics

Threads
25,778
Messages
167,504
Members
19,198
Latest member
serhii
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top