Overcoming the challenges of T.38 for Faxing over SIP

Overcoming the challenges of T.38 for Faxing over SIP

Last Updated on February 4, 2021 by Jaron Davis


Fax over IP (FoIP) is a topic that most collaboration engineers hate. And when I say hate, I don’t mean they just dislike it, they HATE it with the burning rage of hell. One Cisco Live video I watched described fax as “the cockroach that just won’t die.”

Because I work in the healthcare environment, I have to deal with fax far too often. There is always that odd issue where faxes are coming through, but for some reason faxing from a specific company never want to come through properly.

Like most engineers, for a long time I looked at the problem and simply said “look, the calls are coming through for everyone else, I don’t know what else you want me to do? The problem must be on their end.”

So recently I decided to go ahead and dive head first into fax over IP and see if I can determine what the problem might be. I’m going to share some of what I’ve learned. Keep in mind, this is not an end all guide to FoIP, but is more of an introductory guide for Collaboration Engineers. You have to understand a lot of the concepts of voice if you want to understand the rest of this guide, but you don’t necessarily have to be a CCIE to get it, either. (I’m not a CCIE, not even close…)

Faxing Basics

First, let’s understand a little bit about fax. I don’t really feel we need to dive too deep into this, but it’s worth having the knowledge. Fax, on the analog side, uses T.4/T.6 to encode the actual image, and then T.30 for signaling. I’m not going to dig into those protocols, though, because for our purposes, those are relatively irrelevant.

No alt text provided for this image

Group 3 (G3) versus Super Group 3 (SG3)

You will sometimes here G3 and SG3 mentioned. If you’re really interested in this, I highly recommend watching the Cisco Live presentation mentioned in the sources at the bottom, but here are the basics.

While T.4 and T.6 are the protocol used to transmit the encoded image, G3 and G4 are the actual encoding algorithms. G3 = T.4 while G4 = T.6.

Most fax machines are standardized on T.4, which means G3 is used. Here’s the kicker, though, G3 isn’t especially fast. Because of this, Super G3 (SG3) was developed to be carried over the T.4 protocol but to be encoded quicker by the fax machine. The problem? Many fax machines still don’t support SG3, so Cisco’s best recommendation is to stick to standard G3.

Introducing Fax to IP

When we introduce an IP network, however, we have two ways to handle this.

We can handle it like a voice call, and encapsulate that audio in RTP packets using the G.711 codec to sample the audio being played, and then transmit that across the network, including the T.30 and T.4/T.6 protocols within the audio. This method is known as Passthrough.

No alt text provided for this image

The other option is to modulate the analog audio into an image, and then transmit it across the network in image form rather than audio form using the T.38 protocol. This does require DSP’s at the sending and receiving end of the connection, though, since it will need to demodulate it back into an audio signal and add T.30 and T.4/T.6 back to the fax. This method is known as Relay. Most of the time

Notice in the image below that UDPTL is utilized rather than RTP. That is the UDP Transport Layer (IETF RFC7345 if you care to read more about it)

No alt text provided for this image

Here is a quick table describing the pro’s and con’s of each:

No alt text provided for this image

As you can see, the key differences above is that G.711 can accept packet loss and still be an intelligible phone call, but cannot handle much delay, because what good is a word in a sentence if it shows up late? T.38, on the other hand, is the reverse, it can handle up to 1000ms (1 second) delay for information, but cannot accept any packet loss. The reason is obvious, of course, because if you lose packets, you lose parts of our faxed image.

How Cisco Handles Fax over IP

Cisco gives us a few options for handling Fax over IP. We can do everything standards based (protocol based), or we can do things the Cisco way using Named Signal Events (NSE).

NSE Steps in for SIP as a Cisco specific protocol to handle fax passthrough and relay. I’m going to be very honest here, you probably won’t use this primarily because your ITSP won’t support it. So for that reason, I’m not even going to deep dive into this. Stick with standards based (protocol based) T.38 or G.711 over SIP.

Passthrough versus Pass-through?

Cisco makes things a little bit trick with the verbiage, so it’s important to notate this difference:

Passthrough is the method of using G.711 and RTP to transmit fax whereas Relay is the method of using T.38

Pass-through is the standards based (protocol based) version of Passthrough, alternative to the NSE version of Passthrough that is Cisco proprietary.

No alt text provided for this image

Negotiating with your ITSP

Your ITSP (Internet Telephony Service Provider) is probably going to be your biggest hurdle. Many ITSP’s simply don’t support T.38. The problem with this being that for the switchover to happen from G.711 to T.38, SIP has to negotiate all the way back to the point where the sending fax turns into a SIP signal, which isn’t going to be in your network.

No alt text provided for this image

For this reason, always ask your ITSP when deciding which service provider to use if they support T.38. If they don’t, decide if it’s a deal breaker or not, and maybe look at other potential ITSP’s.

Configuring T.38 in your CUBE

If you want T.38 to work, you’re going to have to tell your CUBE router that you want it to do that. You have two options, you can do this universally in your CUBE under your voice service voip configurations, or you can tell each individual dial peer which fax mechanism they should use.

The commands used are as follows:

fax protocol t38 version [0|3] ls-redundancy [0-5] hs-redundancy [0-2] fallback [none|pass-through g711ulaw]

Here we are telling our CUBE that we use to use fax protocol T.38, then we are telling it what level of redundancy we want, and finally we are telling our CUBE what to do if T.38 negotiation fails, if it should fail the fax or fallback to pass-through.

Important Note:

I think it’s important to note here that what I put in my example below is what I would say is the best configuration. Cisco, on the other hand, says best practice is to use this command:

fax protocol t38 version 0 ls-redundancy 0 hs-redundancy 0 fallback none

fax-relay ans-disable

This is so that if the CUBE detects an ANS signal in the T.30 signal, it will cut it out, disallowing SG3 to initiate, forcing a sending back to resort to G3. Don’t use this command if you want to utilize SG3. Using this command is Cisco best practice.

fax-relay sg3-to-g3

This command will take out the Calling Menu tone from a sending fax if your CUBE detects it, again to disallow SG3 and resort to G3, which is Cisco best practice.

This next command can ONLY be put on your dial peer.

fax-relay ecm-disable

This command disables the error correction mode (ECM) signal in the T.30 fax tone, if recognized, to disable ECM. ECM is used to correct issues caused by noise on POTS telephone lines. Again, Cisco best practice. I personally think we should leave ECM enabled, but a TAC engineer told me not to.

HomeLab#config t
Enter configuration commands, one per line.  End with CNTL/Z.
HomeLab(config)#voice service voip
HomeLab(conf-voi-serv)#fax protocol t38 version 3 ls-redundancy 1 hs-redundancy 1 fallback pass-through g711ulaw
HomeLab(conf-voi-serv)#fax-relay ans-disable
HomeLab(conf-voi-serv)#fax-relay sg3-to-g3

Important Note: 

If you configure the fax protocol on your individual dial peers, you must ensure you enabled on both the inbound and outbound dial peers, and you must match configurations for both sides of the call.


Cisco Live – Understanding, Integrating, and Troubleshooting Fax Communications in Today’s Enterprise Networks – BRKUCC-2021 – https://www.ciscolive.com/c/dam/r/ciscolive/us/docs/2017/pdf/BRKUCC-2021.pdf

ITU-T – T-REC-T.38 – https://www.itu.int/rec/T-REC-T.38/en

WhatIs.com – Fax Group – https://whatis.techtarget.com/definition/Fax-Group

t38fax.com – ECM – T.38’s Dirth Little Secret (And Why It Matters) – http://blog.t38fax.com/blog/ecm-t38-dirty-little-secret

Cisco.com – Cisco IOS Voice Command Reference – Chapter F – https://www.cisco.com/c/en/us/td/docs/ios/voice/command/reference/vr_book/vr_f1.html

Leave a Reply