To create a script that will place a call over a modem, use thechat-script global configuration command. Use the no form of this command to disable the specified chat script.
chat-script script-name expect-send
no chat-script script-name expect-send
script-name  Name of the chat script.
expect-send  Pairs of information elements: an item to expect and an item to send in response.
No chat scripts are defined.
Global configuration
Release | Modification | 10.0 | This command was introduced. |
---|
Chat scripts are used in dial-on-demand routing (DDR) to give commands to dial a modem and commands to log on to remote systems. The defined script will be used to place a call over a modem.
Some characteristics of chat scripts are as follows:
We recommend that one chat script (a "modem" chat script) be written for placing a call and another chat script (a "system" or "login" chat script) be written to log on to remote systems, where required.
A suggested chat script naming convention is as follows:
vendor-type-modulation
If you follow this convention, the syntax of the chat-script command becomes the following:
chat-script vendor-type-modulationexpect-send
For example, if you have a Telebit T3000 modem that uses V.32bis modulation, you would name your chat script as follows:
telebit-t3000-v32bis
The chat-script command could become the following:
chat-script telebit-t3000-v32bis ABORT ERROR ABORT BUSY ABORT "NO ANSWER" "" "AT H" OK "AT DT \T" DIALING \c TIMEOUT 30 CONNECT \c
For example, you could have script names like the following:
Adhering to this naming convention allows you to use partial chat script names with regular expressions to specify a range of chat scripts that can be used. This capability is particularly useful for dialer rotary groups and is explained further in the next section.
Chat scripts are in the form expect-send , where the send string following the hyphen (-) is executed if the preceding expect string fails. Each send string is followed by a return unless it ends with the escape sequence \c . The sequence ^x is translated into the appropriate control character, and the sequence \x is translated into x if \x is not one of the special sequences listed in Table 4.
See the book entitled Managing uucp and Usenet by Tim O'Reilly and Grace Todino for more information about chat scripts.
The escape sequences used in chat scripts are listed in Table 4.
Escape Sequence | Description |
" " | Expect a null string. |
EOT | Send an end-of-transmission character. |
BREAK | Cause a BREAK. This sequence is sometimes simulated with line speed changes and null characters. May not work on all systems. |
\c | Suppress new line at the end of the send string. |
\d | Delay for 2 seconds. |
\K | Insert a BREAK. |
\n | Send a newline or linefeed character. |
\p | Pause for 1/4 second. |
\r | Send a return. |
\s | Send a space character. |
\t | Send a table character. |
\\ | Send a backslash (\) character. |
\T | Replaced by phone number. |
\q | Reserved, not yet used. |
Sample supported expect-send pairs are described in Table 5.
Expect and Send Pair | Function |
ABORT string | Designates a string whose presence in the input indicates that the chat script has failed. |
TIMEOUTtime | Sets the time to wait for input, in seconds. The default is 5 seconds. |
For example, if a modem reports BUSY when the number dialed is busy, you can indicate that you want the attempt stopped at this point by including ABORT BUSY in your chat script.
If you use the expect-send pair ABORT SINK instead of ABORT ERROR, the system terminates abnormally when it encounters SINK instead of ERROR.
After the connection is established and you press the Return key, you must often press Return a second time before the prompt appears.
For example, you might include the following as part of your chat script:
ssword:-/r-ssword
This part of the script specifies that, after the connection is established, you want ssword to be displayed. If it is not displayed, you must press Return again after the timeout passes.
The following example shows the chat-script command being used to create a chat script named t3000 :
chat-script t3000 ABORT ERROR ABORT BUSY ABORT "NO ANSWER" "" "AT H" OK "AT DT \T" DIALING \c TIMEOUT 30 CONNECT \c
Command | Description |
---|---|
dialer map | Configures a serial interface or ISDN interface to call one or multiple sites or to receive calls from multiple sites. |
script dialer | Specifies a default modem chat script. |
Printed for apswan@ctr.ap.nic.in on Wed Mar 5 22:32:57 PST 2003
All material in this document copyright 2000 Cisco Systems, Inc. All rights reserved. No material may be reproduced or distributed without written permission of Cisco Systems, Inc.