faxspool and JOB file
Sascha Ziemann (szi@khs-ag.de)
02 Sep 1999 1916:34:11 +0200
Hi,
I am working on a Samba-Mgetty gateway. In order to be able to send a
winpopup message to the client, when the fax has successfully send, I
need the IP address of the client in the fax-success program. The
fax-success program gets only the JOB file, so the information has be
stored there, but faxspool has no option to store custom data in the
JOB file. In order to extend the JOB file I have patched faxspool and
added a -j option that can be used to add custom fields to the JOB
file. This is the patch:
----------------------------------------------------------------------
--- faxspool.orig Thu Sep 2 16:28:59 1999
+++ faxspool Thu Sep 2 16:29:07 1999
@@ -348,6 +348,7 @@
TIME=""
copy_source=""
job_priority=""
+ADDITIONAL_JOB_DATA=""
#
# get command line arguments (overriding some of the values above)
@@ -471,6 +472,14 @@
# copy source file (for "some action" when transmission fails)
-c) copy_source=TRUE; shift
;;
+# add some additional fields to the JOB file
+ -j) if [ -n "$ADDITIONAL_JOB_DATA" ] ; then
+ ADDITIONAL_JOB_DATA="$ADDITIONAL_JOB_DATA
+"
+ fi
+ ADDITIONAL_JOB_DATA="${ADDITIONAL_JOB_DATA}$2 $3"
+ shift ; shift ; shift
+ ;;
# unknown options
-*) $echo "unknown option: $1" >&2
$echo "$usage" >&2
@@ -935,6 +944,9 @@
[ -z "$ACCT_HANDLE" ] || \
$echo "acct_handle $ACCT_HANDLE" >>$job.q
+
+[ -z "$ADDITIONAL_JOB_DATA" ] || \
+ $echo "$ADDITIONAL_JOB_DATA" >>$job.q
mv $job.q $job
----------------------------------------------------------------------
Sascha