[Asterisk-Users] fax - conversion problem
Brian May
bam at snoopy.apana.org.au
Wed Oct 19 02:33:52 MST 2005
>>>>> "asterisk" == asterisk <asterisk at frameweb.it> writes:
asterisk> The problem is in the tiff2ps, not in the ps2pdf. I
asterisk> found that if I remove the -h and -w parameter
asterisk> everything is OK
My computer has a tiff2pdf command (from the libtiff-tools Debian
package), so I can do everything in one command:
--- /usr/local/sbin/mailfax ---
#!/bin/sh -e
FAXFILE="$1"
RECIPIENT="$2"
FAXSENDER="$3"
REMOTESTATIONID="$4"
FAXPAGES="$5"
FAXRESOLUTION="$6"
if [ ! -f "$FAXFILE" ]
then
echo "Fax $FAXFILE not found" >&2
exit 1
fi
tiff2pdf -pA4 "$FAXFILE" |
mime-construct --to "$RECIPIENT" --subject "Fax from $FAXSENDER" \
--attachment fax.pdf --type application/pdf --file -
--- cut ---
I am not sure of the -pA4 option, but I don't know enough about FAX
standards to change it - it might be better to set the resolution with
-r depending on the FAXRESOLUTION parameter. I did a web search on the
resolution for the different modes, and got numerous different answers
for the same thing :-(.
Oh, and this is called with:
[fax]
exten => s,1,Macro(faxreceive)
exten => h,1,system(/usr/local/sbin/mailfax "${FAXFILE}" "${EMAILADDR}" "${CALLERIDNUM}" "${REMOTESTATIONID}" "${FAXPAGES}" "${FAXRESOLUTION}")
[macro-faxreceive]
exten => s,1,SetVar(FAXFILE=/var/spool/asterisk-fax/${UNIQUEID}.tif)
exten => s,2,SetVar(EMAILADDR=postmaster at microcomaustralia.com.au)
exten => s,3,rxfax(${FAXFILE})
--
Brian May <bam at snoopy.apana.org.au>
More information about the asterisk-users
mailing list