Configuring a server to callback a client is desirable for companies who
want the phone bill charged to their account versus the client (employee)
who may be in a hotel room where long-distance rates are high.
You must first configure mgetty to work as a regular dialin server and a
regular dialin PPP server before you configure the callback procedures.
After the PPP server is running well, you are ready to procede with the
callback configuration.
Server Configuration
To enable callback on a server, you have to edit only two files. First
create a file /etc/mgetty+sendfax/callback.conf and we leave it empty.
Next we edit /etc/mgetty+sendfax/login.conf and add line:
call - - /usr/sbin/callback - S 123456
Where call is a pseudo-user needed to initiate the connection. The line in
the login.conf puts in motion the program calling the given number (in this
case it's 123456). The same procedures can be applied to other users. When
we call a server, it asks us to give verification. We login as pseudo-user,
in this case it calls the script in our computer hangs up the modem.
We wait and the connection is cut off. The program call-back starts working
and recalls us. We verify ourselves again as pppuser with password. We
combine the connection and interface ppp.
Workstation (client) Configuration
The configuration of workstations is very simple. When you have MS Windows,
you have to install dial-up for your number. In the modem properties we add
into the extra options field:
&c0s0=1
For a Microsoft Windows client to authenticate the call, you must understand
how dialup scripting works (and how to add the script option to the dialup
networking connection). Add the following code to the dialup networking
connection's script:
proc main
delay 1
waitfor "ogin:"
transmit "call^M"
waitfor "RING"
transmit "ATA^M"
waitfor "CONNECT"
waitfor "ogin:"
transmit "pppuser^M"
waitfor "word:"
transmit "ppp^M"
endproc
Notice that after the login prompt in the script above, we use the word
"call" and then wait for the modem to return the "RING" command. The word
call corresponds to word call in the login.conf file. Had we used any other
word in the login.conf file, we would have used it in the script above.
Since the terminal waits for the modem to return the "RING" command, the
server must have hung-up on us. The script is waiting for the serve to
call back so that it can continue the script and authenticate.
For a linux client to authenticate the callback, add the following lines
to the option file (you may use a modem specific options file such as
options.ttyS1):
lock
defaultroute
noipdefault
modem
33600
crtscts
debug
passive
asyncmap 0
The dialing script:
#!/bin/bash
killall -INT pppd 2>/dev/null
rm -f /var/lock/LCK* /var/run/ppp*.pid
(/usr/sbin/pppd -detach call ppp_call &) || exit 1
exit 0
Use the following chatscript to initiate the first call:
TIMEOUT 5
ABORT 'ERROR'
ABORT 'BUSY'
ABORT 'NO ANSWER'
ABORT 'NO DIALTONE'
ABORT '\nVOICE\r'
ABORT '\nRINGING\r\n\r\nRINGING\r'
'' AT&FH0 'OK-+++\c-OK' 'AT&C0S0=1'
TIMEOUT 40
OK ATDT5376443 CONNECT ''
ogin:-ogin: ppp-pseudo-user
'\nNO CARRIER\r' ''
TIMEOUT 180
'\nRING\r' AT&C1A
CONNECT ''
TIMEOUT 20
ogin:-ogin: pppuser
sword:-sword password_for_ppuser