Sample Cisco Configuration Script for onramp/offramp T.37 faxing

Below is a sample TCL Cisco Configuration Script for combined onramp/offramp T.37 faxing for integrated Cisco router 3725, IOS 12.4. The script might be slightly different (can be easily customised) for a different router model/IOS version.
In this sample config we assume a dedicated fax port, fax detection application is not used.
You can create as many dial-peers as many fax ports are available.
Please note that MGCP voice gateway is incompatible with T.37 fax gateway. Use SIP or H.323 voice gateway instead of MGCP gateway.

# Fax and mta config
application service faxmail_onramp flash:app_faxmail_onramp.
application service faxmail_offramp flash:app_faxmail_offramp.
fax receive called-subscriber $d$     # Setup CSI. Wildcard will be replaced by the To: field (see session target mailto below).
fax send transmitting-subscriber $s$   # Setup TSI. Wildcard will be replaced by the From: field (Master Email Address).
fax interface-type fax-mail
mta send server port 25        # Host name or IP address of facsBridge T37FSP machine
mta send with-subject both

# DSN notifications to offramp faxmail originator are sent by
# Fax Daemon from address configured below
mta send postmaster

# Inbound faxmail configured below is sent by Onramp mmoip from Fax (username@hostname)
mta send mail-from hostname
mta send mail-from username t37fsp

# Host name or IP address of your Cisco router
# Enter Cisco router host name from below into Faxmail Outbound Gateway field of
# facsBridge T37FSP Configuration application
mta receive aliases

# IP address of your Cisco router optionally enclosed in square brackets
# If using IP address, enter it into Faxmail Outbound Gateway field of
# facsBridge T37FSP Configuration application without square brackets
mta receive aliases []

# Number of maximum-recipients below should be equal to the number of the configured
# offramp pots dial-peers. The same number should be entered as
# Number of Devices field of facsBridge T37FSP Configuration application
mta receive maximum-recipients 1

# Onramp config - dial-peers and voice-port
dial-peer voice 1 pots
   service faxmail_onramp
   information-type fax
   incoming called-number 1234567
   port 1/0/0
   forward-digits all

dial-peer voice 11 mmoip
   service fax_on_vfc_onramp_app out-bound
   max-conn 1                                     # Equal to the number of onramp dial-peers
   destination-pattern 1234567
   information-type fax
   session target      # Onramp mmoip sends inbound faxmail to
   incoming called-number 1234567

# Offramp config - dial-peers
dial-peer voice 2 mmoip
   service faxmail_offramp
   max-conn 1                                      # The same as maximum-recipients above
   information-type fax
   incoming called-number .T

dial-peer voice 12 pots
   destination-pattern .T
   port 1/0/0

voice-port 1/0/0
   no vad
   cptone <your country code>                      # eg US, AU
   timeouts call-disconnect 1
   timeouts wait-release 2
   connection plar 1234567
   caller-id enable

Use telnet on (default) port 25 to check SMTP connectivity with Cisco fax gateway. If successful, SMTP server replies with code 220.

For T.37 gateway testing and troubleshooting, use debug mmoip send mail address command to generate an inbound faxmail, and debug mmoip send fax number command to initiate an outbound fax call.

Links on Cisco Routers T.37 Gateway Configuration

The most comprehensive resource is 'Fax, Modem, and Text for IP Telephony' by David Hanes and Gonzalo Salgueiro from Cisco Press.
Cisco Fax Services over IP - High Level Description
Cisco Fax Services over IP Application Guide - Detailed Description
Configuring Your Cisco IOS Gateway for T.37 On-Ramp and Off-Ramp Fax Support
Outbound Gateway Configuration or in PDF format
and Inbound Gateway Configuration (If you are planning to use T37FSP, you can skip Cisco Unity references in those links)