Cannot receive faxes with T38 protocol

Hello, I previously configured an extension for receiving faxes with hylafax through PSTN. Now that I’ve no more PSTN line but only a phone SIP provider T38, I wish to recieve faxes but I’m experincing a nigthmare, sending is quite ok but receiving not.
I mofied sip.conf pages adding requested lines and also modified udptl.conf but no way. I receive a lot of errors and only 1 fax over 5 arrives correctly.
Here some logs on folder /var/spool/hylafax/log:


Jun 27 11:32:37.90: [ 1825]: SESSION BEGIN 000000345 3901998861
Jun 27 11:32:37.90: [ 1825]: HylaFAX ™ Version 6.0.6
Jun 27 11:32:37.91: [ 1825]: CallID: “0108934836” “0108934836” “” "s"
Jun 27 11:32:37.91: [ 1825]: MODEM set XON/XOFF/FLUSH: input ignored, output disabled
Jun 27 11:32:37.91: [ 1825]: <-- [4:ATA\r]
Jun 27 11:32:41.63: [ 1825]: --> [7:CONNECT]
Jun 27 11:32:41.63: [ 1825]: ANSWER: FAX CONNECTION DEVICE '/dev/ttyIAX11’
Jun 27 11:32:41.63: [ 1825]: STATE CHANGE: ANSWERING -> RECEIVING
Jun 27 11:32:41.63: [ 1825]: RECV FAX: begin
Jun 27 11:32:41.63: [ 1825]: <-- HDLC<32:FF C0 04 B5 00 AA 12 9E 36 86 62 82 1A 04 14 2E B6 94 04 6A A6 4E CE 96 F6 76 04 6C 74 0C 74 6C>
Jun 27 11:32:41.63: [ 1825]: <-- data [32]
Jun 27 11:32:41.63: [ 1825]: <-- data [2]
Jun 27 11:32:42.59: [ 1825]: --> [7:CONNECT]
Jun 27 11:32:42.59: [ 1825]: <-- HDLC<23:FF C0 02 76 86 66 A6 2E CA 04 A6 CE A6 C6 36 F2 04 F6 96 26 AE 2E CA>
Jun 27 11:32:42.59: [ 1825]: <-- data [23]
Jun 27 11:32:42.59: [ 1825]: <-- data [2]
Jun 27 11:32:43.33: [ 1825]: --> [7:CONNECT]
Jun 27 11:32:43.33: [ 1825]: <-- HDLC<13:FF C8 01 00 77 5F 23 01 FB C1 01 01 18>
Jun 27 11:32:43.33: [ 1825]: <-- data [13]
Jun 27 11:32:43.33: [ 1825]: <-- data [2]
Jun 27 11:32:43.91: [ 1825]: --> [2:OK]
Jun 27 11:32:43.91: [ 1825]: <-- [9:AT+FRH=3\r]
Jun 27 11:32:44.47: [ 1825]: --> [7:CONNECT]
Jun 27 11:32:44.65: [ 1825]: --> [10:NO CARRIER]
Jun 27 11:32:44.65: [ 1825]: MODEM No carrier
Jun 27 11:32:44.65: [ 1825]: DELAY 70 ms
Jun 27 11:32:44.72: [ 1825]: <-- [9:AT+FTH=3\r]
Jun 27 11:32:44.73: [ 1825]: --> [7:CONNECT]
Jun 27 11:32:44.73: [ 1825]: <-- HDLC<3:FF C8 58>
Jun 27 11:32:44.73: [ 1825]: <-- data [3]
Jun 27 11:32:44.73: [ 1825]: <-- data [2]
Jun 27 11:32:45.81: [ 1825]: --> [2:OK]
Jun 27 11:32:45.81: [ 1825]: RECV send CRP (command repeat)
Jun 27 11:32:45.81: [ 1825]: <-- [9:AT+FRH=3\r]
Jun 27 11:32:52.81: [ 1825]: --> [0:]
Jun 27 11:32:52.81: [ 1825]: MODEM
Jun 27 11:32:52.81: [ 1825]: MODEM TIMEOUT: waiting for v.21 carrier
Jun 27 11:32:52.81: [ 1825]: <-- data [1]
Jun 27 11:32:52.83: [ 1825]: --> [2:OK]


Jun 27 11:14:16.37: [ 1825]: SESSION BEGIN 000000343 3901998861
Jun 27 11:14:16.37: [ 1825]: HylaFAX ™ Version 6.0.6
Jun 27 11:14:16.37: [ 1825]: CallID: “” “” “” "s"
Jun 27 11:14:16.37: [ 1825]: MODEM set XON/XOFF/FLUSH: input ignored, output disabled
Jun 27 11:14:16.37: [ 1825]: <-- [4:ATA\r]
Jun 27 11:14:20.09: [ 1825]: --> [7:CONNECT]
Jun 27 11:14:20.09: [ 1825]: ANSWER: FAX CONNECTION DEVICE '/dev/ttyIAX11’
Jun 27 11:14:20.09: [ 1825]: STATE CHANGE: ANSWERING -> RECEIVING
Jun 27 11:14:20.09: [ 1825]: RECV FAX: begin
Jun 27 11:14:20.09: [ 1825]: <-- HDLC<32:FF C0 04 B5 00 AA 12 9E 36 86 62 82 1A 04 14 2E B6 94 04 6A A6 4E CE 96 F6 76 04 6C 74 0C 74 6C>
Jun 27 11:14:20.09: [ 1825]: <-- data [32]
Jun 27 11:14:20.10: [ 1825]: <-- data [2]
Jun 27 11:14:21.05: [ 1825]: --> [7:CONNECT]
Jun 27 11:14:21.05: [ 1825]: <-- HDLC<23:FF C0 02 76 86 66 A6 2E CA 04 A6 CE A6 C6 36 F2 04 F6 96 26 AE 2E CA>
Jun 27 11:14:21.05: [ 1825]: <-- data [23]
Jun 27 11:14:21.05: [ 1825]: <-- data [2]
Jun 27 11:14:21.79: [ 1825]: --> [7:CONNECT]
Jun 27 11:14:21.79: [ 1825]: <-- HDLC<13:FF C8 01 00 77 5F 23 01 FB C1 01 01 18>
Jun 27 11:14:21.79: [ 1825]: <-- data [13]
Jun 27 11:14:21.79: [ 1825]: <-- data [2]
Jun 27 11:14:22.37: [ 1825]: --> [2:OK]
Jun 27 11:14:22.37: [ 1825]: <-- [9:AT+FRH=3\r]
Jun 27 11:14:23.05: [ 1825]: --> [7:CONNECT]
Jun 27 11:14:23.21: [ 1825]: --> [10:NO CARRIER]
Jun 27 11:14:23.21: [ 1825]: MODEM No carrier
Jun 27 11:14:23.21: [ 1825]: DELAY 70 ms
Jun 27 11:14:23.28: [ 1825]: <-- [9:AT+FTH=3\r]
Jun 27 11:14:23.29: [ 1825]: --> [7:CONNECT]
Jun 27 11:14:23.29: [ 1825]: <-- HDLC<3:FF C8 58>
Jun 27 11:14:23.29: [ 1825]: <-- data [3]
Jun 27 11:14:23.29: [ 1825]: <-- data [2]
Jun 27 11:14:24.37: [ 1825]: --> [2:OK]
Jun 27 11:14:24.37: [ 1825]: RECV send CRP (command repeat)
Jun 27 11:14:24.37: [ 1825]: <-- [9:AT+FRH=3\r]
Jun 27 11:14:31.37: [ 1825]: --> [0:]
Jun 27 11:14:31.37: [ 1825]: MODEM
Jun 27 11:14:31.37: [ 1825]: MODEM TIMEOUT: waiting for v.21 carrier
Jun 27 11:14:31.37: [ 1825]: <-- data [1]
Jun 27 11:14:31.39: [ 1825]: --> [2:OK]
Jun 27 11:14:22.37: [ 1825]: <-- [9:AT+FRH=3\r]
Jun 27 11:14:23.05: [ 1825]: --> [7:CONNECT]
Jun 27 11:14:23.21: [ 1825]: --> [10:NO CARRIER]
Jun 27 11:14:23.21: [ 1825]: MODEM No carrier
Jun 27 11:14:23.21: [ 1825]: DELAY 70 ms
Jun 27 11:14:23.28: [ 1825]: <-- [9:AT+FTH=3\r]
Jun 27 11:14:23.29: [ 1825]: --> [7:CONNECT]
Jun 27 11:14:23.29: [ 1825]: <-- HDLC<3:FF C8 58>
Jun 27 11:14:23.29: [ 1825]: <-- data [3]
Jun 27 11:14:23.29: [ 1825]: <-- data [2]
Jun 27 11:14:24.37: [ 1825]: --> [2:OK]
Jun 27 11:14:24.37: [ 1825]: RECV send CRP (command repeat)
Jun 27 11:14:24.37: [ 1825]: <-- [9:AT+FRH=3\r]
Jun 27 11:14:31.37: [ 1825]: --> [0:]
Jun 27 11:14:31.37: [ 1825]: MODEM
Jun 27 11:14:31.37: [ 1825]: MODEM TIMEOUT: waiting for v.21 carrier
Jun 27 11:14:31.37: [ 1825]: <-- data [1]
Jun 27 11:14:31.39: [ 1825]: --> [2:OK]
Jun 27 11:14:31.39: [ 1825]: DELAY 70 ms
Jun 27 11:14:31.46: [ 1825]: <-- [9:AT+FTH=3\r]
Jun 27 11:14:31.47: [ 1825]: --> [7:CONNECT]
Jun 27 11:14:31.47: [ 1825]: <-- HDLC<32:FF C0 04 B5 00 AA 12 9E 36 86 62 82 1A 04 14 2E B6 94 04 6A A6 4E CE 96 F6 76 04 6C 74 0C 74 6C>
Jun 27 11:14:31.47: [ 1825]: <-- data [32]
Jun 27 11:14:31.47: [ 1825]: <-- data [2]
Jun 27 11:14:33.25: [ 1825]: --> [7:CONNECT]
Jun 27 11:14:33.25: [ 1825]: <-- HDLC<23:FF C0 02 76 86 66 A6 2E CA 04 A6 CE A6 C6 36 F2 04 F6 96 26 AE 2E CA>
Jun 27 11:14:33.25: [ 1825]: <-- data [23]
Jun 27 11:14:33.25: [ 1825]: <-- data [2]
Jun 27 11:14:33.99: [ 1825]: --> [7:CONNECT]
Jun 27 11:14:33.99: [ 1825]: <-- HDLC<13:FF C8 01 00 77 5F 23 01 FB C1 01 01 18>
Jun 27 11:14:33.99: [ 1825]: <-- data [13]
Jun 27 11:14:33.99: [ 1825]: <-- data [2]
Jun 27 11:14:34.57: [ 1825]: --> [2:OK]
Jun 27 11:14:34.57: [ 1825]: <-- [9:AT+FRH=3\r]
Jun 27 11:14:41.57: [ 1825]: --> [0:]
Jun 27 11:14:41.57: [ 1825]: MODEM
Jun 27 11:14:41.57: [ 1825]: MODEM TIMEOUT: waiting for v.21 carrier
Jun 27 11:14:41.57: [ 1825]: <-- data [1]
Jun 27 11:14:41.59: [ 1825]: --> [2:OK]
Jun 27 11:14:41.59: [ 1825]: DELAY 70 ms
Jun 27 11:14:41.66: [ 1825]: <-- [9:AT+FTH=3\r]
Jun 27 11:14:41.67: [ 1825]: --> [7:CONNECT]
Jun 27 11:14:41.67: [ 1825]: <-- HDLC<32:FF C0 04 B5 00 AA 12 9E 36 86 62 82 1A 04 14 2E B6 94 04 6A A6 4E CE 96 F6 76 04 6C 74 0C 74 6C>
Jun 27 11:14:41.67: [ 1825]: <-- data [32]
Jun 27 11:14:41.67: [ 1825]: <-- data [2]
Jun 27 11:14:43.45: [ 1825]: --> [7:CONNECT]
Jun 27 11:14:43.45: [ 1825]: <-- HDLC<23:FF C0 02 76 86 66 A6 2E CA 04 A6 CE A6 C6 36 F2 04 F6 96 26 AE 2E CA>
Jun 27 11:14:43.45: [ 1825]: <-- data [23]
Jun 27 11:14:43.45: [ 1825]: <-- data [2]
Jun 27 11:14:44.19: [ 1825]: --> [7:CONNECT]
Jun 27 11:14:44.19: [ 1825]: <-- HDLC<13:FF C8 01 00 77 5F 23 01 FB C1 01 01 18>
Jun 27 11:14:44.19: [ 1825]: <-- data [13]
Jun 27 11:14:44.19: [ 1825]: <-- data [2]
Jun 27 11:14:44.77: [ 1825]: --> [2:OK]
Jun 27 11:14:44.77: [ 1825]: <-- [9:AT+FRH=3\r]
Jun 27 11:14:51.77: [ 1825]: --> [0:]
Jun 27 11:14:51.77: [ 1825]: MODEM
Jun 27 11:14:51.77: [ 1825]: MODEM TIMEOUT: waiting for v.21 carrier
Jun 27 11:14:51.77: [ 1825]: <-- data [1]
Jun 27 11:14:51.79: [ 1825]: --> [2:OK]
Jun 27 11:14:51.79: [ 1825]: DELAY 70 ms
Jun 27 11:14:51.86: [ 1825]: <-- [9:AT+FTH=3\r]
Jun 27 11:14:51.87: [ 1825]: --> [7:CONNECT]
Jun 27 11:14:51.87: [ 1825]: <-- HDLC<32:FF C0 04 B5 00 AA 12 9E 36 86 62 82 1A 04 14 2E B6 94 04 6A A6 4E CE 96 F6 76 04 6C 74 0C 74 6C>
Jun 27 11:14:51.87: [ 1825]: <-- data [32]
Jun 27 11:14:51.87: [ 1825]: <-- data [2]
Jun 27 11:14:53.65: [ 1825]: --> [7:CONNECT]
Jun 27 11:14:53.65: [ 1825]: <-- HDLC<23:FF C0 02 76 86 66 A6 2E CA 04 A6 CE A6 C6 36 F2 04 F6 96 26 AE 2E CA>
Jun 27 11:14:53.65: [ 1825]: <-- data [23]
Jun 27 11:14:53.65: [ 1825]: <-- data [2]
Jun 27 11:14:54.39: [ 1825]: --> [7:CONNECT]
Jun 27 11:14:54.39: [ 1825]: <-- HDLC<13:FF C8 01 00 77 5F 23 01 FB C1 01 01 18>
Jun 27 11:14:54.39: [ 1825]: <-- data [13]
Jun 27 11:14:54.39: [ 1825]: <-- data [2]
Jun 27 11:14:54.97: [ 1825]: --> [2:OK]
Jun 27 11:14:54.97: [ 1825]: <-- [9:AT+FRH=3\r]
Jun 27 11:15:01.97: [ 1825]: --> [0:]
Jun 27 11:15:01.97: [ 1825]: MODEM
Jun 27 11:15:01.97: [ 1825]: MODEM TIMEOUT: waiting for v.21 carrier
Jun 27 11:15:01.97: [ 1825]: <-- data [1]
Jun 27 11:15:01.98: [ 1825]: --> [2:OK]
Jun 27 11:15:01.98: [ 1825]: RECV FAX: No sender protocol (T.30 T1 timeout)
Jun 27 11:15:01.98: [ 1825]: RECV FAX: end
Jun 27 11:15:01.98: [ 1825]: No sender protocol (T.30 T1 timeout)
Jun 27 11:15:01.98: [ 1825]: SESSION END

I don’t know what to do.
Thanks to all

FreePBX doesn’t use Hylafax. I don’t know anybody here that can help you.

You are using iaxmodem, it dpoesn’t support T38 just T30, try a t38modem implementation

In which way?
Changing IAX extension?

It’s a little more complicated than that, maybe start with :-

http://letmegooglethatforyou.com/?q=t38modem

It also depends on what you are trying to do. Asterisk 11 t.38 gateway support is pretty good

I had once a client just like that setup above, SIP Fax without T38 support is next to impossible (iaxmodem case). What we did eventually was use Digium’s Fax, works far better (since it can terminate to T38). Once faxes come in, we wrote a script to push it to hyla/avantfax via diaplan, so that the web UI shows the incoming faxes with enough info to look like it was hyla receiving…

Seem to be running for almost 3 months without an issue so far…

Digium fax for asterisk is out of scope because it is not compiled for ARM processor (I use raspberry Pi).
I tried to enable t38modem installing it, but as far as I understood, it still needs to use hylafax on asterisk installation. Hylafax with T30 and then T38modem with T38 support. But I haven’t found a comprehensive guide on how to configure it. I.e. starting t38modem server or configuring peers. Please check http://www.voip-info.org/wiki/view/T38modem+configuration+with+Asterisk
For example when I try to start t38 modem it says that doesn’t exists and for configuring asterisk ? They write these instructions :

Configuring Asterisk for T38modem

Open /etc/asterisk/sip.conf for editing.

In [general]section add:

; enable general T.38 support
t38pt_udptl=yes

Then add account for T38modem:
[T38modem]
type=friend
host=127.0.0.1
permit=127.0.0.1
context=fax_out
port=6060
allow=all
canreinvite=no
t38pt_udptl=yes

But what I have to add ? What is extensions??

In extensions.ael (assuming you are using AEL2 to code dialplan for fax reception/sending) create:

/* Outgoing fax goes trough context “fax_out” /
context fax_out {
_X. => {
/
Test destination that goes back to T38modem */
if ("${EXTEN}"=“112233”) {
goto fax_in,${EXTEN},1;
}

Dial(SIP/${EXTEN}@${TRUNK},180);

Busy();
Hangup();

}
}

/* Whenever you have detected incoming fax, send call here /
context fax_in {
_X. => {
Set(max_retries=5);
/
Try ringing modem for 5 times, in case all modems are currently busy */
while ("${DIALSTATUS}"!=“ANSWER” & ${max_retries}>0) {
Dial(SIP/${EXTEN}@T38modem,15,g);
Wait(2);
Set(max_retries=$[${max_retries}-1]);
}
Busy();
Hangup();
}
}

Not so understandable
Someone can help me? I would appreciate very much

Thanks in advance

With debian based distro’s like yours it should be as easy as apt-get install t38modem, but get the source distro for some other useful bits, The readme file at

http://t38modem.sourceforge.net/

has examples of a hylafax config.ttyt38* type configuration and how to start t38modem, otherwise treat it much as you would an IAXmodem, (use SIP not h323. for both regular Asterisk extensions and t38 routing)

I suggest you add Avantfax as a front end and use Hylafax+ not Hylafax

Make two t38modems and send from one to the other, with a bit of debugging in the /var/spool/hylafax/log/ you will start to get an idea of what’s going on and you can test to external t38 endpoints.

Good Luck, it takes a while to get the hang of it but the end result is worth it.

(And of course it is just a modem, so you don’t even need Asterisk/FreePBX involved to do the initial testing, just stop asterisk and connect the t38modem direct to your VSP, when that is working, just add Asterisk/FreePBX back into the loop and connect t38modem to your local sip extension)

I installed t38modem. But now?
I’m completely ahead of this and also how to configure iaxmodem.
What I have to change? I’m completely a newbie of this! Some nice soul can help me step-by-step?

Well, welcome newbie, best way to start is just to RTFM, all of them, and if that isn’t enough resort to Google, a well regarded search engine easily found on the interpipes.

You will need to wrap your head around what you are actually trying to do, a modem (MOdulator/DEModulator) is a device that hylafax can connect to like a serial port on the back of your computer or a software device that does the same, if you build iaxmodems or t38 modems that work, then Hylafax can use them Iaxmodems can connect to an iax extension on your asterisk box, similarly t38modems use h323 or SIP signalling and can connect to either h323 or SIP extensions.

Study Topics:-

FAX machines and how they work
Modems and how the work
What t38 is and how it differs from t30
How to build an extension in FreePBX that will utilize Asterisk to connect a received fax call through a modem to a fax machine , real or virtual.
How to use a real fax machine, or virtual device that will connect through hylafax, that will itself will use a modem to connect either one to Asterisk that has been setup by FreePBX to delivery fax calls to a particular PSTN device somewhere else in the world.

This might take a few minutes or more.

I notice we had this same conversation back in February, did you forget to do the RTFM and google bits?

No, unfortunately I belived that The problem was fixed but no way. Is still there.
And I read but still have no idea on how and from what to start. Hylafax seems to receive fax but it says in log that there is a silence synchronization issue, the t38modem server is not located in the folder they describe in doc and others problems. What could I do? Thanks

it will be where you installed it, to remind yourself, from bash:-

which t38modem

Otherwise all I can suggest is keep at it, it will work when you get it right, just be aware that there is no “official” documentation except the original code itself from Comrade Frolov and any attached files therein contained, any package peculiarities are normally self documanted within the .deb file or whatever you used.

no way. too difficult. I checked also the option to use ictfax that said can work side by side with asterisk also.
What do you think about?

Looks interesting, let us know how it turns out.

The mexican jumping bean method. What you want to do is far from easy. I would not bother it’s not worth the pain.

If you want full t.38 and fax support and can’t deal with the portint to ARM CPU you should get a small Atom based board, load the distro that runs out of the box and have yourself a great day.

Science fair projects are great if you like learning and have time on your hands.