ITEM: F0631L

Help wanted with spools, backends, and faxes...




Question:

I am trying to set up a queue which will use a backend to initiate the
visifax program.  I might want it to call a "fx -n" so that I can send
it to a spool so that instead of it going to lp0, that it would go to
the fx program.

The customer's situation is that they have an application that they wish
to be able to fax from using V Systems VSI*FAX software; however, this
application does NOT provide a way to do this directly.  What the customer
would like to do is trick their application into thinking it was printing
when the job would actually go to a fax queue.  His faxes always go to
just a few numbers, so he has tried setting up a queue for each site with
the correct command to fax to each phone number.  What he has tried to do
is replace the backend piobe with /usr/vsifax/bin/fx -n\.  I am
not sure if you can put parameters like -n into the qconfig like this. I
suggested that it was sort of redundant to have the qdaemon take this
queued up job and then put it into a second queue from the fax program. I
tried to come up with an alias since the application just does a 
system(); call to enqueue the print job.  I tried to alias

alias "enq -P faxqueue"="fx -n\"

but this did not work since a multi-argument alias name is not valid in
ksh.

Response:

Explained how backends work, how the qdaemon kicks off the backend.

The fax program, /usr/vsifax/bin/fx, needs at least the -n argument
for a phone number.

Since the qdaemon sets the argv[1] parameter of the backend to the
fully-qualified pathname of the spooled file, a user-written C
backend would have access to the file to be faxed.  The user-written
backend could generate the fx command that needs to be executed, then
use either execl or the system subroutine to execute the command.

In either case, the output of an lpstat command will probably not
reflect percentages and such once the backend is running.

Response:

Customer called and told me that he got his C program written and plugged
into the backend in the qconfig file.  When he tries to run 'lp fx1'
he gets a message from the qdaemon : could not open stats file.

Response:

Customer called in and I explained how to implement this in a 'C' program
using the "system" call.  He was asking how to use a pipe in a 'C' program
used in a backend.  I gave him an example of:

        char command[128];

        sprintf(command,"whatever you want");
        system(command);

Response:

Customer called back in.  I stepped him through the coding.  The following
is what we ended up putting:

        char command[128];

        sprintf(command,"/bin/cat /tmp/header /tmp/mainfile | fx -n1234567");
        system(command);

Where /tmp/header is the file that contained a special escape sequence in
it and /tmp/mainfile is the main file to be faxed.  The fx -n1234567 is
the command to fax out and it faxes to 123-4567.  The system command can
contain pipes and works as if you were actually typing it on the command
line, however, you should include paths.


Support Line: Help wanted with spools, backends, and faxes... ITEM: F0631L
Dated: December 1993 Category: N/A
This HTML file was generated 99/06/24~13:30:52
Comments or suggestions? Contact us