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] Another FaxDispatch script problem

Actually SENDTO gets set the first time but when the script continues 
SENTO gets overwritten with the other case block's default.

-----Original Message-----
From: Willy Offermans [mailto:Willy@xxxxxxxxxxxxxxxxxxx] 
Sent: Monday, December 17, 2007 2:17 PM
To: Caleb Walker
Cc: hylafax-users@xxxxxxxxxxx
Subject: Re: [hylafax-users] Another FaxDispatch script problem

Hello Caleb,

On Mon, Dec 17, 2007 at 01:56:33PM -0800, Caleb Walker wrote:
> I have a script that has a "case" block that identifies faxes using 
> the "SENDER" variable and another that identifies by the "CALLID1" 
> variable. The script seems to set SENDTO correctly the first time but 
> then the script continues to the next case and sets then to the 
> default.  How do I tell the first case to exit once it finds a match 
> instead of continuing on to the next case block?  Is there anything 
> easy to do or do I have to make some if/then decisions to do this?
> Looks like this if I didnt explain myself correctly, of course the 
> email@xxxxxxxxx's are actually different email addresses but you get 
> the
> point:
> case "$SENDER" in
>     *6666666666*)       SENDTO=email@xxxxxxxxx;;
>     *GEORGIA*PACIFIC*)  SENDTO=email@xxxxxxxxx;;
> esac
> case "$CIDNUMBER" in
>     6666666666)         SENDTO=email@xxxxxxxxx;;
>     6666666666)         SENDTO=email@xxxxxxxxx;;
>     6666666666)         SENDTO=email@xxxxxxxxx;;
>     6666666666)         SENDTO=email@xxxxxxxxx;;
>     *)                  SENDTO=email@xxxxxxxxx;;
> esac

To my opinion you have two options:

either you test if SENDTO is set after the first case and only process 
the second case if SENDTO is empty (if SENDTO empty then case 
"$CIDNUMBER" in ...). I would also set SENDTO="" before the case 
structure to be sure it works as expected, unless SENDTO is already set 
before ...

It might be also possible to change the order of the cases, first test 
for CIDNUMBER and set to default if not found and secondly overwrite 
this if SENDER is known. However this option really depends on what you 
want and could still be erroneous. So check if it works.

Met vriendelijke groeten,
With kind regards,
Mit freundlichen Gruessen,
De jrus wah,


W.K. Offermans
Home:   +31 45 544 49 44
Mobile: +31 653 27 16 23
e-mail: Willy@xxxxxxxxxxxxxxxxxxx

                                       Powered by ....

                                           \/  \ ^


____________________ 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