[asterisk-users] SendFax: not setting the fax header

Ruben Rögels ruben.roegels at jumping-frog.org
Thu Jun 30 06:38:48 CDT 2011


Hello,

after I solved my problem with the fax processing after receiving,
I got another problem while sending a fax: the header is not set properly.

I use a PHP_Script to upload a PDF file and to generate a call file.

A bash script is looking for existent call files in the web directory
and moves
them the asterisk's outgoing directory.

Ok, my call file looks like this:

======
$cf_commands = "Channel: local/$ext at common\n"
                      ."MaxRetries: 5\n"
                      ."RetryTime: 60\n"
                      ."WaitTime: 60\n"
                      ."Context: fax\n"
                      ."Extension: 100\n"
                      ."Set: FAXFILE=$file_dst\n"
                      ."Set: FAXOPT(localstationid)=$_POST[mynumber]\n"
                      ."Set: FAXOPT(headerinfo)=$_POST[mynumber]
$_POST[myname] $_POST[myemail]\n"
                      ."";
======

As you can see, I set the LOCALHEADERINFO to string I got from a web form.


My fax extension for sending fax looks like that:

======
[fax]
exten => 100,1,System(/usr/local/bin/pdf2fax.sh ${FAXFILE})
exten => 100,n,Wait(1)
exten => 100,n,Verbose(${BOUNDARY} ${FAXOPT(localstationid)}
${FAXOPT(headerinfo)})
exten => 100,n,Verbose(${BOUNDARY} ${FAXFILE})
exten => 100,n,SendFAX(${FAXFILE}converted)
exten => 100,n,Verbose(1,###       FAXSTATUS: ${FAXSTATUS})
exten => 100,n,Verbose(1,###        FAXERROR: ${FAXERROR})
exten => 100,n,Verbose(1,###         FAXMODE: ${FAXMODE})
exten => 100,n,Verbose(1,###        FAXPAGES: ${FAXPAGES})
exten => 100,n,Verbose(1,###      FAXBITRATE: ${FAXBITRATE})
exten => 100,n,Verbose(1,###   FAXRESOLUTION: ${FAXRESOLUTION})
exten => 100,n,Verbose(1,### REMOTESTATIONID: ${REMOTESTATIONID})
exten => 100,n,HangUp()
======

The Verbose() application shows to me that ${FAXOPT(headerinfo)} is
correctly set,
but the headerinfo is not appearing on the fax itself...
It's not important if I set FAXOPT(headerinfo) or LOCALHEADERINFO, the
result is always the same: no header on the fax received.

I even tried to set FAXOPT(headerinfo) directly in the fax extension:
same result: no header on the fax...

Console output:
======
-- Executing [100 at fax:3] Verbose("CAPI/ISDN1#02/12345-b",
"############### Ruben Roegels ruben.roegels at jumping-frog.org") in new stack
############### Ruben Roegels ruben.roegels at jumping-frog.org
-- Executing [100 at fax:4] Verbose("CAPI/ISDN1#02/12345-b",
"###############
/var/www/webfax/out/13094318919d62dbef2f0516c87cba828a4e52b6267537f313")
-- Executing [100 at fax:5] SendFAX("CAPI/ISDN1#02/12345-b",
"/var/www/webfax/out/13094318919d62dbef2f0516c87cba828a4e52b6267537f313converted")
in new stack
======

Again: Anyone seeing what I'm missing?

Thank you very much.

Regards,
Ruben



More information about the asterisk-users mailing list