|
On the default incoming context for your zap or whatever
cards
exten => fax,1,Goto(fax,s,1)
then make this context
[macro-faxreceive]
exten => s,1,SetVar(FAXFILE=/var/spool/asterisk/fax/${TIMESTAMP}) exten => s,2,DBGet(EXTMAIL=${MACRO_EXTEN}/xEmail) exten => s,3,NoOP() exten => s,4,DBGet(EXTNAME=${MACRO_EXTEN}/xName) exten => s,5,NoOP() exten => s,6,rxfax(${FAXFILE}.tif) exten => s,103,SetVar(EXTMAIL=EMAIL-WHERE-TO-SEND-FAXES) exten => s,104,Goto(3) exten => s,105,SetVar(EXTNAME=Anton Krall) exten => s,106,Goto(5) [fax]
exten => s,1,Macro(faxreceive) exten => h,1,System(/usr/local/bin/mailfax.sh "${CALLERIDNUM}" "${CALLEDFAX}" "${EXTNAME}" "${EXTMAIL}" "${FAXFILE}") also make a mailfax.sh script file that does the processing
and conersion to pdf like this for example:
#!/bin/bash Hope this helps... works great for me.echo Received paramters $1 $2 $3 $4 $5 >>/var/log/faxmail.log DATETIME=`date +"%A %d %b %Y %H:%M"` if [ -e $5.tif ] then echo fax file $5.tif found. Sending email to $4 .... >>/var/log/faxmail.log PAGES=$(tiffinfo $5.tif | grep "Page") DT=$(tiffinfo $5.tif | grep "Date") COUNT=${PAGES#*-} rm -f $5.txt /usr/bin/tiff2ps -2eaz -w 8.5 -h 11 $5.tif > $5.ps /usr/bin/ps2pdf $5.ps $5.pdf echo "Estimado $3," >>$5.txt echo "" >>$5.txt echo "Acaba de recibir un fax. A continuacion se muestran los detalles:" >>$5.txt echo "" >>$5.txt echo "De : $1" >>$5.txt echo "Para : $2" >>$5.txt echo "Fecha : $DATETIME" >>$5.txt echo "Paginas : $COUNT" >>$5.txt echo "" >>$5.txt echo "" >>$5.txt echo "Intruder Consulting PBX" >>$5.txt echo sendEmail -f INSERT-FROM-EMAIL -t $4 -u "New fax received" -a $5.pdf >> /var/log/faxmail.log echo "<<<<<<<<<<<<<<<<<<<<---------------->>>>>>>>>>>>>>>>>>>>>>>>>" >> /var/log/faxmail.log /usr/local/bin/sendEmail -q -f INSERT-FROM-EMAIL -t $4 -u "Nuevo Fax Recibido" -a $5.pdf -m < $5.txt rm -f $5.* else rm -f $5.txt echo "Estimado $3," >>$5.txt echo "" >>$5.txt echo "Recibimos una llamada que parecia ser un fax, sin embargo, ningun fax fue recibido. A continuacion se muestran los det alles:" >>$5.txt echo "" >>$5.txt echo "De : $1" >>$5.txt echo "Para : $2" >>$5.txt echo "Fecha : $DATETIME" >>$5.txt echo "Paginas : $COUNT" >>$5.txt echo "" >>$5.txt echo "" >>$5.txt echo "Intruder Consulting PBX" >>$5.txt echo sendEmail -f INSERT-FROM-EMAIL -t $4 -u "New fax received" -a $5.pdf >> /var/log/faxmail.log echo "<<<<<<<<<<<<<<<<<<<<---------------->>>>>>>>>>>>>>>>>>>>>>>>>" >> /var/log/faxmail.log /usr/local/bin/sendEmail -q -f INSERT-FROM-EMAIL -t $4 -u "Recepcion Erronea de Fax" -m < $5.txt rm -f $5.* exit fi
|
_______________________________________________ Asterisk-Users mailing list [email protected] http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
