Res_fax does not honor maxrate parameter?

I am trying to optimize the Fax errorrate on an Asterisk installation. Many people suggest to lower the baud rate to 9600 and to turn off ECM to improve hangup and connection issues.
(for example here: Fax & Voip - Part 3/3 - Baud Rate & Fax Relay - Informatica PressapochistaInformatica Pressapochista)

I set the maxrate option in res_fax.conf to 9600 but it doesn’t seem to work.

After sending and receiving a fax, the FAXOPT(rate) variable is always 14400.
I set the option in the dialplan too, but it doesn’t have any effect.

As a workaround, i removed v17 from the modems option, as this seems to be the only modem that supports 14400 baud. This seems to work. Transmissions are forced to 9600 baud now and I can verify that with FAXOPT(rate).

I was wondering if removing the v17 modem can cause any other problems besides being slower. (1 page with text takes about 1 min.) In my understanding all Fax devices should be compatible with the other two protocols (v27 and v29).

I was wondering too, if this affects T.38 somehow. I think it’s completely independant of the faxmodems, but I am not sure.

Finaly I was wondering if there is any way to make Asterisk honor the maxrate setting?
I found this very old post with guys having the same problem:

Thank you for any insight!

Hi,

I think, You can’t optimize it that way. Fax is negotiating the speed. The sender starts with his highest rate lowering the rate until there is a readable response (a bit simplified.
Turning off ECM is not a solution. This will lead to unreadable faxes and the receiving site will complain about that.

  • ECM on: Fax took as long as it takes to resolve the errors
  • ECM off: Fax is transmitted with errors. The receiver will complain and You will have to repeat the transmission again.

If the IP connection has jitter or packet loss, You will have always problems with fax. The fax communication is extremely sensitive to transmission errors.

We have best results with G.711a (for US G.,711u) codec and no T.38. Using T.38 is working only, if both sides are using it. Otherwise the negotiation will fail and fall back to audio transmission.

I don’t know anything about FAXOPT as we are using iaxmodem and hylafax.

HTH

Have a nice day

Best regards
Karsten

1 Like

Followup… I did quiet a few tests to get faxing stable. I can confirm that the maxrate setting has no effect. It doesn’t limit the maxrate when using the v17 modem. This seems to be a very old unfixed bug.

  • Faxing with 14.400 was unstable for our line. Connections were lost regulary. Faxing more than 2-3 pages was nearly impossible.
  • Removing the v17 modem from res_fax.conf improved the situation massively. Now the success rate is over 90%, even with many pages.
  • I tested with ECM and without ECM. No difference. Both work stable. So I left ECM on.

Downsides: Transmission is slow. Aprox. 1 Page/min. Quality is not the best. Unsure if it would be better with v17. Would need to retest. Normal text is fine, but when it gets smaller, the quality is bad and gets unreadable. Same for smaller handwriting. The TIF that res_fax creates without any further conversion doesn’t look too good. A hardware fax device produces better quality.

As an additional alternative to Asterisk faxing, we attached a hardware fax to a SIP-analog converter (Grandstream HT802 v2). We made this work with an over 90% success rate too by setting the Baud-rate to 9600 in the Fax device and forcing the converter to ulaw/alaw in passthrough mode (no T.38). We had to choose this setting because the converter can’t switch between T.30 and T.38 dynamically. Maybe there are better alternatives available.

TLTR: 14.400 didn’t work with our SIP trunk. Force it to 9600 or lower by removing the v17 modem from res_fax.conf to hopefully get acceptable service.

Hope this helps someone. Good luck.