Overall setup

This document explain how to install binary bundles you have built yourself or directly downloaded.

Prerequises

Here is what need to be installed before you can setup Bakelite :

  • Asterisk (tested with 1.4.19);
  • mime-construct, required for fax2mail (tested with 1.9-r1);
    • You may need to configure a local MTA (postfix, sendmail). If you have already one ensure it works on inet interface different from the one used by James as SMTP server. For exemple with postfix you may want lines like following so local MTA only bind on localhost :
      inet_interfaces = localhost
      relayhost = [james.ip.host]
  • spandsp (see app_rxfax and app_txfax);
  • A periodic process system (like Cron);
  • Apache James (tested with 2.3.1), and so a working JRE (tested with JRockit 1.5.0.14, need a Java 1.5 one).

Asterisk

If not already done, ensure RxFax (and TxFax) application is properly installed in your Asterisk. You can do that by running Asterisk CLI (asterisk -r within Shell), and then asking for applications :

*CLI> core show applications

You will also need to have a rxfax extension in your dialplan, such as :

[incontext]
exten => 9799,1,misdn_set_opt(!e:vt0)
exten => 9799,2,Answer()
exten => 9799,3,Set(FAXID=${STRFTIME(${EPOCH}|Europe/Paris|%Y%m%d-%H%M%S)}-${CALLERID(num)}-${EXTEN})
exten => 9799,4,rxfax(/var/spool/asterisk/fax/${FAXID}.tif)
exten => 9799,5,Hangup()

exten => h,1,GotoIf($["${FAXID}" != ""]?fax-end,1)

exten => fax-end,1,TrySystem(touch /var/spool/asterisk/fax/${FAXID}.ok)

(In previous sample, 9799 in MSMN from ISDN.)

Take care not to change FAXID filename format, as it is used to store information like sender or incoming extension without database.

Fax2Mail scripts

Currently fax2mail features are implemented with unix shell scripts. Full java support, as for mail2fax is planned.

To install these scripts, you have to extract bakelite-X-unix.tar.gz,zip archive. You will get following directories and files :

bakelite-1.0-SNAPSHOT/system/
bakelite-1.0-SNAPSHOT/config/
bakelite-1.0-SNAPSHOT/system/fax2mail.sh
bakelite-1.0-SNAPSHOT/system/fax2mail.en.props
bakelite-1.0-SNAPSHOT/system/fax2mail.fr.props
bakelite-1.0-SNAPSHOT/config/fax2mail.conf

Then you should move system directory and its content (main script and localization files) to the place you want (we recommand to move its content to /var/spool/asterisk/system so script can be called by /var/spool/asterisk/system/fax2mail.sh).

Last step from there is to move configuration file fax2mail.conf to Asterisk configuration directory. So it usually goes to /etc/asterisk, if not change path in fax2mail.sh at top to point to the right place.

Periodic fax2mail delivery

As fax extension (see Asterisk section) in Asterisk will store fax files in a directory before they will be transmitted by mail, you will need to add a periodic process getting those files.

Such periodic task system is very common on Unix platform, so get the one you want (e.g. : /etc/periodic on Mac OS X).

In following section you can see how to setup that in cron systems, traditional on Linux distros.

Cron

Add the following line in your crontab :

*/5   *  * * *  root    /var/spool/asterisk/system/fax2mail.sh

With preceding example, incoming fax are checked every 5 minutes.

James

See James setup for Bakelite use.