The chatscript file is used by the chat application during the PPP
authentication process. The chatscript basically emulates what a
user would type if he/she were to dialup in a terminal.

Some optional special characters used in the chatscript are as
follows:

	\d	- Wait for 1 second.
	\c	- Don't send a carriage return
	\q	- Don't _x_ password.
	\\	- Send a backslash '\'.

The chatscript file's layout is in A-B expect sequence form. This means
that the script will wait for A then send B. For example:

	""     "AT"

This means wait for nothing and send AT. This would be used to initialize
the modem device with an init string.

The chatscript file layout also has the A-B-C form of the expect sequence
meaning that it is to expect A, if A does not arrive, send B and then
expect C. The layout of the A-B-C expect sequence is:

	"RX_STRING-TX_STRING-RX_STRING"     "TX_STRING"

For example:

	"OK-\d\d+++\d\d\c-OK"    "ATH0"

This means wait for 'OK', if it doesn't arrive, wait for two seconds.
Send '+++' and wait for two seconds and don't send a carriage return.
Wait for 'OK', if OK is received, send 'ATH0'.

The following is an example of a chatscript with comments about what the
script is doing:


# ***************************************************************************
#/etc/ppp/chatscript
# ***************************************************************************
# The following lines indicate conditions for chat quitting.

ABORT "NO CARRIER"
ABORT "NO DIALTONE"
ABORT "ERROR"
ABORT "NO ANSWER"
ABORT "BUSY"
ABORT "Username/Password Incorrect"

# ***************************************************************************
# This line means - expect OK, if it does not arrive, wait two seconds,
# send +++, wait for two more seconds and then do not send a carriage
# return. Finally again wait for OK again. If it arrives, send ATH0
# The +++ is in case your modem has not hung up. You may want to know if
# your modem is not hanging up, if so, remove this whole line.

""                      "AT"
'OK-\d\d+++\d\d\c-OK'   "ATH0"

# ***************************************************************************
# These are various controls sent to my particular modem.
# The &F, &D3, and M1 seem to be quite generic for setting the modem
# with factory defaults,  allowing the DTR line to reset the modem
# (Used when pppd shuts down), and M1 allows the speaker on while the
# call is being established, but off after the remote system answers.
# USR/3COM Sportster modems require &F1 instead of &F.
# Note that a backslash must be doubled to get through. This sequence 
# should also always be enclosed in single quotes because of the
# special characters like &.\,#.

OK      "AT&F&D3M1"

# ***************************************************************************
# Since pppd tries to hang up the modem by switching the DTR line to
# the modem, the modem must be set up to reset the modem when this occurs.
# The modem will eventually hang itself up if pppd stops, but it takes a
# while (a minute or so at times). thus it is useful (but not crucial)
# that you set up your modem to use the DTR line to reset the modem. You
# must look up the command in your documentation for your modem. For the
# three different modems I have, the command is &D3 (Reset modem on ON to
# OFF transition of DTR).

OK      "AT&D3"

# ***************************************************************************
# Again the A-B-C, except the middle B to be sent if ogin: is not
# received is nothing except a carriage return. The \q in the password
# will prevent the password from being logged. The \q is optional.

OK              "ATD8765432"
CONNECT         ""
"ogin:--ogin:"  "^Uuser_name"
"word:"         "\qpassword"

# ***************************************************************************