Building SpanDSP

If you downloaded SpanDSP (to use it for DTMF detection or a software FAX machine, for example), you should build it now, before you build Asterisk.

However, before compiling SpanDSP, beware that a number of Linux and other software distributions include SpanDSP, but they usually supply older versions of the library, which lack a lot of the features of the current version. Therefore, before installing SpanDSP, make sure there aren't any older versions already installed. Try:

     su
     whereis spandsp.so

This command will usually show you all the versions of SpanDSP in the machine's library search path. If there are SpanDSP files in directories other than the one where you intend to install the new SpanDSP, you should deal with those.

You will need libtiff installed on your machine. There have been several bugs related to FAX document handling in some older versions of libtiff, so check which version you have. Versions 3.5.7, 3.6.0, 3.7.1 and 3.8.2 seem to work OK. Some people have had trouble building SpanDSP, because they had more than one version of libtiff on their machine, installed in different directories. Try using the whereis command to find libtiff.so and then list the link given to see which version it points to:

     whereis libtiff.so
     [returns /usr/lib/libtiff.so]
     ls -l /usr/lib/libtiff*

You will also need to install libtiff-devel in order to build SpanDSP. The latest version of libtiff-devel, along with the latest version of libtiff.so, are both installed by the yum command shown in the Installing The Build Prerequisites section, above, so you should be all set.

You can build the SpanDSP library with the usual:

     cd .../asterisk
     tar -xvzf spandsp.tgz
     cd spandsp
     ./configure
     make
     su
     make install

However, if you use configure in this way, the SpanDSP library will be installed in /usr/local. In this case make sure your /etc/ld.so.conf.d directory has an entry for SpanDSP that points to /usr/local/lib:

     su
     cat > /etc/ld.so.conf.d/spandsp.conf << EOF
     /usr/local
     EOF
     ldconfig

We prefer to install the SpanDSP library in /usr by building it like this:

     cd .../asterisk
     tar -xvzf spandsp.tgz
     cd spandsp
     ./configure --prefix=/usr
     make
     su
     make install

Since some systems will happily build and install the SpanDSP library in a directory that isn't even included in the machine's library search path, as a final check that telephony applications will be able to find SpanDSP, try:

     whereis libspandsp.so

Make sure that the library is shown in the directory where you expect it to be.