2.3 Modem Configuration
2.3.10 Chat-scripts for async lines

Because asynchronous modems are not standard, you must write custom chat-scripts to perform certain tasks. Chat-scripts are used for the following tasks:

  • Modem configuration

  • Dialing and remote login commands

  • Failure detection

A chat-script is a string of text that defines the handshaking that occurs between two DTE devices, or between a DTE and its directly attached DCE device. It consists of expect-send pairs that define both the string that the local system expects to see from the remote device and the reply that the local system should send:

(config)#chat-script script-name expect-string send-string

For example, you can configure chat-scripts for the following tasks:

  • Initializing the directly attached modem

  • Instructing the modem to dial out

  • Logging in to a remote system

The following is a sample chat-script command and the Table that describes it:

(config)#chat-script Reno ABORT ERROR ABORT BUSY "" "ATZ" OK "ATDT \T" TIMEOUT 30 CONNECT \c

Modem-script versus System-script
Chat-scripts are used as modem-scripts or system-scripts. Modem-scripts are used from DTE to DCE, whereas system-scripts are sent DTE to DTE.

In the following example, the script called Niagara is used between the router and the modem to successfully handshake with the destination. The Gambling script is used for logging between the router and an end-system at the destination; the script called Niagara is used for dialing a modem:

chat-script Niagara ABORT ERROR "" "AT Z" OK "ATDT \T" TIMEOUT 30 CONNECT \c
!
! Script for logging into a system called Gambling and starting up slip session:
chat-script Gambling ABORT invalid TIMEOUT 15 name: billw word: wewpass ">" "slip default"
!
Interface async 5
dialer map ip 172.16.12.17 modem-script Niagara system-script Gambling 918005551212

You can manually start a chat-script on any asynchronous line that is not currently active by using the start-chat command, or you can configure chat-scripts so they are executed for specific events, such as the following:

  • Line activation-Triggered by incoming traffic (Carrier Detect signal going up)

  • Connection-Triggered by outgoing traffic (for example, reverse Telnet)

  • Line reset-Triggered by async line reset

  • Startup-Triggered by access server startup

  • Dialer-Triggered by dial-on-demand routing (DDR)

Start-chat: Manual Start of Chat-script
If you wish to manually start a chat-script on a line, you can use the
start-chat privileged EXEC command.

Router#start-chat regexp [line-number [dialer-string]]

This command provides modem-dialing commands for a chat-script that you want to apply immediately to a line. If you do not specify a line, the script runs on the current line. If the specified line is already in use, the script is not activated, and an error message appears.

The argument regexp is used to specify the name of the modem script that is to be executed. The first script that matches the argument in this command and the dialer map command will be used.