Fax Detection for SIP Call and Transfer

The fax detection feature detects whether an inbound call is from a fax machine. If the inbound call is from a fax machine, the call is rerouted appropriately.

Restrictions for Fax Detection for SIP Call and Transfer On Cisco IOS XE

  • The Fax Detect feature is only supported with routers fitted with DSP modules.

  • Only the g711ulaw and g711alaw codecs can be used for detecting fax CNG tone.

  • Each destination number can be of a maximum length of 32 characters.

  • Fax Detection is only supported with LTI-based transcoding.

Information About Fax Detection for SIP Call and Transfer

Fax detection is typically used if you need to have a single phone number for both voice and fax services. Incoming calls are initially answered by an auto attendant or interactive voice response (IVR) service. At this point, the media stream is monitored for fax tones. Calls identified as coming from a fax machine are then rerouted to a new destination, such as a fax server.

For Fax detection to work, the cng-fax-detect command under DSP farm and the detect-fax command must be configured in the inbound dial-peer. The fax detection feature may be configured to redirect calls to a local voice port or a remote application.


Note


Fax detection on CUBE is also supported through a TCL script. The script answers an incoming call, plays a prompt and makes an outgoing voice or fax call. You can download the TCL script from the CiscoDevNet Github.


Local Redirect Mode

Local redirect may be used to transfer a fax call to either a local port or remote destination. Multiple destinations may be used if required, allowing the CUBE to hunt for the first available resource. The configured hunt list can include any number of destination ports.

Figure 1. Local Redirect Call Flow

An initial connection is made as a voice call through CUBE to the IVR. On detection of fax tones in the media path, CUBE closes the connection to the IVR, then hunts through a list of numbers to establish a connection to a fax machine or fax server, allowing the originating fax machine to complete its transmission. In a scenario where T.38 is not supported by CUBE, it will fallback to passthrough.

For each call, a digital signal processor (DSP) channel is allocated to detect the fax CNG tone. This DSP remains allocated until the original call leg clears at the end of the call. In the call flow example above, the first fax machine is busy, so the CUBE establishes the call with the second fax machine.


Note


For Local Redirect, new calls legs are negotiated as voice, not as fax session.


Refer Redirect Mode

In this mode, calls are redirected to a fax service by the original calling party. The redirect is based on information provided by CUBE in a SIP Refer message (similar to a blind transfer).

In this mode, only one redirection target can be configured.

Figure 2. Refer Redirect Call Flow

An initial connection is made as a voice call through CUBE to the IVR. On detection of fax tones in the media path, CUBE closes the connection to the IVR. To transfer the call, CUBE first sends a re-invite to put the original call leg on hold, then sends a SIP REFER with details of the remote fax server. From this point, CUBE is no longer involved in the call flow as the originating fax communicates directly with the destination server.

For each call, a DSP channel or resource is allocated to detect the CNG tone. This resource is released once the call transfer has been initiated.

Transcoder Behavior for Cisco IOS XE

For the fax tone detection support offered for Cisco IOS XE, the DSP resource behavior for local and refer redirect is as follows:

  • For local redirect, CUBE doesn’t release the transcoder until the fax call disconnects.

  • For refer redirect, CUBE releases the transcoder when the REFER message is sent to the peer leg.

Fax Detection with Cisco IOS XE High Availability

Fax detection and transfer are supported with CUBE High Availability (HA) deployments. In this mode, two CUBE routers are configured to run in Active-Standby mode.

The following behaviors specific to this feature must be noted:

  • Failover after initial call has been established, but fax hasn’t been detected—The call is preserved, but tone detection is not available for the remainder of that call. The originating fax machine terminates the call after CNG time-out.

  • Failover after fax detection, but before the transferred call leg is established—The initial call is preserved and the transfer fails. The originating fax machine terminates the call after CNG time-out.

How to Configure Fax Detection for SIP Calls

Configure DSP Resource to Detect Fax Tone

SUMMARY STEPS

  1. enable
  2. configure terminal
  3. dspfarm profile tag transcode universal
  4. cng-fax-detect
  5. maximum sessions sessions
  6. asociate application CUBE
  7. end

DETAILED STEPS

  Command or Action Purpose

Step 1

enable

Example:


Device> enable

Enables privileged EXEC mode.

  • Enter your password if prompted.

Step 2

configure terminal

Example:


Device# configure terminal

Enters global configuration mode.

Step 3

dspfarm profile tag transcode universal

Example:


Device(config)# dspfarm profile 5 transcode universal

Enters DSP farm profile configuration mode and enables the profile for transcoding.

Step 4

cng-fax-detect

Example:


Device(config-dspfarm-profile)# cng-fax-detect

Enables CNG tone detection.

Step 5

maximum sessions sessions

Example:


Device(config-dspfarm-profile)# maximum sessions 6

Configures maximum number of sessions.

Step 6

asociate application CUBE

Example:


Device(config-dspfarm-profile)# associate application CUBE

Configures an application to the profile for LTI-based transcoding.

Step 7

end

Example:


Device(config-dspfarm-profile)# end

Returns to privileged EXEC mode.

Dial-peer Configuration to Redirect Fax Call

SUMMARY STEPS

  1. enable
  2. configure terminal
  3. dial-peer voice number voip
  4. description tag
  5. session protocol sipv2
  6. incoming called number number
  7. voice-class codec tag
  8. no vad
  9. detect-fax [mode { refer number | local number } ]
  10. end

DETAILED STEPS

  Command or Action Purpose

Step 1

enable

Example:


Device> enable

Enables privileged EXEC mode.

  • Enter your password if prompted.

Step 2

configure terminal

Example:


Device# configure terminal

Enters global configuration mode.

Step 3

dial-peer voice number voip

Example:


Device(config)# dial-peer voice 401 voip

Enters dial peer configuration mode for the specified VoIP dial peer.

Step 4

description tag

Example:


Device(config-dial-peer)# description Incoming dial-peer for Fax

Provides a description for the incoming dial-peer for Fax.

Step 5

session protocol sipv2

Example:


Device(config-dial-peer)# session protocol sipv2

Configures SIP as the session protocol type.

Step 6

incoming called number number

Example:


Device(config-dial-peer)# incoming called-number 903309

Creates inbound dial-peer.

Step 7

voice-class codec tag

Example:


Device(config-dial-peer)# voice-class codec 111

Applies the previously configured voice class and associated codecs to a dial peer. The voice class codec can only include g711ulaw and g711alaw.

Step 8

no vad

Example:


Device(config-dial-peer)# no vad

Disables voice activity detection (VAD) for the calls using the dial peer being configured.

Step 9

detect-fax [mode { refer number | local number } ]

Example:


Device(config-dial-peer)# detect-fax refer 12101

Defines fax detection as local or refer mode and refers to the directory number of the fax machine.

If local mode is configured, then a list of numbers, separated by a space may be entered. Refer mode only allows a destination number to be configured.

Step 10

end

Example:


Device(config-dial-peer)# end

Returns to privileged EXEC mode.

Verifying Fax Detection for SIP Calls

SUMMARY STEPS

  1. enable
  2. show call active voice compact
  3. show dspfarm dsp active

DETAILED STEPS


Step 1

enable

Example:

Device> enable 
          

Enables privileged EXEC mode.

Step 2

show call active voice compact

Example:

This is a sample output of call setup when the call is connected:

Device# show call active voice compact 

       <callID>  A/O FAX T<sec> Codec     type     Peer Address       IP R<ip>:<udp>
	      Total call-legs: 3
          	9    ANS   T4      g711ulaw    VOIP        P808808      9.42.25.145:17940
        		10    ORG   T4      g711ulaw    VOIP        P309903      9.42.25.149:16396
        		11    ANS   T4      g711ulaw    VOIP        P808808      9.42.25.149:16394
          

Step 3

show dspfarm dsp active

Example:

This is a sample output of the DSP channel reserved to detect CNG tone after the call is set up.

Device# show dspfarm dsp active 

           SLOT   DSP VERSION  STATUS CHNL USE   TYPE    RSC_ID BRIDGE_ID PKTS_TXED PKTS_RXED
	           0      2   36.1.0   UP     1   USED  xcode    1      9         228       119      
	           0      2   36.1.0   UP     1   USED  xcode    1      10        113       251      
 	    Total number of DSPFARM DSP channel(s) 1
          

Troubleshooting Fax Detection for SIP Calls

You can enable the logs of the following debug or show commands, which are helpful in debugging fax detection for SIP calls:

  • debug voip ipipgw all

  • debug ccsip verbose

  • debug voip ccapi all

  • debug voip dsmp all

  • debug voip hpi all

  • debug media resource provisioning all

  • show call active voice compact

  • show dspfarm dsp active

  • show voip rtp connections

Configuration Examples for Fax Detection for SIP Calls

Example: Configuring Local Redirect

The following is a sample configuration in local redirect mode for fax detection. In this example, the dial-peer has to be configured for the FAX directory numbers 9033010 and 9033011.


dspfarm profile 10 transcode universal  
 codec g729abr8
 codec g729ar8
 codec g711alaw
 codec g711ulaw
 codec g729r8
 codec ilbc
 codec g722-64
 cng-fax-detect
 maximum sessions 6
 associate application CUBE
!
dial-peer voice 401 voip
 description "Incoming dial-peer to ASR"
 session protocol sipv2
 incoming called-number 903309
 voice-class codec 111  
 dtmf-relay rtp-nte
 no vad
 detect-fax mode local 9033010 9033011 

dial-peer voice 406 voip
 description "Outbound dialpeer for ..."
 destination-pattern 9033010
 session protocol sipv2
 session target ipv4:9.41.36.11:14762
 voice-class codec 111  
 dtmf-relay rtp-nte
 fax protocol pass-through g711ulaw
 no vad

dial-peer voice 406 voip
 description "Outbound dialpeer for ..."
 destination-pattern 9033011 
 session protocol sipv2
 session target ipv4:9.41.36.11:14765
 voice-class codec 111  
 dtmf-relay rtp-nte
 fax protocol pass-through g711ulaw
 no vad

Example: Configuring Refer Redirect

In Refer mode, only one fax number can be configured.



dial-peer voice 401 voip
 description "Incoming dial-peer to ASR"
 session protocol sipv2
 incoming called-number 903309
 voice-class codec 111  
 dtmf-relay rtp-nte
 no vad
 detect-fax mode refer 9033010 

dial-peer voice 406 voip
 description "Outbound dialpeer for ..."
 destination-pattern 9033010
 session protocol sipv2
 session target ipv4:9.41.36.11:14762
 voice-class codec 111  
 dtmf-relay rtp-nte
 fax protocol pass-through g711ulaw
 no vad

Feature Information for Fax Detection for SIP Call and Transfer

The following table provides release information about the feature or features described in this module. This table lists only the software release that introduced support for a given feature in a given software release train. Unless noted otherwise, subsequent releases of that software release train also support that feature.

Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to https://cfnng.cisco.com/. An account on Cisco.com is not required.
Table 1. Feature Information for Fax Detection for SIP Call and Transfer

Feature Name

Releases

Feature Information

Fax Detection for SIP Call and Transfer

Cisco IOS 15.4(2)T

Fax detection is the capability to detect automatically whether an incoming call is voice or fax. For calls coming from an IP trunk to CUBE, the Fax Detection for SIP Call and Transfer feature is used to detect CNG tones (calling tones) so that the fax server can handle the actual fax transmission or redirect the fax call to a configured fax number.

The following commands were introduced: cng-fax-detect and detect-fax mode .

Fax Detection for SIP Call and Transfer on Cisco IOS XE Platforms

Cisco IOS XE Amsterdam 17.2.1r

Support was introduced for SIP call and transfer for IP-to-IP calls on Cisco IOS XE platforms for Cisco Unified Border Element.