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] FaxDispatch logic help



Quoting Chris Taylor <chris.taylor@xxxxxxxxxxxxx>:

Jason Staudenmayer wrote:
I've been search for some examples but I'm not finding many.
I'm finally setting up my dispatch script and so far I'm just using a case for SENDER. What I'd like to do is also route other faxes by CIDNUMBER.
I just want to make sure that no faxes are lost or double emails are send. Below is what I have so far:


case $SENDER in

*305*243*5662*) SENDTO="health@xxxxxxxxxxxxx";;

*) SENDTO=faxin@xxxxxxxxxxxxx;;


esac


case $CIDNUMBER in

*215*368*1960*) SENDTO="rigan@xxxxxxxxxxxxxxx";;

*) SENDTO=faxin@xxxxxxxxxxxxx;;

esac

My question is do I only need the catch-all in the last case or should each case have it?

Every different case needs the *) entry.

No. If you add a catch-all to every case (and all the cases are used to set the SENDTO variable), only the last case block will actually work as the catch-all entry will replace any value set by a previous case block.


You should only put a catch-all entry in the first block (or set the SENDTO default value before all the case block and don't set any catch-all entry). You should also put the blocks from lowest priority to highest. i.e. if a fax matches an entry in both SENDER and CIDNUMBER, the entry of the last block will replace the entry set in the first block.


-- Patrice Fournier iFAX Solutions, Inc. www.ifax.com

____________________ 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