Over the past year I’ve been experimenting FreeSwitch as my home based PBX solution and so far using it seems like quite a breeze. Installation was quite a breeze too when you don’t run into problems. Maintaining it was also quite a breeze… until you discover (quite rudely) the fact that a boot option should be appended on the GRUB configuration file with these newer RHEL-like 6 releases. (I’m talking about Scientific/CentOS here, not the real RHEL 6 product which a poor starving student at the moment could not afford.)
I’ve written this howto that should be for users out there who have very little *nix/Win32 command line experience, so if there’s anything that’s somewhat complicated for that audience, let me know. I’ll try to fix this howto ASAP to target that audience.
First things first (Shamelessly copied and pasted off from the FreeSwitch wiki), you’ll need to install the following dependencies that FreeSwitch needs to have installed in order to compile properly. Fortunately I’ve simplified this necessary step down to one command line. (And please, run yum under root.)
yum install autoconf automake gcc-c++ git-core libjpeg-devel libtool make ncurses-devel unixODBC-devel openssl-devel gnutls-devel libogg-devel libvorbis-devel libtiff-devel libjpeg-devel python-devel expat-devel zlib zlib-devel bzip2
A side note here, if you’re compiling FreeSwitch for Fedora 14 or later, you might want to know that libjpeg has been “superseded” by libjpeg-turbo. API wise they’re fully compatible with each other, but the primary difference is the -turbo version runs much faster than the regular libjpeg under Intel like CPU’s. (This means your x86/x86_64 processors!). mod_spandsp requires libjpeg to compile properly or you won’t be able to take advantage of FreeSwitch’s nice fax receive/transmit feature!
Now let’s go grab a copy of the FreeSwitch source code off from their latest git tree (Don’t worry, FreeSwitch right off from git is quite stable… And the developers actually recommend you to download the latest git source code once a while, as they fix problems quite quickly.) To grab a copy of the latest source code right off from the git tree, just simply enter this command:
git clone git://git.freeswitch.org/freeswitch.git
Once git finishes what it needs to do, enter the freeswitch directory and bootstrap the code by typing in:
The bootstrap process can take some time to complete depending on the processor and how much RAM you have installed. After the bootstrap process completes, you can always issue the good old “./configure && make && make install” command if you’re feeling you need something to curse or yell at with very colourful language. However, I decided to take the misery of you having to go through the pain by pointing out that the configure process should also include the –without-libcurl option. Due to some changes made by Red Hat (Which I forgot at the moment, somebody did complain about this problem to Red Hat via their Bugzilla, but they closed it as a won’t fix issue…), the included curl-devel package is broken to FreeSwitch… The –without-libcurl option basically tells the build system to go download its own copy of libcurl that works and use that instead of the Red Hat supplied package.
Enough of rambling here, here’s the final copy-and-paste command for installing FreeSwitch quickly and painlessly:
./configure --without-libcurl && make && make install && make sounds-install && make moh-install
By default this command will configure FreeSwitch’s sources, builds it and installs it along with the default IVR voices and Music On Hold. Your FreeSwitch binaries, libraries and modules will be installed to /usr/local/freeswitch by default. If you do decide in the future that you require fancy modules like mod_shout or mod_dingaling, you can always edit the modules.conf file that’s inside the root directory of the git source tree to include the module you would like to install. Editing that file shouldn’t be too hard and you can always use your favorite text editor 🙂
Finally, it is highly advisable you disable the tickless feature of the kernel. bkw over at the mailing list recommended that users should disable the tickless feature with kernels newer than version 2.6.29. You can find the grisly details right here if you’re feeling you’re in for a horror story tonight. So how do you disable the tickless feature? Easy, edit the /etc/grub.conf file and append the nohz=off option to the kernel options directive and reboot the machine (It’s the kernel blah blah blah rhgb quiet line, with the most recently updated kernel version first on the list.). Then again, you can always manually interrupt the GRUB screen and edit the boot options to include the nohz=off option…
And oh, last thing: By disabling the tickless feature of the kernel, it also had a positive side effect… One of the reasons you might want to use FreeSwitch is it’s ability to interface with Google Voice over Google Talk to make PSTN calls within North America for free and the module that does just that is called mod_dingaling. For some odd reason mod_dingaling crashes FreeSwitch randomly when it is loaded. The problem was traced down to libgnutls. If I can recall correctly, the anthm said the cause of the crash is probably due to a broken libgnutls package packaged with Fedora/RHEL, but however after an accidental encounter with the tickless kernel, I could conclude that mod_dingaling isn’t having an issue at all on most *nix distributions with recent kernels. Nevermind, tickless kernel only increases the reliability for mod_dingaling to load without a segfault… Back to the drawing board then…
Now happy voiping with your new RHEL 6-based FreeSwitch box!