1) Using "cu", "kermit", or other means, login into the remote UNIX
machine.
2) Exec a program or a shell script saying "callback"; the "callback"
should perform the following tasks:
- Logout your current terminal session, hang up the phone line, put the
originating modem in the listen mode, and set the proper TTY bits mode
to be used as a dial-out port.
- Wait a couple seconds, clear the phone line, and dial the phone number
the user provided.
- Do an "exec /bin/login" to respawn a login session.
Here is a short example of "callback" in a C Shell script. You may need to
fool with the "stty -hupcl" command; do not hang up the modem on the last
close. This example assumes that the remote modem is a Hayes or
Hayes-compatible modem.
#! /bin/csh
if ($#argv != 1) then
echo "Usage: callback YourHomePhoneNumber"
exit
endif
set user=`whoami`
set number=$argv[1]
grep "$number" /usr/adm/callback.phones > /dev/null
if ($status == 1) then
if ($user != root) then
echo 'You are not allowed to use dialback because your phone'
echo 'number can not be found in the dialout-phone list.'
echo 'Please check the number and try it again.'
exit
endif
endif
# verify if it is a login shell
set pid=`ps -u$user |grep -c csh`
if ($pid[1] != 2) then
echo "not login shell, pid=$pid"
exit
endif
onintr we-are-back
set nohup
stty -hupcl -echo intr ^C
echo "Please hang up the phone. Or just turn the modem OFF and ON"
echo "I'll call you back in about 20 second."
sleep 15
echo -n x | tr "x" ""
sleep 2
echo -n x | tr "x" ""
sleep 2
echo -n x | tr "x" ""
sleep 4
echo -n "ATDT $number"
sleep 4
echo $*
# While you're waiting, log the usage of this script.
set dt=`date`
echo $dt[2-4] $user ' ' $* >> /usr/adm/callback.log
sleep 20
unset nohup
we-are-back:
stty hupcl echo
echo "HIT <Control-C>"
The above script has been tested and worked between a Macintosh SE (running
MacTerminal) and an A/UX 1.0 system. You can modify it if it doesn't work
on your system.