Analog faxes and modems provide an extra challenge in a VoIP network. These devices assume that they have a physical circuit between the transmitting and receiving ends, such as over the PSTN, but IP networks do not provide this. Thus, fax and modem data requires special handling when sending over an IP network. There are two basic methods for handing fax and modem calls:
Note
A third method, Store and Forward, is used only for faxes. It uses a separate e-mail server and allows faxes to be sent as TIFF attachments to e-mails. You can use Toolkit Command Language (Tcl) scripts to provide some fax-related services, also. Tcl interactive voice response (IVR) scripts are typically used with Store and Forward faxing. Tcl scripts can also provide fax detection and fax rollover applications. Fax detection allows one phone number to be used for both voice and fax calls. Fax rollover involves switching to Store and Forward mode if fax relay fails. See Chapter 15, "Using TCL Scripts and VoiceXML," for more information on Tcl scripts for fax applications.
Providing Fax Services
Several standards govern fax transmissions. It is not necessary to know all of them to get faxes working over IP, but an understanding of the major ones helps. International Telecommunications Union Telecommunication Standardization Sector (ITU-T) standards govern such things as fax resolution, identifying tones, handshaking procedures, and transmission speeds. They have developed over time from Group 1 to Group 3 standards. The Group 3, or "G3," standard is currently the most commonly used. It allows fax transmission rates over analog lines of up to 14,400 bps. Group 4 (G4) is a standard for transmitting faxes over ISDN, and it can send at a rate of 64,000 bps. By using two B-channels, G4 faxes can send and receive at the same time. Super G3 (SG3) is a newer standard, which allows sending faxes at 33,600 bps.
Session management between two G3 fax machines is specified in the T.30 standard of the ITU-T, and T.4 describes the image transmission. Communication between gateways using fax relay is standardized by T.38.
T.30 divides fax calls into five phases:
The calling machine responds with a Digital Command Signal (DCS), telling the called device which of its settings to use. The calling machine then sends a Training Check Field (TCF) signal at the agreed-upon modulation. If the called machine receives this properly, it responds with a Confirmation to Receive (CFR) message. Otherwise, it sends a Failure to Train (FTT).
Phases A and B are handled differently in Super G3 faxes. In Phase A, the called device sends a Modified Answer (ANSam) tone instead of a CED tone. In Phase B, the calling device sends a Call Menu message, and the called fax responds with a Joint Menu message. If the SG3 handshake does not succeed, the fax machines fall back to G3 mode. These differences in operation might require some special configuration, as you will see in the following sections.
You can configure the type of fax treatment used in two places: under an individual dial peer, or in the voice service voip configuration mode. The command syntax is fax protocol {cisco | none | pass-through {g711ulaw | g711alaw}| system | t38}. The exact options available vary by Cisco IOS version.
Configuring Cisco Fax Relay
Cisco gateways use two versions of fax relay: the Cisco proprietary version, and one that uses the ITU-T T.38 standard. Cisco fax relay is the default way of handling faxing by Cisco gateways. It uses RTP to exchange the demodulated T.30 fax signals with its peer gateway. Cisco fax relay is supported on most Cisco gateways, with the exception of some models in the AS5000 series. It does not need to be enabled, unless you have used a different method and want to re-enable it. The command to enable Cisco fax relay is fax protocol cisco. You can give this command under an individual dial peer, or under voice service voip configuration mode to affect all dial peers.
You can tweak Cisco fax relay in a few ways. For instance, Error Correction Mode (ECM) is enabled by default. Fax machines that use ECM require any frames that have errors to be retransmitted. If the fax cannot receive an error-free page, it might terminate the call. In networks that have more than two percent packet loss, you might see a high rate of fax failure because of ECM. If you disable it, more faxes succeed, although they might contain some errors. Disable ECM with the VoIP dial peer command fax-relay ecm disable.
Some fax machine manufacturers use proprietary features, which are negotiated during Phase B using an optional Non-Standard Facilities (NSF) field. The Cisco fax relay handles fax calls based on T.30 standards, and thus cannot interpret these capabilities. You can cause the gateway to overwrite the NSF field with zeros using the VoIP dial peer command fax nsf 000000.
You might need to change the rate at which faxes are sent. By default, faxes use the same bandwidth as voice calls. In networks that use low-bandwidth codecs, such as G.729, this might cause faxes to transmit too slowly. Also, some fax machines might operate better at a different speed than the default. You can change fax bandwidth for a VoIP dial peer with the command fax rate {speed | disable | voice}, where speed is a value from 2400 to 14400 bps, disable disables all fax transfer methods, and voice uses the voice call bandwidth. This command is also valid for T.38 fax relay.
In Example 8-20, Cisco fax relay is enabled, ECM is disabled, use of proprietary features is disabled, and the fax rate is set at 14400 bps.
VoiceGW(config)#dial-peer voice 4000 voip VoiceGW(config-dial-peer)#fax protocol cisco VoiceGW(config-dial-peer)#fax-relay ecm disable VoiceGW(config-dial-peer)#fax nsf 000000 VoiceGW(config-dial-peer)#fax rate 14400 |
Configuring T.38 Fax Relay for MGCP Gateways
T.38 is a standards-based type of fax relay, which treats the communication between gateways differently from Cisco fax relay. After the gateway demodulates the T.30 messages from the fax machine, it translates them into T.38 Internet Fax Protocol (IFP) packets for transmission to its peer gateway. When the other gateway receives these packets, it translates them back into T.30 signals and sends those to the fax machine.
T.38 fax relay is handled differently on MGCP gateways than on H.323 and SIP gateways. MGCP gateways can rely on the call agent to direct the T.38 traffic flow, when using call agent (CA)-controlled fax relay mode. They can also make those decisions themselves, when using gateway-controlled fax relay mode.
In gateway-controlled mode, fax relay capabilities are exchanged in the Session Description Protocol (SDP) packets during call setup. If both gateways support fax relay, they signal the switch to T.38 using Named Service Event (NSE) or Named Telephony Event (NTE) messages after they detect a DIS fax tone. NSE messages are a Cisco-proprietary form of NTE messages. They are used to send call signaling that would be sent using tones, such as fax tones, in a non-VoIP network. The content of the NSE messages has information to allow the receiving gateway to re-create the original tones. NSE and NTE messages travel in the RTP stream, but they use a different RTP payload type (usually 100) to distinguish them from voice packets. NSE and NTE differ in the values used to represent tones and events.
If neither gateway supports fax relay, the gateways fall back to fax passthrough. The CA knows only that a voice call exists; the fact that it is a fax call is transparent to it. T.38 fax relay is disabled by default on MGCP gateways using auto-configuration before Cisco IOS 12.4T, and it is enabled on Cisco IOS versions after that.
You can make some adjustments to MGCP T.38 with the global command mgcp fax t38 {ecm | gateway force | hs_redundancy value | inhibit | ls_redundancy value | nsf hexcode}, where
Use the show mgcp command to verify your configuration, as shown in Example 8-21. Only relevant portions of the lengthy output are displayed. Note that MGCP T.38 commands are given at the global configuration mode.
[View full width] VoiceGW(config)#no mgcp fax t38 inhibit VoiceGW(config)#no mgcp fax t38 ecm VoiceGW(config)#^Z VoiceGW#show mgcp ... MGCP TSE payload: 100 MGCP T.38 Named Signalling Event (NSE) response timer: 200 ... MGCP T.38 Fax is ENABLED MGCP T.38 Fax ECM is DISABLED MGCP T.38 Fax NSF Override is DISABLED MGCP T.38 Fax Low Speed Redundancy: 0MGCP T.38 Fax High Speed Redundancy: 0 |
Configuring T.38 Fax Relay for H.323 and SIP Gateways
H.323 and SIP gateways use the same basic configuration for T.38 fax relay. They do not use NSE messages to signal the other gateway to switch to fax mode, unless you specifically configure it. Instead, they use H.323 or SIP messages. Configure dial peers for fax destinations, enable T.38 fax relay, and set parameters under each dial peer. If several dial peers share the same T.38 settings, you might prefer to configure them globally under the voice service voip mode instead. Dial peer configuration takes precedence over global configuration if both exist.
The command to configure T.38 fax relay under a dial peer is fax protocol {system | t38 [nse [force]] [ls-redundancy value [hs-redundancy value]] [fallback {cisco | none | pass-through {g711ulaw | g711alaw}}]}, where
The same command is available under voice service voip configuration mode, although the system option is not available. When configuring fax relay in this way, make sure that at least one dial peer matches the incoming calls. Commands that you configure under a dial peer take precedence over those you configure in voice service voip mode.
Example 8-22 shows a dial peer that is configured for T.38 fax relay. It forces the use of NSE messages and falls back to Cisco fax relay if the gateways cannot negotiate T.38.
VoiceGW(config)#dial-peer voice 4000 voip VoiceGW(config-dial-peer)#fax protocol t38 nse force fallback cisco |
When you are troubleshooting T.38 fax relay, be sure that an IP path exists between the two gateways. Check that the dial peers are configured properly. The debug fax relay t30 command gives you information about the phone numbers and T.30 messages in your fax transmissions.
Note
Debug commands can affect the performance of the router.
Configuring Super G3 Fax Relay
Super G3 (SG3) fax machines negotiate the use of SG3 speed during call setup, using Call Menu and Joint Menu messages. They use the V.34 standard for modulation and the V.8 standard for signaling. V.34 is a form of pulse code modulation (PCM) that allows data transmission up to 33,600 bps. The V.8 standard describes SG3 signaling such as ANSam, Call Menu, and Joint Menu.
SG3 machines can interoperate with G3 faxes. If an SG3 machine is on one end and a G3 machine is on the other, the SG3 machine receives a DIS instead of the expected Menu message, and it falls back to G3 mode. When the gateway hears the DIS, it switches the call to a fax call. Fax relay between SG3 and G3 machines is not usually a problem in Cisco VoIP networks.
Fax relay between two SG3 machines can be a problem, however. SG3 was not designed to work with T.38 fax relay. The two fax machines exchange V.8 signaling, so the gateways never hear a DIS and do not switch the call over to fax mode. The current solution for this is SG3 fax spoofing. SG3 fax spoofing is available on most voice gateways in Cisco IOS versions 12.4(4)T and later. It blocks the Call Menu message from being sent. This causes the receiving fax machine to fall back to G3 mode and send V.21 DIS and DCS messages. Both gateways then use G3 mode.
You can configure SG3 fax spoofing on one or both gateways, but you at least must configure it on the calling gateway so that it suppresses the Call Menu message. You can configure the fax-relay sg3-to-g3 [system] command under a dial peer or in voice service voip configuration mode on H.323 or SIP gateways. Configure SG3 spoofing in global configuration mode on MGCP gateways. The "system" option is available only in dial peer configuration mode and causes the dial peer to use the protocol set in voice service voip configuration mode. Example 8-23 shows a router configured under the voice service mode to use SG3 fax spoofing.
VoiceGW(config)#voice service voip VoiceGW(conf-voi-serv)#fax-relay sg3-to-g3 |
Configuring Fax Passthrough
In fax passthrough, the gateway does not demodulate the callit treats fax calls similar to analog voice calls. Fax data is sent in-band, in RTP packets, to the other gateway. Fax passthrough uses the G.711 codec and requires 64 kbps per call, plus 32 kbps per call for overhead. Echo cancellation and VAD are turned off. Passthrough is sensitive to jitter, latency, and packet loss. You can use redundancy, which sends two copies of each packet, to mitigate packet loss, but it also requires extra network bandwidth.
Configuring Fax Passthrough for MGCP Gateways
As with fax relay, MGCP gateways use NSE messages to signal their peer to switch to fax mode. You configure fax passthrough for MGCP gateways globally rather than under the dial peer, using options of the mgcp modem passthrough command. MGCP gateways use NSE messages to signal their peer gateway to switch to fax mode. Passthrough using NSEs is called "modem passthrough"; thus, the command to configure fax passthrough on an MGCP gateway is the same command you use to configure modem passthrough. The following commands are available:
Example 8-24 shows an MGCP gateway configured for fax passthrough, with redundancy, using NSE message for upspeeding. The TSE payload value is left at its default of 100. This is verified with the show mgcp command. Only the relevant output of the command is shown.
[View full width] VoiceGW(config)#mgcp modem passthrough voip mode nse VoiceGW(config)#mgcp modem passthrough voip redundancy ! VoiceGW#show mgcp MGCP voip modem passthrough mode: NSE, codec: g711ulaw, redundancy: ENABLED, MGCP voaal2 modem passthrough disabled MGCP voip modem relay: Disabled. MGCP TSE payload: 100 |
Configuring Fax Passthrough for H.323 and SIP Gateways
H.323 and SIP gateways typically signal the switchover to fax mode using H.323 or SIP protocol messages. However, you can configure them to use NSE messages. Using NSEs is actually called "modem passthrough." You must use modem passthrough when you are interacting with Cisco CallManager, because it uses NSE messages.
The command to configure fax passthrough is the same whether given in dial peer or voice service voip configuration mode: fax protocol pass-through {g711ulaw | g711alaw}. To force the use of NSE messages, configure modem passthrough with the modem passthrough nse [payload-type number] {codec {g711alaw | g711ulaw}} [redundancy] [maximum-sessions sessions] command, where
Use the same settings on both the sending and receiving gateways. When you configure fax or modem passthrough globally, be sure that at least one dial peer matches the incoming fax or modem calls.
In Example 8-25, a dial peer is configured to match all incoming calls using the . (period) wildcard. Fax passthrough is then enabled on the dial peer, using the G711ulaw codec.
AA03(config)#dial-peer voice 904 voip AA03(config-dial-peer)#incoming called-number . AA03(config-dial-peer)#fax protocol pass-through g711ulaw |
Providing Modem Services
As with faxes, a VoIP network can carry modem traffic using either a relay method or a passthrough method.
In modem relay, the modem traffic is demodulated at one gateway, digitized, and carried to the other gateway using the Simple Packet Relay Transfer (SPRT) protocol. At the receiving gateway, the traffic is remodulated and sent to the receiving modem. Modem relay is not as affected by packet loss, delay, and jitter as is modem passthrough. It also uses less bandwidth.
When a gateway that is configured for modem relay first detects a modem tone, it switches to modem passthrough mode. Then, if it detects a Call Menu (CM) tone, and the gateways have negotiated modem relay support, it switches to modem relay mode. The gateways use NSE messages to tell the other gateway to switch modes. Call Menu tones are discussed in the earlier section "Providing Fax Services."
In modem passthrough, RTP packets are used to carry the modem traffic between the two gateways. When the gateways detect a modem signal, they exchange NSE messages. Both the originating and terminating gateway switch to using a G.711 codec, and they disable the high-pass filter, echo cancellation, and VAD for the duration of the modem call. As with fax passthrough, modem passthrough is sensitive to packet loss, delay, and jitter. You can use redundancy with modem passthrough to send an extra copy of each packet to help mitigate packet loss. This does result in higher bandwidth use, however. Modem passthrough is also referred to as Voice Band Data (VBD).
Configuring Cisco Modem Relay
To use Cisco modem relay, several requirements must be met:
If these conditions are not met, modem passthrough is used. Cisco modem relay supports a transfer rate of 33.6 Kbps, which means that faster modems need to train down to that speed.
You configure modem relay on MGCP gateways at the global configuration mode with the mgcp modem relay voip mode [nse] [codec (g711alaw | g711ulaw}] [redundancy] gw-controlled command, where
If you are using several of the options for this command, give them on the same line, as shown next, or the later command will overwrite them.
VoiceGW(config)#mgcp modem relay voip mode nse codec g711ulaw redundancy gw-controlled
You can configure modem relay on H.323 and SIP gateways either in voice service mode, to apply to all VoIP modem calls, or in dial peer mode, to apply to only that dial peer. If both modes are used, the dial peer configuration takes precedent over the global configuration. Use the modem relay {nse [payload-type number] [codec {g711alaw | g711ulaw}] [redundancy] | system} gw-controlled command, where
Be sure to use the same codec type for both the originating and the terminating gateways. Use G.711ulaw for T1 links, and G.711alaw for E1 links.
Configuring Modem Passthrough
As with fax passthrough, modem passthrough configuration for MGCP gateways differs from H.323 and SIP configuration. Modem passthrough for MGCP gateways is configured globally rather than under the dial peer, using options of the mgcp modem passthrough command. See the previous section "Configuring Fax Passthrough for MGCP Gateways" for a complete description and examples of this command.
For H.323 and SIP gateways, you can configure modem passthrough either under voice service configuration mode or under individual dial peers. When you configure under voice service mode, the command is modem passthrough nse [payload-type number] codec {g711ulaw | g711alaw} [redundancy] [maximum-sessions value], where
When you give the command under a dial peer configuration, the maximum-sessions option is not available. An additional option, modem passthrough system, is available only in dial peer mode; it tells the dial peer to use the globally configured modem passthrough mode.
If a gateway that is using modem passthrough connects to the PSTN, it is important to synch the gateway clock with the PSTN clock so that modem passthrough can work correctly. Configure the PSTN interface to provide clocking for the gateway.
Example 8-26 shows modem passthrough configured for a SIP dial peer. NSE messages are used, along with the G.711alaw codec, and redundant packets are sent.
VoiceGW(config)#dial-peer voice 706 voip VoiceGW (config-dial-peer)#incoming called-number . VoiceGW (config-dial-peer)#session protocol sipv2 VoiceGW (config-dial-peer)#modem passthrough nse codec g711alaw redundancy |
Security |
Part I: Voice Gateways and Gatekeepers
Gateways and Gatekeepers
Part II: Gateways
Media Gateway Control Protocol
H.323
Session Initiation Protocol
Circuit Options
Connecting to the PSTN
Connecting to PBXs
Connecting to an IP WAN
Dial Plans
Digit Manipulation
Influencing Path Selection
Configuring Class of Restrictions
SRST and MGCP Gateway Fallback
DSP Resources
Using Tcl Scripts and VoiceXML
Part III: Gatekeepers
Deploying Gatekeepers
Gatekeeper Configuration
Part IV: IP-to-IP Gateways
Cisco Multiservice IP-to-IP Gateway
Appendix A. Answers to Chapter-Ending Review Questions
Index