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] Replace faxsend program



Hi Atis,

good to hear you got it working.

Still, let me answer your questions
1)
> So, how are you returning this? I tried from php - "exit(2)" and bash
> "exit 2", also tried combining with re-writing job file with new
> "state:2" line.

I'm using perl script and do normal exit with value
"exit JOB_ERROR;"
while JOB_ERROR is defined as conatant
use constant {
    JOB_RETRY => 0,
    JOB_ERROR => 1,
    JOB_DONE => 2,
    JOB_REFORMAT => 3,
};

In fact, this worked for me quite good. I did not need any bit shift, thought.

2)
those FIFO.xxx problem
i have no IAX modem running now
in init script, just after  faxq is started, i do 
"faxmodem modem01"
this makes faxq proces aware of the modem, so that faxq can use it for scheduling jobs.
To see that modem in faxstat output, i created a fifo file in top of FAXSPOOL 
FIFO.modem01
with these access rights
prw------- 1 uucp uucp    0 Aug  6 15:51 FIFO.modem01
and created empty config file 
etc/config.modem01
-rw-r--r-- 1 uucp uucp 0 Aug  6 15:51 etc/config.modem01
modem status is written into it's status file
status/modem01
-rw-r--r-- 1 uucp uucp 24 Aug 12 17:57 ../status/modem01

faxstat then displays contents of the status/modem01 file as staus of the modem.
So my custom script my_faxsend.pl then updates contents of the status file depending on processing.
In this way faxstat display modem status in manner i want it.
And hylafax do not use any real modem, nor IAX modem.

Thank you and wish you a nice day
Tomas



------------ Původní zpráva ------------
Od: Atis Lezdins <atis@xxxxxxxxxxx>
Předmět: Re: [hylafax-users] Replace faxsend program
Datum: 13.8.2008 02:04:34
----------------------------------------
On Tue, Aug 12, 2008 at 9:53 PM, Atis Lezdins <atis@xxxxxxxxxxx> wrote:
> Hi Tomas,
>
> I've been playing around with SendFaxCmd, and stepped on several
> problems. Perhaps You or anybody else can help to clarify.
>
>>
>> my "my_faxsend" testing script is very simple - just sleep for some 25 sec
and then return.
>> depending on return value, faxq handles the job
>>   return 0 - retry - faxq reschedules the job for later retransmission
>>   return 1 - failed - faxq moves qfile from sendq to doneq and mark it as
completed-failed
>>   return 2 - done - faxq moves qfile from sendq to doneq and mark it as
completed-done
>>   return 3 - reformat - faxq reschedules the job for later retransmission
>
> This is most confusing part. It's working fine with default command,
> however return value of my script gots translated wrong. If i return
> 2, in log i see
>
> CMD DONE: exit status 0x200
>
> which means it's bit-shifted. Ok, that would be fine, but
> faxQueueApp::sendJobDone expects bit shifted result as it comes from
> waitforpid(), however that is never processed. Instead req->status is
> initialized to 0, and job gets into "retry" state.
>
> So, how are you returning this? I tried from php - "exit(2)" and bash
> "exit 2", also tried combining with re-writing job file with new
> "state:2" line.
>
> Finally i just come to solution of adding this line within
> faxQueueApp::sendJobDone
>
> req->status = (FaxSendStatus) WEXITSTATUS(status);
>
> Perhaps you use another Hylafax version? I initially tried some 4.x
> and then latest Hylafax+ 5.2.7.

Ok, i figured this out, and to help archives, here's what was necessary:

from custom faxsend script replace line "result:0" to necessary result
in fax job file.

This would also allow send multiple faxes in one execution of faxsend.

Regards,
Atis

>
>> I also have a fifo "FIFO.virtual" and empty modem config file
"etc/config.virtual"
>> With these files, hfaxd and faxstat are also aware of the virtual modem, so
in "faxstat -s" output,
>> modem status is visible -> modem status can be changed in "my_faxend" script
as well
>> having these lines in "my_faxsend"
>
> This is also confusing. I couldn't create just FIFO to make Hylafax
> accept it, "faxstat -s" would require device with the same name to
> exist. However i left my IAXmodems running, so Hylafax thinks it's
> sending trough IAXmodems, when it uses my script instead.
>
>
>> A note to faxmodem command - when you issue a "faxmodem ttyIAX01", all it
does is send a special message to faxq process via it's FIFO pipe.
>
> This is where i see the same FIFO problem again. Have you tried
> removing all IAXmodems? ;)
>
>>
>> Hope the stuff is not very confusing ;-(
>> Let me know if you'll anything more
>
> Well, this was a great guide, thanks for help :)
>
> Btw, also to answer Bodo's question:
>
>> I'm just curious:
>> Why do you need HylaFAX when you don't have a phone line?
>> Wouldn't it be better to use some other software that directly uses
>> "scp" to transmit your documents?
>
>> Although replacing "faxsend" works, it is a bit difficult. In addition
>> to returning the right exit code you should modify the counters in the
>> job file, otherwise you might get wrong page count or wrong number of
>> retries in your result messages.
>
> For example we have large Hylafax installation, lot of people have
> installed different printer->hylafax drivers on various systems. It's
> really great how Hylafax allows all that and generates TIFF file.
> However in my case i wasn't able to make T38modem working with our
> provider, so i'm writing virtual modem which will send resulting TIFF
> trough fax mechanism within CallWeaver.
>
> Regards,
> Atis
>
>
> --
> Atis Lezdins,
> VoIP Project Manager / Developer,
> atis@xxxxxxxxxxx
> Skype: atis.lezdins
> Cell Phone: +371 28806004
> Cell Phone: +1 800 7300689
> Work phone: +1 800 7502835
>



-- 
Atis Lezdins,
VoIP Project Manager / Developer,
atis@xxxxxxxxxxx
Skype: atis.lezdins
Cell Phone: +371 28806004
Cell Phone: +1 800 7300689
Work phone: +1 800 7502835


____________________ 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*





Tomáš Novosad
mailto:kbbl@xxxxxxxx
jabber:kbbl@xxxxxxxxx
+420737309887
# rm -rf /*


____________________ 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