background image
Chat Scripts to Control Modem Connections 85
Reasons for Using a Chat Script
As a CCNP or CCDP, you should be aware that chat scripts are used for the following goals:
·
Initialization--To initialize the modem
·
Dial string--To provide the modem with a dial string
·
Logon--To log in to a remote system
·
Command execution--To execute a set of commands on a remote system
Reasons for a Chat Script Starting
A chat script can be manually started on a line using the start-chap command; they can also be
configured to start for the following events:
·
Line activation--CD trigger (incoming traffic)
·
Line connection--DTR trigger (outgoing traffic)
·
Line reset--Asynchronous line reset
·
Startup of an active call--Access server trigger
·
Dialer startup--From a dial-on-demand trigger
Using a Chat Script
The primary use of a chat script is to provide the dial number for the connection. The following
line shows an example of this chat script:
Router(config)#chat-script REMDEVICE ABORT ERROR ABORT BUSY "" "ATZ" OK "ATDT \T"
TIMEOUT 30 CONNECT \c
Care should be taken with the character case used in this command. ABORT ERROR and
ABORT BUSY cause the modem to abort if it sees ERROR or BUSY. Both arguments might
be easier understood if read as "abort if you see ERROR" and "abort if you see BUSY,"
respectively. If error or abort are entered in lowercase, the modem never sees these conditions
because its search is case-sensitive. The \T inserts the called number from the dial string or
map command into the chat script. A \t causes the script to look for a "table character"; hence,
case is important here as well.
NOTE
Detailed information on the dial string and map commands are provided in Chapter 6.
The REMDEVICE chat script has been configured to drop the connection if the modem
declares a busy or error condition. If no busy or error condition is declared, the router does not