Installing Freeswitch on FreeBSD 9

[This is a work in progress article. There can be changes or additions to this article in the near future.]

Freeswitch port on Freebsd is at 1.0.6 while the current version of Freeswitch is on 1.3.x . The devel port for Freeswitch does not compile on FreeBSD 9.1 at the moment. Instructions at Freeswitch site does not work cleanly for the current version of FreeBSD (9.1). It requires tweaking in the script/code to get it working correctly. Also, make sure that you have “source” selected while installing FreeBSD, otherwise DAHDI kernel module with fail to build.

First step is to install all the required dependencies using ports. FreeBSD 9.1 does not have pre-built packages because of the security breach found during the end quarter of 2012.

# portsnap fetch extract
# mkdir -p /usr/ports/packages/All

The reason I have created a packages/All directory is because I like to keep all the packages pre-built with me to save time on subsequent installations. Most of the ports can be left to their default configurations. One port that needs extra settings is Perl. In the config dialog box for perl, make sure to select multithreading and mulitplicity if you need mod_perl module enabled in Freeswitch.

Install all the other ports in batch mode. If you are not interested in making packages, you can instead use

make all install clean

instead in the above command as well as all the commands that follow. I also needed access to Postgresql database from Freeswitch/mod_perl, for which certain modules are required to be installed. These are optional if you do not need mod_perl and/or Postgresql connectivity.

Install libpri and dahdi-kmod (installs dahdi as dependency). If you are making packages, you need to modify the Makefile for dahdi-kmod26 located in /usr/ports/misc/dahdi-kmod26. Comment out line number 47 which says “NO_PACKAGE= Should be in sync with the kernel to work correctly”

Replace the module name with the appropriate module for your card. For a list of modules, see this page. At the moment, support is only available for Digium cards on FreeBSD. If anybody knows how to configure Sangoma or other cards, I would love to hear about it.

Once you are done with the changes, configure and install spandsp module. Also, freetdm needs to be configured with libpri enabled. Make sure that you use gmake as bsd make would not work for compiling spandsp and freeswtich