t38modem (elastix)

Joined: Tue 18 of Oct, 2011

t38modem (elastix)

Posted:Tue 18 of Oct, 2011 (01:15 UTC)
I tried yesterday to use t38modem with latest elastix release (2.0.3) and hylafax.
I think that I am very close so I will describe in detail what I did if anyone is interested or has any clue on how to wrap it up successfully.

First of all you need to remove ptlib so

yum remove ptlib

Then download for dependencies specific revision for optlib and opal

svn co opalvoip.svn.sourceforge.net/svnroot/opalvoip/ptlib/trunk -r 24174 ptlib
svn co opalvoip.svn.sourceforge.net/svnroot/opalvoip/opal/trunk -r 24174 opal

then latest t38modem

cvs -z3 -d:pserver:anonymous@t38modem.cvs.sourceforge.net:/cvsroot/t38modem co -P t38modem

I downloaded everything in /root.

  1. So we start by building ptlib

cd /root/ptlib
./configure --prefix=/opt/t38modem
make && make install

  1. Then opal && opal spandsp plugin
cd /root/opal
export PKG_CONFIG_PATH=/root/ptlib
./configure --prefix=/opt/t38modem
  1. build spandsp plugin (needs separate build - its excluded from main makefile due to licensing issues)
cd plugins/fax/fax_spandsp/
make && make install
  1. then opal
cd /root/opal/
make && make install

  1. finally t38modem
cd /root/t38modem/
export PTLIBDIR=/root/ptlib/
export OPALDIR=/root/opal/
make USE_OPAL=1 USE_UNIX98_PTY=1 opt

  1. The precious binary lies inside obj_linux_x86_64_opal directory.
  2. Obviously for 32bit it should have a slightly different name
  3. Copy it in /opt/t38modem/bin
cp obj_linux_x86_64_opal/t38modem /opt/t38modem/bin/.

And this concludes our build process
I tried to include a .tgz for the lazy ones (64bit version) with the output as well as other useful stuff but it seems it was rather big (15MB) so I wiped out all the binaries and included just some useful staff for a template /opt/t38modem directory.
Inside the .tgz a init.d script is included.

cp /opt/t38modem/init.d/t38modem /etc/init.d/.
chkconfig --add t38modem

You can edit the number of faxmodems and the udp port they use (default is 5 faxmodems udp ports 6060-6064).

You will also need a valid hylafax config (/opt/t38modem/hylafax/config.ttyx)
Copy it to /var/spool/hylafax/etc/. and create config.ttyT38-0, config.ttyT38-1 and so on.

Also you need to append (5 faxmodems)

ft1:2345:respawn:/usr/sbin/faxgetty ttyT38-0
ft2:2345:respawn:/usr/sbin/faxgetty ttyT38-1
ft3:2345:respawn:/usr/sbin/faxgetty ttyT38-2
ft4:2345:respawn:/usr/sbin/faxgetty ttyT38-3
ft5:2345:respawn:/usr/sbin/faxgetty ttyT38-4

in /etc/inittab


init q
service t38modem start
service hylafax restart

Also do create one sip extension for each faxmodem in elastix web-gui. Please do remember that you need to specify
host and port 6060 (for ttyT38-0). Ports increase like the faxmodem number.
The log for each t38modem is in /opt/t38modem/log.
If you follow the instructions above (and I have not forgotten anything ) you will see everything ok.
Needless to say that this setup was inspired by various blogs/posts/... I just took bits and pieces and got the thing together.

Now the difficult part.

I tried two configurations:

a. t38modem (Hylafax) <-> ATA (SPA3102) <-> Xerox 6180D MFP Fax/Printer
b. t38modem (Hylafax) <-> Asterisk/Elastix 2.0.3 <-> ATA (SPA3102) <-> Xerox 6180D MFP Fax/Printer

Obviously what i described above is configuration (b). You may easily adapt your settings to derive (a).
The strange part is that (a) works like a charm! T38 fax ok while (b) is unsuccessful.
Asterisk hangs up the call at some time (I think when the t38 reinvite takes place, but not sure yet and a bit
tired to search further atm).

I have added
t38pt_udptl = yes,redundancy,maxdatagram=400
instead of just
t38pt_udptl = yes
in sip_general_custom.conf but it did not make a difference.