This section contains chat scripts that you can use as a reference for creating your own chat scripts. The modem manufacturer's guide and information from your ISP and other target hosts contain chat requirements for the modem and your target peers. In addition, numerous PPP web sites have sample chat scripts.
The following is a basic chat script that you can use as a template for creating your own chat scripts.
ABORT BUSY ABORT 'NO CARRIER' REPORT CONNECT TIMEOUT 10 "" AT&F1M0&M5S2=255 SAY "Calling myserver\n" TIMEOUT 60 OK "ATDT1-123-555-1212" ogin: pppuser ssword: \q\U % pppd |
Script Contents |
Explanation |
---|---|
ABORT 'NO CARRIER' |
Abort transmission if the modem reports ABORT 'NO CARRIER' when dialing. The cause for this message is usually a dialing or modem negotiation failure. |
REPORT CONNECT |
Gather the CONNECT string from the modem and print it out. |
TIMEOUT 10 |
Set initial timeout to 10 seconds. The modem's response should be immediate. |
"" AT&F1M0&M5S2=255 |
M0 - Turn off the speaker during connect. &M5 - Make the modem require error control. S2=255 - Disable the TIES "+++" break sequence. |
SAY "Calling myserver\n" |
Display the message "Calling myserver" on the local machine. |
TIMEOUT 60 |
Reset the timeout to 60 seconds to allow more time for link negotiation. |
OK "ATDT1-123-555-1212" |
Call the remote peer by using the phone number 123-555-1212. |
ogin: pppuser |
Log in to the peer by using UNIX-style login. Supply the user name pppuser. |
ssword: \q\U |
\q - Do not log if debugging with the -v option. \U - Insert the contents of the string that follows -U, which is specified on the command line (usually the password) here. |
% pppd |
Wait for the % shell prompt, and run the pppd command. |
Solaris PPP 4.0 includes the /etc/ppp/myisp-chat.tmpl, which you can modify for use at your site. /etc/ppp/myisp-chat.tmpl is similar to the basic modem chat script except that it does not include a login sequence.
ABORT BUSY ABORT 'NO CARRIER' REPORT CONNECT TIMEOUT 10 "" "AT&F1" OK "AT&C1&D2" SAY "Calling myisp\n" TIMEOUT 60 OK "ATDT1-123-555-1212" CONNECT \c |
Script Contents |
Explanation |
---|---|
ABORT BUSY |
Abort transmission if the modem receives this message from the opposite peer. |
ABORT 'NO CARRIER |
Abort transmission if the modem reports ABORT 'NO CARRIER' when dialing. The cause for this message is usually a dialing or modem negotiation failure. |
REPORT CONNECT |
Gather the CONNECT string from the modem and print it out. |
TIMEOUT 10 |
Set initial timeout to 10 seconds. The modem's response should be immediate. |
"" "AT&F1" |
Reset the modem to factory defaults. |
OK "AT&C1&D2" |
Reset the modem so that, for &C1, DCD from the modem follows carrier. If the remote side hangs up the phone for some reason, then the DCD drops. For &D2, DTR high-to-low transition causes the modem to go on-hook (hang up). |
SAY "Calling myisp\n" |
Display the message "Calling myisp" on the local machine. |
TIMEOUT 60 |
Reset the timeout to 60 seconds to allow more time for link negotiation. |
OK "ATDT1-123-555-1212" |
Call the remote peer by using the phone number 123-555-1212. |
CONNECT \c |
Wait for the CONNECT message from the opposite peer's modem. |
Use the next chat script as a template for calling an ISP from a dial-out machine with a US Robotics Courier modem.
ABORT BUSY ABORT 'NO CARRIER' REPORT CONNECT TIMEOUT 10 "" AT&F1M0&M5S2=255 SAY "Calling myisp\n" TIMEOUT 60 OK "ATDT1-123-555-1212" CONNECT \c \r \d\c SAY "Connected; running PPP\n" |
The following table describes the contents of the chat script.
Script Contents |
Explanation |
---|---|
ABORT BUSY |
Abort transmission if the modem receives this message from the opposite peer. |
ABORT 'NO CARRIER' |
Abort transmission if the modem receives this message from the opposite peer. |
REPORT CONNECT |
Gather the CONNECT string from the modem and print it out. |
TIMEOUT 10 |
Set initial timeout to 10 seconds. The modem's response should be immediate. |
"" AT&F1M0M0M0M0&M5S2=255 |
M0 - Turn off the speaker during connect. &M5 - Make the modem require error control. S2=255 - Disable the TIES "+++" break sequence. |
SAY "Calling myisp\n" |
Display the message "Calling myisp" on the local machine. |
TIMEOUT 60 |
Reset the timeout to 60 seconds to allow more time for link negotiation. |
OK "ATDT1-123-555-1212" |
Call the remote peer by using the phone number 123-555-1212. |
CONNECT \c |
Wait for the CONNECT message from the opposite peer's modem. |
\r \d\c |
Wait until the end of the CONNECT message. |
SAY "Connected; running PPP\n" |
Display the informative message "Connected; running PPP" on the local machine. |
The next chat script is a basic script that is enhanced for calling a remote Solaris peer or other UNIX-type peer. This chat script is used in "How to Create the Instructions for Calling a Peer".
SAY "Calling the peer\n" TIMEOUT 10 ABORT BUSY ABORT 'NO CARRIER' ABORT ERROR REPORT CONNECT "" AT&F1&M5S2=255 TIMEOUT 60 OK ATDT1-123-555-1234 CONNECT \c SAY "Connected; logging in.\n" TIMEOUT 5 ogin:--ogin: pppuser TIMEOUT 20 ABORT 'ogin incorrect' ssword: \qmypassword "% " \c SAY "Logged in. Starting PPP on peer system.\n" ABORT 'not found' "" "exec pppd" ~ \c |
Starting PPP right after the CONNECT \c is often called a PAP login by ISPs, though the PAP login is actually not part of PAP authentication.
The phrase ogin:--ogin: pppuser instructs the modem to send the user name, in this example pppuser, in response to the login prompt that is received from the dial-in server. pppuser is a special PPP user account name that was created for remote user1 on the dial-in server. For instructions on creating PPP user accounts on a dial-in server, refer to "How to Configure Users of the Dial-in Server".
The following chat script is for calling from a dial-out machine with a ZyXEL omni.net. ISDN TA.
SAY "Calling the peer\n" TIMEOUT 10 ABORT BUSY ABORT 'NO CARRIER' ABORT ERROR REPORT CONNECT "" AT&FB40S83.7=1&K44&J3X7S61.3=1S0=0S2=255 OK ATDI18882638234 CONNECT \c \r \d\c SAY "Connected; running PPP\n" |
The following table explains the parameters of the chat script.
Refer to thechat(1M) man page for descriptions of options and other detailed information about the chat script. For an explanation of expect-send strings, refer to "UUCP Chat Script Field".
A number of web sites offer sample chat scripts and assistance in creating them.
The PPP Frequently Asked Questions (FAQ) available from Australian National University posts URL.