HylaFAX The world's most advanced open source fax server

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [hylafax-users] Faxrcvd and FaxDispatch routing based on MSN number



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Johan de Vries schrieb:

> I have a Debian 504 (lenny)  installation with Hylafax 6.0.4 and a
> Dialogic Diva BRi-2  card
> 
> Also the capi4hylafax and DIVAS4LINUX are installed

Hello Johan,

I strongly recommend to use Dialogic's TTY interface instead of capi4hylafax.

> I want to route the incoming faxes to a mailbox based on the incoming
> MSN number
[...]

> Apr 14 12:15:15.29: [ 4826]: Fax received and calling
> '/var/spool/hylafax/bin/faxrcvd "recvq/fax000000007.tif" "faxCAPI"
> "000000016" "" "        +31725751758" "" "3"'.

My faxrcvd script on Debian contains this:

 FILE="$1"; shift;
 DEVICE="$1"; shift;
 COMMID="$1"; shift;
 MSG="$1"; shift;
 COUNT=1
 while [ $# -ge 1 ]; do
     # The eval has $1 set yet, and this forces a variable-to-variable
     # assignment, allowing us to not need to do escaping
     eval CALLID$COUNT='$1'
     export CALLID$COUNT
     shift
     COUNT=`expr $COUNT + 1`
 done
 CIDNUMBER="$CALLID1"
 CIDNAME="$CALLID2"
 DESTINATION="$CALLID3"

In your example this means
FILE="recvq/fax000000007.tif"
DEVICE="faxCAPI"
COMMID="000000016"
MSG=""
CIDNUMBER=CALLID1="        +31725751758"
CIDNAME=CALLID2=""
DESTINATION=CALLID3="3"

(I'm not sure, but variable DESTINATION might be a Debian specific extension.)

> As far as I understood from the archives this number is called: $SUBADDR
> in Hylafax 

On my system faxrcvd does not contain SUBADDR.

> My FaxDispatch file is:
> 
> FILETYPE=pdf;
> 
> case "$SUBADDR" in

I think you should use

case "$DESTINATION" in

> 2)          SENDTO=email1@xxxxxxxxxx;;
> 
> 3)          SENDTO=email2@xxxxxxxxxx;;
> 
> esac


> In the Faxrcvd file there was nothing mentioned about the $SUBADDR
>
> So I added the lines:
>
> SENDER="`$INFO $FILE | $AWK -F: '/Sender/ { print $2 }' 2>$ERRORSTO |
> $SED 's/^.//'`"
>
> SUBADDR="`$INFO $FILE | $AWK -F: '/SubAddr/ { print $2 }' 2>$ERRORSTO |
> $SED 's/^.//'`"
[...]
You should you check the output of a manual call to "$INFO $FILE" to see if it contains what you are trying to find.


> How can I do some logging / tailing on the Faxrcvd and FaxDispatch to
> see what happens ?

exec >/tmp/faxrcvd.log 2>&1
set -x
date
echo "$0" "$@"


> Is it possible to show the MSN number in the header of the received fax
> ( like the CallID1 and CallID2  lines )  ?

I think this would require some image manipulation in facrcvd or FaxDispatch.


Bodo
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkvM39MACgkQnMz9fgzDSqcKvwCfbDpJtE7sbBDVqwkZ8Z6/LbBa
IpUAn2V54gsPdW4xzAEDpsxsmaUPqeEs
=mgBF
-----END PGP SIGNATURE-----


____________________ HylaFAX(tm) Users Mailing List _______________________
  To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi
 On UNIX: mail -s unsubscribe hylafax-users-request@xxxxxxxxxxx < /dev/null
  *To learn about commercial HylaFAX(tm) support, mail sales@xxxxxxxxx*




Project hosted by iFAX Solutions