2 ###################################################################
4 # Script to dial the remote system, negotiate the connection, and send
5 # it the id. Then wait for the modem to disconnect. Reset the modem
6 # to answer mode and wait for the system to call back.
8 # The telephone number and modempass are used when establishing the
9 # connection to the modem.
12 MODEMPASS
=modem_identifier
14 # Once the modem calls back, the account name and password are used for
15 # a UNIX style login operation.
17 ACCOUNT
=my_account_name
20 ###################################################################
22 # Step 1. Dial the modem and negotiate the initial dialog.
23 # note: the modem is configured to ignore loss of DCD at this point.
24 # it is important that this be performed because the loss of DCD
25 # will normally prevent system from working since 'modem' is used
28 # The script is terminated normally when the carrier is lost.
33 ABORT
'\nNO ANSWER\r' \
34 ABORT
'\nRINGING\r\n\r\nRINGING\r' \
36 'OK-+++\c-OK' 'AT&C0&D2S0=0H0' \
43 if [ "$?" = "0" ]; then
45 ###################################################################
47 # Step 2. Wait for the call back from the remote. This will wait for at most
48 # 30 seconds for the call back should the first attempt fail or
49 # something happen with the callback logic at the remote.
51 # note: when the callback occurs, the DCD setting is re-enabled.
53 # If some voice call should happen during this period, the system will
54 # answer the telephone and then hang up on them. I realize that this is
55 # rude, but there is little that this script can do.
63 ogin
:--ogin: $ACCOUNT \
67 if [ "$?" = "0" ]; then
72 ###################################################################
74 # The script has failed. Terminate the connection mode.
76 chat
-v TIMEOUT
3 "" AT
'OK-+++\c-OK' 'AT&C1&D2S0=0H0' OK