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] How to archive outgoing faxes



here is a part of my hacked notify.awk which calls a function
to execute system() perl scripts stored in the hylafax/bin directory.

hope this will help,

	franck.


# notify.awk
...
# a function to create a header on the sent faxes
# and to insert the header in a postgresql database
# logger is there to verbose...

function ackheader(jobid,status,receiver,aheader)
{
	system("bin/logger \"docq/doc" jobid " status:" status " receiver:" receiver " [" number "]\"" );
	system("bin/ackheader docq/doc" jobid " \" - job: " jobid " - status: " status " - To: " receiver "  [" number "]\"  --  " );
	system("bin/insert doneq/q" jobid );
}

...

function putHeaders(subject)
{
     print "To: " mailaddr;
     print "Subject: " subject;
     print "";
     printf "Your " jobType " job to " company " : " receiver " (" number ") ";
}

BEGIN 
	{ nfiles = 0;
		  npins = 0;
		  pagewidth = 0;

...<cut>...

/^doneop/ 
{ doneop = $2; }
/^number/ 
{ number = $2; }

# <frbn 15/05/02> I need this in my header

	/^receiver/	{ receiver = $2; }
	/^company/	{ company = $2; }

# </frbn 15/05/02>

/^external/ 
{ number = $2; }		# override unprocessed number
/^sender/ 
{ sender = $2; }
/^mailaddr/ 
{ mailaddr = $2; }

...<cut>...

/^page:/ 
{ pins[npins++] = $4; }
/^[!]page:/   { pagernum = $4; }
/^data:/ 
{ files[nfiles++] = $4; }
/^poll/ 
	{ poll = " -p"; }
END {

	# *** HERE I CALL MY FUNCTION ***
	ackheader(jobid,why,receiver,number);
	#</frbn 28/06/02>

     if (jobtag == "")
	jobtag = jobType " job " jobid;;
     if (doneop == "default")

...<cut>...

# end


milend wrote:
> Hi,
> thank you for the help!
...
> I want to do something similar with sent faxes too.
> 
> Unfortunately in "notify" and "notify.awk" scripts I do not see the name 
> of the file that is sent.
> I couldn't figured out where can i get the file name and
> what is the file format (PS or TIFF).(I do not understand AWK script 
> very well)


> So could you please send me a little bit more information on how you 
> solve the problem?
> Could you please send me a short example!
> Thank you in advance!
> 
> Best regards:
> Milen


____________________ 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@hylafax.org < /dev/null
  *To learn about commercial HylaFAX(tm) support, mail sales@hylafax.org.*




Project hosted by iFAX Solutions