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 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.

> 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


____________________ 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