Fax to Email Issue

cathb2017
Joined: Fri 16 of Jun, 2017

Re: Fax to Email Issue

Posted:Mon 23 of Oct, 2017 (15:40 UTC)
It must because the PDF is created and emailed out. The issue is that the PDF isn't readable in Adobe. We have tried a few different versions. So we need to know why and if anyone else has this issue and a suggested fix. We prefer not to install another PDF reader as there are about 100 PCs involved.
superhombre
Joined: Tue 12 of Jan, 2016

Re: Fax to Email Issue

Posted:Wed 18 of Oct, 2017 (13:46 UTC)
That line uses a pearl script, do you have that script in place? is it working? and does asterisk have permission to execute it?
cathb2017
Joined: Fri 16 of Jun, 2017

Re: Fax to Email Issue

Posted:Thu 12 of Oct, 2017 (15:13 UTC)
Wow! Finally someone replied. Ha ha. I am told this line of code does it. So when they get the fax to email it shows up in their email as an attached .tif and an attached .pdf. Client wants to use the .pdf but it won't open properly.

exten => h,n,System(${ASTVARLIBDIR}/agi-bin/fax-process.pl --to ${EMAIL_${COUNTER}} --from voicemsg@xxxxxxxxxx.com --dest "${FROM_DID}" --subject "New fax from ${URIENCODE(${CALLERID(name)})} ${URIENCODE(<${CALLERID(number)}>)}" --attachment fax_${URIENCODE(${CALLERID(number)})}.pdf --type application/pdf --file ${ASTSPOOLDIR}/fax/${UNIQUEID}.tif)
superhombre
Joined: Tue 12 of Jan, 2016

Re: Fax to Email Issue

Posted:Thu 12 of Oct, 2017 (12:52 UTC)
Asterisk by default saves your incomming faxes as a TIF . I dont see where its converted to PDF
cathb2017
Joined: Fri 16 of Jun, 2017

Fax to Email Issue

Posted:Fri 16 of Jun, 2017 (16:33 UTC)
I think our voip system uses asterisk but excuse me if I'm wrong. We can't get fax to email to work. When we try to open the PDF file it gives the error message as follows:Adobe Acrobat Reader could not open 'fax_383838493.pdf' because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded). It won't open in Adobe at all after trying a few versions. It does open with a freebie pdf viewer. We need it to open in Adobe. Can someone review the script and see if there is a way we can fix or perhaps even send it as a zip file? Thanks.
exten => s,1,Set(GROUP(fax)=fax)
exten => s,n,Set(FROM_DID=${CALLERID(dnid)})
exten => s,n,Set(CDR(dst)=${FROM_DID})
;
exten => s,n,Noop(Receiving Fax for: ${FAX_RX_EMAIL} , From: ${CALLERID(all)})
;
exten => s,n,NoOp(**** SETTING FAXOPT ****)
exten => s,n,Set(FAXOPT(ecm)=yes)
exten => s,n,Set(FAXOPT(headerinfo)=FAX SERVER)
exten => s,n,Set(FAXOPT(localstationid)=${FROM_DID})
;exten => s,n,Set(FAXOPT(maxrate)=14400)
;exten => s,n,Set(FAXOPT(minrate)=2400)
;
exten => s,n(receivefax),StopPlaytones
exten => s,n,ReceiveFAX(${ASTSPOOLDIR}/fax/${UNIQUEID}.tif, f)
exten => s,n,Hangup()
;
exten => h,1,NoOp(FAXOPT(status) : ${FAXOPT(status)})
exten => h,n,NoOp(FAXOPT(statusstr) : ${FAXOPT(statusstr)})
exten => h,n,NoOp(FAXOPT(error) : ${FAXOPT(error)})
exten => h,n,ExecIf($["${FAXOPT(error)}"!="" && "${FAXOPT(status)}"!="SUCCESS"]?Set(FAXSTATUS=FAILED FAXOPT: error: ${FAXOPT(error)} status: ${FAXOPT(status)} statusstr: ${FAXOPT(statusstr)}))
exten => h,n,GotoIf($["${FAXSTATUS:0:6}" = "FAILED"]?failed)
exten => h,n,Set(COUNTER=0)
exten => h,n(incrementcounter),Set(COUNTER=$[${COUNTER} + 1])
exten => h,n,GotoIf($[${LEN(${EMAIL_$[${COUNTER}]})} = 0]?end)
exten => h,n,System(${ASTVARLIBDIR}/agi-bin/fax-process.pl --to ${EMAIL_${COUNTER}} --from voicemsg@xxxxxxxxxx.com --dest "${FROM_DID}" --subject "New fax from ${URIENCODE(${CALLERID(name)})} ${URIENCODE(<${CALLERID(number)}>)}" --attachment fax_${URIENCODE(${CALLERID(number)})}.pdf --type application/pdf --file ${ASTSPOOLDIR}/fax/${UNIQUEID}.tif)
exten => h,n,Goto(incrementcounter)
exten => h,n(failed),Noop(FAX ${FAXSTATUS} for: ${FAX_RX_EMAIL} , From: ${CALLERID(all)})
exten => h,n,System(/usr/bin/php ${ASTVARLIBDIR}/agi-bin/sendmail.php "voicemsg@xxxxxxx.com" "xxxx@xxxxxx.ca" "Fax Failed" "The fax gateway failed to receive a fax from ${CALLERID(number)} <${CALLERID(name)}>.\n\nError information: ${FAXSTATUS}")
exten => h,n(end),System(/bin/rm -f ${ASTSPOOLDIR}/fax/${UNIQUEID}.tif)
exten => h,n,Hangup()