Technical information

EVENT NOTIFY PROCEDURES
115
Examples
This shell script logs all fax attempts that actually use phone time to an accounting file. The script assumes that all
users put an account number in thetg1 user tag.
#!/bin/sh
# tnp-site.sh
REQID=$1
eval `$VSIFAX/lbin/vfaxreq -F eval $REQID`
if [ $nat -gt 0 ] # nat is >0 if an attempt was made
then
ACCFILE=/usr/vsifax/fax.log
# accountno:request-id:time:elapsed:phonenum
echo "$tg1:$req:$stm:$ela:$tfn" >>$ACCFILE
fi
exit 0
Group notify procedures (GNPs)
Syntax
Site and user GNPs are called directly from the system GNP. The system GNP passes the following arguments to the
site and user GNPs:
$1
Unique request-ID for this fax. Same as Group-ID.
$2
VSI-FAX user ID who submitted the fax request.
$3
Notification email address specified by the sender.
$4
Time this fax attempt was submitted.
$5
Notification mode specified by the sender. Values are:
none Never notify
ok Notify on success
fail Notify on failure
both Always notify
each Notify on each attempt
$6
Unique group fax request ID. Same as Request-ID
$7
Total number of recipients (members) in this group.
$8
Total number of recipient (member) faxes successfully sent.
$9
Total number of recipient (member) faxes that failed.
$10
Any user GNP specified.
Examples
This shell script generates a verbose log file for a group fax job:
#!/bin/sh
# gnp-site.sh
#
REQID="$1"
CLIENTID="$2"
MAILADDR="$3"