I'm going to let you in on a secret: it’s impossible to fax reliably over most VoIP services (SIP trunks) being sold these days, no matter how well you understand and implement T.38 Fax Over IP (FoIP), because the product you’re buying is fundamentally broken.
As crazy as it sounds, it’s missing the one feature that makes sure the other side receives an exact copy of your image: Error Correction Mode (ECM).
Each day, millions of fax pages are sent via T.38 circuits that don’t have ECM enabled, and everyone just kind of hopes the fax pages make it to the other side intact. Sounds crazy? We agree!!
What is ECM and why is it important?
Fax is a page-by-page transmission method, usually done over standard telephone lines. The image data from each page is converted into an audio representation of the page, the audio is sent to the other side, and when both parties are ready, they move on to the next page.
Now, the clever people who invented the fax protocol realized that phone lines are imperfect and that every once in a while there will be a pop, crackle, hum or hiss that distorts that audio signal, leading to loss of fax page image data.
That's where ECM comes in – at the end of each page, the sender and the receiver compare notes, check for any missing or distorted page image data, and then selectively re-transmit only that data. Again they compare notes, and if there's still missing data they repeat the process, only moving to the next page when the current page is 100% correct.
When ECM is not available, however, the end-of-page procedure is quite different, and error checking and error correction ability is limited.