Command:

chat-script


Mode:

Router(config)#


Syntax:

chat-script script-name expect send [expect1 send1]  [expect2 send2]...

no chat-script script-name

 

Syntax Description:

script-name

Name of the chat script.

expect send

Pairs of information elements: an item to expect and an item to send in response.

 


Command Description:

To create a script that will place a call over a modem, use the chat-script global configuration command. Use the no form of this command to disable the specified chat script. script-name is the name of the chat script to create, and expect-send represents pairs of information elements, an item to expect and an item to send in response. 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.

Chat Script Escape Sequences

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.


Example:

The following creates a chat script named "t3000". This chat script uses the special case script modifier ABORT keyword designate that the chat script has failed if the modem returns ERROR. The first expect-send pair ("" "ATZ") tells the router to expect nothing and issue the ATZ command. The next pair, (OK "ATDT \T") tells the router to expect the modem to return with OK. Once the router sees OK, it will issue the next command (ATDT \T). The special case script modifier TIMEOUT 30 sets the time to wait for the CONNECT string. The CONNECT \c defines when "connect" is seen the router does not send anything. (Note that \c is effectively nothing; " " would have indicated nothing followed by a carriage return). This defines the end of the chat-script. 

Router(config)#chat-script t3000 ABORT ERROR ABORT BUSY ABORT "NO ANSWER" "" "AT H" OK "AT DT \T"   DIALING \c TIMEOUT 30 CONNECT \c


Misconceptions:

 

None


Related Commands:

ppp pap

 

start-chat

 


� Cisco Systems, Inc. 2001, 2002, 2003
World Wide Education

Converted from CHM to HTML with chm2web Pro 2.85 (unicode)