Providing Fax and Modem Services
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:
- Relay The analog data is demodulated by the sending gateway, which packetizes the data and sends it over the IP network. The receiving gateway remodulates it and forwards it as analog data to the fax or modem. The actions of the gateways are transparent to the end devicesthey receive analog data just as if they were communicating over a PSTN link. In general, relay is not as affected by packet loss, delay, and jitter as is passthrough. It also uses less bandwidth.
- Passthrough Fax and modem calls are treated as any other analog voice call, with the data carried in-band in RTP packets to the remote fax or modem. This requires the G.711 codec, no echo cancellation, and no voice activity detection (VAD). When the gateways recognize the type of call, they change to these settings for the duration of the call. Passthrough is sensitive to packet loss, delay, and jitter. You can use redundancy with passthrough to send an extra copy of each packet, to help mitigate packet loss. This does result in higher bandwidth use, however.
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:
- Phase A: Call Setup In Phase A, a call is established, and the two endpoints identify themselves as fax machines. The calling device repeatedly sends a CalliNG (CNG) tone. The called device sends a Called Station Identification (CED) tone. After the devices exchange these tones, they know that they are communicating with a fax machine.
- Phase B: Capabilities Exchange The called machine sends a V.21 standard Digital Identification Signal (DIS), which lists its capabilities, such as page length, resolution, error correction, and handshake speed. When the gateway sees this DIS message, it switches the call from a voice codec to a fax codec.
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).
- Phase C: Data Transmission The T.4 standard specifies message transmission standards. It handles such things as encoding type and error correction. At the end of the transmission, the fax sends a Return to Control (RTC) message, which initiates Phase D.
- Phase D: Confirming the Transmission After the sending fax has returned to control mode, it sends a message that it has finished transmitting. The receiving fax responds with a Message Confirmation (MCF).
- Phase E: Releasing the Call Either fax machine can send a Disconnect (DCN) message. Both sides then release the call.
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
- ecm enables error correction mode.
- gateway force forces the gateway to use T.38 and NSEs even if they are not negotiated during call setup. This allows MGCP gateways to use T.38 fax relay with H.323 and SIP gateways.
- hs-redundancy factor causes the router to send redundant packets when doing high-speed faxing, to cover for any dropped packets. The default value is 0, which means no redundancy.
- inhibit disables T.38 fax relay on the gateway. To enable T.38 fax relay, use the command no mgcp fax t38 inhibit.
- ls-redundancy causes the router to send redundant packets when doing low-speed faxing, to cover for any dropped packets. The default value is 0, which means no redundancy.
- nsf hexcode disables the use of proprietary fax features when the hexcode used is 000000.
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 |
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
- system is the default. It causes the dial peer to use the global fax protocol that is configured.
- t38 tells the dial peer to use T.38 fax relay. The nse option to this command negotiates the use of NSE messages to signal the switch to fax relay. The force option requires the use of NSE messages, even if the other side does not signal that capability. This allows H.323 and SIP gateways to exchange faxes with MGCP gateways.
- ls-redundancy value causes the router to send redundant packets when doing low-speed faxing, to cover for any dropped packets. The default value is 0, which means no redundancy.
- hs-redundancy value causes the router to send redundant packets when doing high-speed faxing, to cover for any dropped packets. The default value is 0, which means no redundancy.
- fallback configures a fallback way to handle faxing if the gateway cannot negotiate T.38 fax relay with its peer gateway. cisco uses Cisco fax relay, none disables fax handling, and pass-through enables fax passthrough. You must specify the codec to useeither g711ulaw or g711alaw.
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:
- mgcp modem passthrough {cisco | ca} Configures the type of fax/modem passthrough used. The cisco option causes the gateway to switch to G711 codec when it detects a fax tone, and notify its peer gateway. The ca option, which is the default, causes the gateway to alert its call agent when a fax tone is detected. The call agent then signals a switch to the G711 codec.
- mgcp modem passthrough {voip | voaal2} codec {g711alaw | g711ulaw} Configures the codec used in either VoIP or Voice over ATM Adaptation Layer 2 (VoAAL2) networks. If you do not specify the codec, the router uses G711ulaw. After the router detects fax or modem traffic, it switches to using the specified codec for that call.
- mgcp modem passthrough voip redundancy Enables redundant fax packets to be sent, to mitigate packet loss. Redundancy is disabled by default.
- mgcp modem passthrough mode {voip | voaal2} mode {cisco | nse} Configures the method used to signal the switch to fax speed in either VoIP or VoAAL2 networks. The cisco option uses whatever Cisco proprietary method is available. The nse option, which is the default, uses NSE messages to signal the switch. If nse is used, you can also configure the mgcp tse payload value.
- mgcp tse payload value Enables the use of in-band Telephony Signaling Events (TSE) and specifies a payload value. Both receiving and sending gateways must use the same value; the default is 100.
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: |
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
- nse signifies that NSEs will be used to signal the peer gateway to switch to fax passthrough.
- payload-type number specifies the number to assign to the NSE payload. The default is 100.
- codec is a required element, and you must specify either g711alaw or g711ulaw.
- redundancy enables the sending of two copies of each packet to mitigate packet loss.
- maximum-sessions sessions configures the maximum number of simultaneous passthrough sessions allowed. This option applies only if redundancy is also configured, and only under voice service configuration mode.
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:
- Both the originating and terminating gateways must be Cisco gateways.
- Both modems must be high-speed modemsV.34 or V.90and must use V.42bis compression.
- Error correction must be enabled on both modems.
- Modem relay is supported on both C5510 and C549 digital signal processors (DSP), and the DSPs must be set to either high or flex codec.
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
- nse tells the gateway to use NSE messages to signal the switch to modem relay.
- codec {g711alaw | g711ulaw} specifies the codec to be used for modem calls.
- redundancy enables the sending of two copies of each packet.
- gw-controlled specifies that modem relay configuration is done on the gateway instead of being controlled by the call agent.
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
- payload-type number sets the NSE payload type. The default is 100.
- codec {g711alaw | g711ulaw} sets the codec type for the modem relay calls.
- redundancy enables the sending of two copies of each packet.
- system is an option available only under dial peer configuration mode. It tells the gateway to use the globally configured type of modem relay for that dial peer.
- gw-controlled specifies that the gateway is controlling the modem relay parameters.
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
- payload-type number sets the NSE payload type. The default is 100.
- codec {g711alaw | g711ulaw} sets the codec type for the modem passthrough calls.
- redundancy enables the sending of two copies of each packet.
- maximum-sessions sessions configures the maximum number of simultaneous passthrough sessions allowed. This option applies only if redundancy is also configured, and only under voice service configuration mode.
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
|