Vgetty - custom script

Josh (josh2@marvin.albury.net.au)
Thu, 03 Dec 1998 14:54:32 +1100


Hi there.
I am having trouble getting vgetty to run a script.
Version 1.1.19 Nov 24, FreeBSD2.2.7 and a 
"Netcom RoadsterII Ultra" (a Rockwell based) modem.
It seems to go OK if I dont use a script but when I
try to run my own script it all falls down. It picks
the phone up but I get silence and the log (see
below) says it couldn't communicate. If anyone wants
more info please ask as I would love to help you
help me :-)

Any help or advice appreciated!

Josh


start of script custsprt.sh
--------------------------------------------------------------------------
#! /usr/local/bin/vm shell


##! /bin/sh NOTE. Same happens no matter how its invoked
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#
# This is a demo script
#

#
# Define the function to receive an answer from the voice library
#

function receive
     {
     read -r INPUT <&$VOICE_INPUT;
     echo "$INPUT";
     }

#
# Define the function to send a command to the voice library
#

function send
     {
     echo $1 >&$VOICE_OUTPUT;
     kill -PIPE $VOICE_PID
     }

#
# Let's see if the voice library is talking to us
#

ANSWER=`receive`

if [ "$ANSWER" != "HELLO SHELL" ]; then
     echo "$0: voice library not answering" >&2
     exit 1
fi

#
# Let's answer the message
#

send "HELLO VOICE PROGRAM"

#
# Let's see if it worked
#

ANSWER=`receive`

if [ "$ANSWER" != "READY" ]; then
     echo "$0: initialization failed" >&2
     exit 1
fi

#
# Set the device
#

send "DEVICE DIALUP_LINE"

#
# Let's see if it worked
#

ANSWER=`receive`

if [ "$ANSWER" != "READY" ]; then
     echo "$0: could not set output device" >&2
     exit 1
fi

#
# Let's send demo.rmd if it exists
#

if [ -f hello4 ]; then
     send "PLAY hello4"

     #
     # Let's see if it works
     #

     ANSWER=`receive`

     if [ "$ANSWER" != "PLAYING" ]; then
          echo "$0: could not start playing" >&2
          exit 1
     fi

--------------------------------------------------------------------------


extract from log /var/log/vgetty.cuaa1
---------------------------------------------------------------------------
12/03 14:28:06 aa1  vgetty: Executing shell script /var/spool/voice/custsprt.sh
with shell /bin/sh
12/03 14:28:06 aa1    vgetty: opening pipes
12/03 14:28:06 aa1    vgetty: forking shell
12/03 14:28:06 aa1   vgetty(0): HELLO SHELL
12/03 14:28:06 aa1    vgetty: Got pipe signal
12/03 14:28:06 aa1    vgetty: queued event SIGNAL_SIGPIPE at position 0004
12/03 14:28:06 aa1    vgetty: unqueued event SIGNAL_SIGPIPE at position 0004
12/03 14:28:06 aa1    vgetty: voice_handle_event got event SIGNAL_SIGPIPE with d
ata <
12/03 14:28:06 aa1   shell(1): cuaa1
12/03 14:28:06 aa1  vgetty: cannot initialize communication!
12/03 14:28:06 aa1  vgetty: Could not handle event, something failed
--
12/03 14:28:06 aa1  vgetty: experimental test release 0.9.1 / 17Nov98
12/03 14:28:06 aa1  mgetty: experimental test release 1.1.19-Nov24
12/03 14:28:06 aa1  reading generic configuration from config file /usr/local/et
c/mgetty+sendfax/voice.conf
12/03 14:28:06 aa1  reading program vgetty configuration from config file /usr/l
ocal/etc/mgetty+sendfax/voice.conf
12/03 14:28:06 aa1   reading /usr/local/etc/mgetty+sendfax/voice.conf...
12/03 14:28:06 aa1   conf lib: read: 'part generic'
----------------------------------------------------------------------------


----------------------------------
E-Mail: Josh <josh2@marvin.albury.net.au>
Date: 03-Dec-98   19  
Time: 14:54:32

This message was sent by XFMail
----------------------------------