[asterisk-users] asterisk email to fax

Eric Cooper ecc at cmu.edu
Thu Jun 25 11:09:10 CDT 2015


On Wed, Jun 24, 2015 at 08:15:06AM +0200, tux john wrote:
> i would like to add email to fax functionality to the system. could someone
> point me to the right direction to see how please?

I don't have a general solution, since I haven't needed to send faxes
recently.  But I did set up my dialplan so that I could test that it
works.

I used this:
----
    ;; For outgoing faxes
    FAX_NAME = My Company Name
    FAX_NUMBER = My Phone Number
    FAX_FILE = /tmp/fax.tiff

    [services]
    ...
    exten => sendfax,1,Verbose(3,Sending fax)
      same => n,Set(FAXOPT(headerinfo)=${FAX_NAME})
      same => n,Set(FAXOPT(localstationid)=${FAX_NUMBER})
      same => n,SendFax(${FAX_FILE})
      same => n,Verbose(3,Pages: ${FAXOPT(pages)}  Status: ${FAXOPT(status)})
      same => n,System(rm ${FAX_FILE})
      same => n,Hangup()
----

To "dial" the sendfax extension, I created a call file manually that
looked like this:
    Channel: DAHDI/g0/1-800-123-4567
    Context: services
    Extension: sendfax
In an automated system, you'd probably want to use the manager API,
but you could also generated call files from scripts.  Then I placed
the fax file in /tmp/fax.tiff and the call file in
/var/spool/asterisk/outgoing/ and Asterisk sent off the fax.  There
are some free fax echo numbers out there that are useful when
debugging.

If I wanted to drive this automatically from email, I would probably
just use procmail and some scripts.  Ghostscript produces the right
kind of image file if you use "-sDEVICE=tiffg4".  You'd have to define
some syntax for specifying the outgoing number and cover page info in
the email body, and extract the MIME attachment for the document from
the email.

Hope this helps.

--
Eric Cooper             e c c @ c m u . e d u



More information about the asterisk-users mailing list