The $35 mean machine really comes out on top for slapping together a PBX very quickly. Before I started this project, I saw Asterisk being ported over onto the Raspberry Pi, so I decided to take a shot at it a couple months back just before ClueCon for FreeSWITCH. Here were the results:
You initially want to start out with a Raspian image (I used Wheezy): http://www.raspberrypi.org/downloads
DD the image onto your SD-card. You can use the wiki located here for instructions on how to do it.
Be sure to go through the install process using raspi-config. You will want to expand the partition, etc.
And now we begin…
I like to roll around as root so as soon as I logged in as the default ‘pi’ user, I immediately dropped into a sudo shell as root.
[code]sudo -s[/code]
I immediately installed several other pieces of software/libraries I like to have for this build as well as for my own future use:
[code]
apt-get update
apt-get install screen default-jre mlocate autoconf automake libtool libncurses5-dev libjpeg8-dev default-jre git libperl-dev libdb-dev libiksemel-dev gnutls-bin libgnutls-dev
[/code]
While we are at it here, lets link up a couple libraries:
[code]
ln -s /usr/lib/arm-linux-gnueabihf/libgdbm_compat.so.3 /usr/lib/libgdbm_compat.so
ln -s /usr/lib/arm-linux-gnueabihf/libgdbm.so.3 /usr/lib/libgdbm.so
[/code]
The first thing to do here is to clone the git repo on the unit, but we have to change directories to:
[code]cd /usr/local/src[/code]
For a stable release:
[code]
git clone -b v1.2.stable git://git.freeswitch.org/freeswitch.git
[/code]
or if you want the latest and greatest
[code]git clone git://git.freeswitch.org/freeswitch.git[/code]
From here we will change directories into the FreeSWITCH dir.
[code]cd freeswitch[/code]
We then will want to run the boostrap to make the modules.conf file for us to edit
[code]./bootstrap.sh[/code]
You can now edit the modules.conf if you want to add any additional modules by uncommenting them out. (For my build, I uncommented mod_dingaling which gives support for Google Voice)
Once that step is done, lets configure:
[code]
./configure
[/code]
After configure was done, I edited the makefile to remove the second instance of “-Werror” which is a flag that stops the build process on a warning. Info: Not doing this will stop the build, so if you hate yourself and want to waste hours of RasPi CPU time, feel free to do this continuously.
[code]vi makefile[/code]
just an FYI: if you get angry with the arrow keys in vi, you can
[code]:set term=cons25[/code]
…which should make you happy again.
I went ahead and removed the second instance of “Werror” within the make file because I was getting possible irrelevant warnings that were stopping the compile process. This is a cheap way around and probably isn’t recommended as it could create segfaults within FreeSWITCH…but I did it anyways. (This is proof of concept…what do you expect here?)
Once we are gucci, we can continue with make:
[code]
make
[/code]
and then we shall install that puppy
[code]make all install cd-sounds-install cd-moh-install[/code]
After many relentless hours of compiling; if there were no errors, you have successfully built FreeSWITCH. Lets run it!
[code]/usr/local/freeswitch/bin/freeswitch[/code]
Alternatively, you could add some tricks to it like chowning the FS directory so it doesn’t run under root, but this was a quickie proof of concept to show that it is possible to run FS under the RasPI.
My close friend Intralanman over at FSS gave me the glorious idea of using distcc with the Pi to help speed along the process. I may toss up notes or a new article including it.
If you feel like going back to raspian but want to save you current image, you can always dd it off using either your linux or mac box. I usually dd and compress at the same time to save space. It will compress nicely too:
[code]dd if=/dev/disk2 | gzip > {image_destination}/freeswitch_image.dd.gz[/code]
Cheers!