[ LUGOS ] callback

Zlatko Rek zlatko.rek na fs.uni-lj.si
Pon Feb 9 14:53:19 CET 1998


> Ce pa na W95 gre potem bi skoraj na Linux-Linux tudi moralo, mar ne?
> Nekaj sva poskusala s kolegom, toda ni dovolj. Zatorej se enkrat
> vprasanje: kako urediti Callback za Linux-Linux sistem (oba RH4.0)
> (poklices na server, ta prekine povezavo poklice nazaj in vzpostavi PPP)?
> Ima kdo kako navodilo, kaj narediti na eni strani in kaj na drugi?


Na remote Linux-u:

1.) Instaliras mgetty in ppp

2.) V /etc/mgetty/login.config napises:

        callback      -       -       /usr/sbin/callback -S 

3.) Naredis userja callback:

       callback:*:1002:65534:CallBack account,,,:/:/bin/false

4.) Naredis userja ppp:

       ppp:******:1001:30:PPP client login,,,:/home/ppp:/usr/sbin/pppd

5.) v /home/ppp/.ppprc napises:

       -detach
       passive
       proxyarp
       modem
       crtscts
       :xxx.yyy.zzz.uuu <--- tvoja IP stevilka


Na local Linux-u:

1.) Instaliras ppp

2.) Napises chatscript (npr. /etc/ppp/chatscript):

###################################################################
#
# Step 1. Dial the modem and negotiate the initial dialog.
#         note: the modem is configured to ignore loss of DCD at this point.
#         it is important that this be performed because the loss of DCD
#         will normally prevent system from working since 'modem' is used
#         for pppd.
#
#         The script is terminated normally when the carrier is lost.
#
#

/usr/sbin/chat -v                                                   \
        ABORT                   'BUSY'                              \
        ABORT                   'VOICE'                             \
        ""                      'AT&C0&D2S0=0H0'                    \
        OK                      'ATX3DPxxxxxxx'                     \
        ogin                    'callback'                          \
        callback                'yyyyyyy'                           \
        "NO CARRIER"            ''

if [ "$?" = "0" ]; then


###################################################################
#
# Step 2. Wait for the call back from the remote. This will wait for at most
#         30 seconds for the call back should the first attempt fail or
#         something happen with the callback logic at the remote.
#
#         note: when the callback occurs, the DCD setting is re-enabled.
#
# If some voice call should happen during this period, the system will
# answer the telephone and then hang up on them. I realize that this is
# rude, but there is little that this script can do.
#
/usr/sbin/chat -v                           \
        TIMEOUT         '60'                \
        ABORT           'VOICE'             \
        RING            'AT&C1A'            \
        CONNECT         ''                  \
        ogin            'ppp'               \
        word            'tvoj_password'

  if [ "$?" = "0" ]; then
    exit 0
  fi
fi

###################################################################
#
# The script has failed. Terminate the connection mode.
#
/usr/sbin/chat -v TIMEOUT 3 "" AT 'OK-+++\c-OK' 'AT&C1&D2S0=0H0' OK
exit 1


3.) Pozenes ppp, npr.:

/usr/sbin/pppd connect /etc/ppp/chatscript /dev/modem 115200 crtscts
               defaultroute noipdefault

Lep pozdrav.

		Zlatko

______________________________________________________________

Dr. Zlatko Rek               |  Phone: +386 61 1771 200
Faculty of Mech. Engineering |         +386 61 1771 150
Lab. for Fl. Dyn. and Therm. |    Fax: +386 61 218 567
Askerceva 6                  | E-mail: zlatko.rek na fs.uni-lj.si
SI-1000 Ljubljana, SLOVENIA  |    WWW: http://www2.ijs.si/~rek
______________________________________________________________





Dodatne informacije o seznamu Starilist