Specifications
Creating and Using Modem Chat Scripts
Using Chat Scripts
DC-168
Cisco IOS Dial Technologies Configuration Guide
After the modem script is successfully executed, the system login script is executed. Table 18 lists the
functions that are executed with each expect-send pair in the system script called login.
System Login Scripts and Modem Script Examples
The following example shows the use of chat scripts implemented with the system-script and
modem-script options of the dialer map command.
If there is traffic for IP address 10.2.3.4, the router will dial the 91800 number using the usrobotics-v32
script, matching the regular expression in the modem chat script. Then the router will run the unix-slip
chat script as the system script to log in.
If there is traffic for 10.3.2.1, the router will dial 8899 using usrobotics-v32, matching both the modem
script and modem chat script regular expressions. The router will then log in using the cisco-compressed
script.
! Script for dialing a usr v.32 modem:
chat-script usrobotics-v32 ABORT ERROR "" "AT Z" OK "ATDT \T" TIMEOUT 60 CONNECT \c
!
! Script for logging into a UNIX system and starting up SLIP:
chat-script unix-slip ABORT invalid TIMEOUT 60 name: billw word: wewpass ">" "slip
default"
!
Table 17 Example Modem Script Execution
Expect and Send Pair Implementation
ABORT ERROR Ends the script execution if the text “ERROR” is found. (You can
have as many active abort entries as you like.)
“ ” “AT Z” Without expecting anything, sends an “AT Z” command to the
modem. (Note the use of quotation marks to allow a space in the
send string.)
OK “ATDT \T Waits to see “OK.” Sends “ATDT 96837890.”
TIMEOUT 60 Waits up to 60 seconds for next expect string.
CONNECT \c Expects “connect,” but does not send anything. (Note that \c is
effectively nothing; “ ” would have indicated nothing followed by
a carriage return.)
Table 18 Example System Script Execution
Expect and Send Pair Implementation
ABORT invalid Ends the script execution if the message “invalid username or
password” is displayed.
TIMEOUT 60 Waits up to 60 seconds.
name: username Waits for “name:” and sends username. (Using just “name:” will
help avoid any capitalization issues.)
word: password Waits for “word:” and sends the password.
“>” “slip default” Waits for the > prompt and places the line into Serial Line
Internet Protocol (SLIP) mode with its default address.