Fax2Email using mISDN channel driver

From Etel

Jump to: navigation, search

Contents

Fax2Email using mISDN channel driver

Problem

How to use your mISDN Channels (BRI boards) as a Fax Reception Machine and deliver it to your e-mail account as a PDF attachment.

Solution

Let's consider your Telco's msn that you are using for Fax is 12345
Every new fax2email will have a subject as CALLERIDNUM-TIMESTAMP and every attachment is named with a uniqueid using TIMESTAMP variable

[fax-reception]
exten => 12345,1,Set(FROM_DID=12345)
exten => 12345,n,Set(FAX_RX=system)
exten => 12345,n,Set(FAX_RX_EMAIL=testefax@yourdomain.pt)
exten => 12345,n,SetVar(FAXFILE=/var/spool/asterisk/fax/${TIMESTAMP}${CALLERIDNUM}.tif) 
exten => 12345,n,SetVar(FAXFILENOEXT=/var/spool/asterisk/fax/${TIMESTAMP}${CALLERIDNUM}) 
exten => 12345,n,Answer
exten => 12345,n,misdn_set_opt(!e:vt0)  ;let's disable echo cancel in our channel
exten => 12345,n,Rxfax(${FAXFILE})      ;RX application for fax reception
exten => 12345,n,system(tiff2ps -2eaz ${FAXFILE} | ps2pdf - ${FAXFILE}.pdf) ;Let's create the PDF file
exten => 12345,n,system(mime-construct --to ${FAX_RX_EMAIL} --subject "Fax from ${CALLERIDNUM}-${TIMESTAMP}" --attachment ${TIMESTAMP}.pdf --type application/pdf --file ${FAXFILE}.pdf) ;Email it
exten => 12345,n,system(rm -rdf ${FAXFILENOEXT}.*) ; remove tif files created to receive it
exten => 12345,n,hangup

Discussion

See Also:

Metadata

  • By: Marco Mouta
Personal tools