|Technical

How T.38 Fax Actually Works

How T.38 fax relay works, how it differs from fax passthrough, the SIP re-INVITE flow that sets it up, and why T.38 still breaks so often in production.

Fax over VoIP is one of those problems that the industry has been solving for twenty years and still has not fully solved. The basic issue is that fax machines were designed to communicate over dedicated analog circuits with predictable timing, and VoIP provides none of those guarantees. T.38 is the protocol designed to bridge that gap, and understanding how it works explains both why it helps and why it still breaks.

If you are dealing with fax problems on your VoIP system, this is the protocol-level context behind those issues. If you are still running analog fax lines and wondering whether to convert them, this explains what you are converting to.

Why fax hates VoIP

A fax machine communicates by generating precise analog tones that encode data using modem modulation schemes (V.17, V.29, V.27ter). The receiving fax machine demodulates these tones to recover the data. The process is sensitive to timing in ways that voice is not.

A voice call can tolerate 20ms of jitter and 1% packet loss with minimal perceptible impact. The human brain fills in gaps and compensates for small impairments. A fax modem cannot. The modem's demodulator expects tones to arrive with specific timing relationships. Jitter disrupts those relationships. Packet loss removes chunks of the modulated signal. And audio codecs — especially compressed codecs like G.729 — alter the signal in ways that the demodulator cannot recover from.

Sending fax tones through a G.729 codec is like photocopying a photograph, then photocopying the photocopy. The compression algorithm is optimized for human speech, not modem tones. It strips out the signal characteristics the fax modem relies on. The fax fails, sometimes immediately, sometimes partway through a page.

Even G.711 (uncompressed) passes fax tones imperfectly over VoIP because jitter buffers, echo cancelers, and silence suppression all interfere with the precise timing the modem expects.

Fax passthrough: the brute-force approach

The simplest approach to fax over VoIP is passthrough. The VoIP system detects a fax tone (typically the CNG tone — a 1100Hz tone sent by the calling fax machine), switches the call to G.711 if it is not already using it, disables echo cancellation, disables silence suppression, and passes the modem audio through the VoIP channel as-is.

Passthrough works when the network is clean. If jitter is low, packet loss is near zero, and no device in the path is modifying the audio, the fax tones arrive intact and the receiving machine demodulates them successfully. On a LAN or a high-quality dedicated connection, passthrough is often reliable enough.

On a typical internet connection with variable jitter and occasional packet loss, passthrough becomes unreliable. A single lost packet during page transmission can corrupt the data. Jitter that exceeds the modem's tolerance causes demodulation errors. The fax machine retries, slows down its transmission speed, or drops the session entirely.

T.38: demodulate, transmit data, remodulate

T.38 takes a fundamentally different approach. Instead of sending fax tones as audio through the VoIP channel, T.38 demodulates the fax tones at the sending end, transmits the extracted fax data as structured packets, and remodulates the tones at the receiving end.

The process works like this:

Step 1: Fax detection. The call starts as a normal voice call. When a fax tone is detected (CNG from the sender or CED from the receiver), the gateway initiates a switch to T.38 mode.

Step 2: SIP re-INVITE. The gateway sends a SIP re-INVITE with an SDP body that specifies T.38 as the media type instead of audio. The SDP includes T.38-specific parameters: supported fax data rate, error correction mode, and transport protocol. If the remote end supports T.38, it accepts the re-INVITE. If not, the re-INVITE is rejected and the call either falls back to passthrough or the fax fails.

Step 3: IFP packetization. Once both sides agree on T.38, the sending gateway demodulates the incoming fax tones and encodes the data into IFP (Internet Facsimile Protocol) packets. These packets contain the fax data in a structured format — T.30 signaling messages, page data, and control information — rather than raw audio.

Step 4: UDPTL transport. IFP packets are transported using UDPTL (UDP Transport Layer for T.38), not RTP. UDPTL is a transport protocol designed specifically for T.38 that includes built-in redundancy. Each UDPTL packet typically contains the current IFP data plus copies of one or more previous IFP packets. If a packet is lost, the redundant data in subsequent packets allows recovery.

Step 5: Remodulation. The receiving gateway takes the IFP data, converts it back to the appropriate fax modem tones, and sends those tones to the receiving fax machine over whatever local connection it has (analog line, ATA, etc.). The receiving fax machine sees what appears to be a normal fax transmission from another fax machine.

The key insight is that the network path between the two gateways carries structured data, not audio. A lost packet does not create a gap in a modem tone — it loses a data packet that can potentially be recovered from redundancy. Jitter does not disrupt modem timing because the remodulation happens locally at the receiving end with its own timing.

The re-INVITE: where T.38 breaks most often

The transition from voice/audio mode to T.38 mode requires a SIP re-INVITE that both sides must support and accept. This is the most common point of failure.

The remote end does not support T.38. Not all SIP trunking providers support T.38 on all trunks. If the far end rejects the re-INVITE with a 488 Not Acceptable Here or simply does not understand the T.38 SDP, the switchover fails. What happens next depends on the sending gateway's configuration — it may fall back to passthrough, or the fax may fail.

Gateway version mismatch. T.38 has multiple versions, and the parameters in the SDP (max bit rate, error correction mode, rate management) must be compatible between both sides. A mismatch can cause the re-INVITE to succeed but the actual T.38 session to fail when data transfer begins.

Timing problems. The re-INVITE must complete before the fax machines advance past the initial handshake phase. If the re-INVITE takes too long — because of network latency, SIP proxy delays, or slow endpoint processing — the fax machines may time out and drop the session. Some fax machines are more tolerant of this delay than others.

Firewalls blocking UDPTL. UDPTL uses UDP but on different ports than RTP. If your firewall is configured to allow RTP on specific port ranges but does not account for UDPTL, the T.38 data will be blocked even though the SIP signaling succeeded. The result is a successful T.38 negotiation followed by no data flowing — the fax hangs and eventually times out.

NAT complications. The same NAT traversal issues that affect RTP also affect UDPTL, but NAT devices are less likely to handle UDPTL correctly because it is a less common protocol. SIP ALGs that rewrite RTP addresses in SDP may not know how to handle T.38 SDP.

Error Correction Mode (ECM)

ECM is a feature of the T.30 fax protocol (the protocol that fax machines speak to each other) that adds error detection and retransmission at the fax layer. When ECM is enabled, the sending fax machine breaks each page into blocks, sends them with error-checking data, and the receiving machine requests retransmission of any corrupted blocks.

ECM works well with T.38 because the combination provides error correction at two layers: UDPTL redundancy handles packet loss on the network, and ECM handles any residual data errors in the fax content. With both enabled, fax reliability over VoIP improves significantly.

ECM is less helpful with fax passthrough because the audio path does not have the same redundancy mechanisms. If a packet is lost during passthrough, the modem tone is damaged, and ECM may trigger retransmissions. But if the network is consistently lossy, ECM retransmissions can slow the fax to a crawl or cause it to fail after exhausting retries.

Most modern fax machines support ECM by default. If you are troubleshooting fax failures, verify that ECM is enabled on both machines. Some older machines or budget models have ECM disabled.

Troubleshooting T.38

Fax detected but call drops immediately. The re-INVITE is probably being rejected. Check your SIP traces to see the response to the re-INVITE. A 488 or 606 response means the far end does not support T.38. Configure your gateway to fall back to passthrough.

Fax connects but pages fail. T.38 is negotiated but data is not flowing correctly. Check for firewall blocking UDPTL, NAT issues with UDPTL ports, or a gateway mismatch in T.38 parameters. Capture packets and look for UDPTL traffic on the negotiated port.

Fax is very slow. The fax machines are probably falling back to lower speeds due to errors. With T.38, this suggests the UDPTL redundancy is not fully compensating for network loss. Check the network path for packet loss. With passthrough, it suggests the audio path has enough jitter or loss to cause frequent retransmissions.

Intermittent failures. Some faxes work, some do not. This often indicates a borderline network condition — enough impairment to occasionally corrupt data but not enough to fail consistently. It can also indicate a T.38 compatibility issue with specific remote fax machines or gateways. Test with multiple destinations to narrow down whether the problem is local or specific to certain remote endpoints.

When to use which

Use T.38 when your equipment and provider both support it reliably. T.38 handles network impairment better than passthrough and is the right choice for any environment where fax reliability matters.

Use passthrough when T.38 is not available or when T.38 is causing more problems than it solves (failed re-INVITEs, gateway incompatibilities). Configure passthrough with G.711 only (never compressed codecs), echo cancellation disabled, silence suppression disabled, and jitter buffer set to fixed mode.

Use a dedicated fax-over-IP service (like an e-fax provider) when fax volume is low and you want to avoid the complexity of either approach entirely. These services handle the T.38 or passthrough mechanics on their end and deliver faxes as email attachments.

Or, increasingly, stop faxing. The number of situations that genuinely require fax is shrinking. But if your organization still depends on it — and many in healthcare, legal, and government do — understanding T.38 is the difference between faxes that work and faxes that fail with no clear explanation.

Frequently Asked Questions

What is the difference between T.38 fax relay and fax passthrough?+

Fax passthrough sends the fax modem tones as audio through the VoIP system, typically using G.711 with specific settings (no silence suppression, no echo cancellation, no jitter buffer). T.38 fax relay demodulates the fax tones at the sending gateway, transmits the fax data as structured packets, and remodulates the tones at the receiving gateway. T.38 is more resilient to network impairment but requires both endpoints to support it.

Why do faxes fail over VoIP when phone calls work fine?+

Fax modems use precise analog signaling that is far less tolerant of the timing variations and packet loss that VoIP introduces. Voice calls mask small impairments through the natural redundancy of speech and the listener's brain. Fax modems have no such tolerance — a few lost or delayed packets can corrupt a page or drop the session entirely. Running a VoIP quality test can reveal jitter and loss levels that are inaudible on voice calls but fatal to fax transmissions.

Does my SIP trunking provider support T.38?+

Not all do, and support levels vary. Some providers support T.38 on all trunks. Some support it only on specific trunk types or for an additional fee. Some do not support it at all and only offer fax passthrough. Ask your provider specifically about T.38 support before assuming it will work. If the T.38 re-INVITE is rejected, check the SIP Response Code Lookup for the specific error code to understand why.

Should I use T.38 or fax passthrough?+

If both your equipment and your provider support T.38 reliably, use T.38. It handles network impairment better than passthrough because it transmits structured data rather than audio. If T.38 is causing problems (failed re-INVITEs, gateway mismatches), fax passthrough over G.711 with proper settings is a reasonable fallback, especially on networks with low jitter and loss.

t38faxfax-over-ipsipvoip-fundamentalstroubleshooting

Share

Opens your messaging app. We do not collect or store any phone numbers.
Opens your email client. We do not collect or store any email addresses through sharing.

Want to know when we publish new articles? Sign up for updates