Technical information

EVENT NOTIFY PROCEDURES
121
set DEVICE [lindex $argv 0]
set REASON [lindex $argv 1]
set VSIFAX $env(VSIFAX)
set TIMESTAMP [ clock format [ clock seconds ] -format {%Y/%m/%d %H:%M:%S} ]
set ERROR "Device $DEVICE failed: $REASON"
set EMAIL email@address.com
#-------------------------------------------------------
# Update log file
#-------------------------------------------------------
set f [ open $VSIFAX\\spool\\logs\\devfail a+ ]
puts $f "$TIMESTAMP $ERROR"
close $f
#-------------------------------------------------------
# Create email file
#-------------------------------------------------------
set g [ open $VSIFAX\\spool\\temp\\devfail w+ ]
puts $g "$TIMESTAMP $ERROR"
close $g
#-------------------------------------------------------
# Email notification to specified mail address
#-------------------------------------------------------
exec "$VSIFAX\\lbin\\vmime" -t -s $ERROR "$VSIFAX\\spool\\temp\\devfail" | \
"$VSIFAX\\lbin\\vmail" -R $EMAIL $EMAIL
file delete "$VSIFAX\\spool\\temp\\devfail"
#--------------------------------------------------------
# Issue command to re-enable fax device
#-------------------------------------------------------
exec "$VSIFAX\\bin\\vfxadmin" disable $DEVICE
exec "$VSIFAX\\bin\\vfxadmin" enable $DEVICE
exit 0
User-change notification script
Syntax
The sys-usrchg procedure processes changes in the user database. These arguments are passed to sys-usrchg
:
$1
ClientID changed
$2
Type of change (add, delete, or update)
Example for Unix and Linux platforms
The shell script below runs on Unix and Linux platforms only (not on Windows platforms).
This sample sends an email notification whenever the user database is changed:
# -----------------------------------------------
# process changes in the user database
#
clientid=$1
action=$2
$VSIFAX/lbin/vmime -t -s "user database change" <<-EOF |
The following user database change has been made:
$action $clientid