Iscriviti   Guestbook   Immagini   Forum   Download   Mappa   66 utenti on line 
Italiano
MENU
CONFIGURAZIONI
RISORSE
INFO
Login

DOWNLOAD
Device
Suggerimenti

 
Fax in Email

   exten =>
_3XX,1,SetVar(FAXFILE=/var/spool/asterisk-fax/${UNIQUEID}.tif)

If you want a unique id, why not use the one that Asterisk provides?

In case anyone's interested, I spent a bit of time on incoming faxes
yesterday, prototyping a DID FAX-type setup.  Here are a few snippets,
in case anyone's interested.

[macro-faxreceive]
   exten => s,1,SetVar(FAXFILE=/var/spool/asterisk-fax/${UNIQUEID}.tif)
   exten => s,2,DBGet(EMAILADDR=extensionemail/${MACRO_EXTEN})
   exten => s,3,rxfax(${FAXFILE})
   exten => s,103,SetVar(EMAILADDR=defaultuser@example.com)
   exten => s,104,Goto(3)

[fax]
   exten => 2201,1,Macro(faxreceive)
   exten => 2202,1,Macro(faxreceive)
   exten => 2203,1,Macro(faxreceive)

   exten => h,1,system(/usr/local/sbin/mailfax ${FAXFILE} ${EMAILADDR} \
      "${CALLERIDNUM} ${CALLERIDNAME}")

; I'm using a shared analog line for testing this, so I'm using the fax
; autodetection code to yank faxes out of my IVR and into the 'fax'
; pseudo-extension
[outside]
   ...
   exten => fax,1,Goto(fax,2201,1)


Finally, here's /usr/local/sbin/mailfax:

#!/bin/sh

FAXFILE=$1
RECIPIENT=$2
FAXSENDER=$3

tiff2ps -2eaz -w 8.5 -h 11 $FAXFILE |
   ps2pdf - |
   mime-construct --to $RECIPIENT --subject "Fax from $FAXSENDER"
--attachment fax.pdf --type application/pdf --file -

In Debian, tiff2ps comes in libtiff-tools, ps2pdf is part of
Ghostscript, and mime-construct is its own package.

To set the email address associated with each extension, do 'database
put extensionemail EXTEN user@example.com'



 

Valid CSS!