May 31

FreeSWITCH and FreePBX v3 running on Ubuntu on an ALIX board

We've been following the development of FreeSWITCH and running it as our phone system here for a few years now. It's a fantastic piece of software, featurefull, extremely stable and really just works.

A lot of people aren't comfortable or just don't like hand editing configuration files. Good news for those people as FreePBX, the ubiquitous web GUI for configuring Asterisk, will soon be releasing a new version 3 which supports configuring FreeSWITCH.

We had a PC Engines ALIX board sitting around collecting dust after sustaining damage to one of it's Ethernet ports, the rest of the board is fine. For something interesting to do with with it I thought that seeing if it could run FreeSWITCH and FreePBX in it's limited environment would be fun.

We use Ubuntu on most of our computers so I started there, nice and simple. Here's a blog post about installing Ubuntu Lucid on a compact flash for an ALIX board. It's mostly correct though there's a couple of minor things I changed (post a comment if you would like details).

While the compact flash card was still mounted on my laptop I took advantage of the faster processor to install and compile FreeSWITCH, this should work for any Ubuntu system.

apt-get install git-core autoconf libtool libncurses5-dev # Install some prerequisites
cd /usr/src && git clone git://git.freeswitch.org/freeswitch.git # Download FreeSWITCH
./bootstrap.sh && ./configure && make && make install # Install FreeSWITCH

There are more details on installing FreeSWITCH here.

apt-get install lighttpd subversion mysql-server php5-mysql php5-xmlrpc php5-curl # Some requirements for FreePBX v3
lighttpd-enable-mod fastcgi && /etc/init.d/lighttpd force-reload # Enable PHP support
cd /var/www && svn co http://www.freepbx.org/v3/svn/trunk/ freepbx-v3/ # Download FreePBX
# Setup permissions for FreePBX
chgrp -R www-data /usr/local/freeswitch/conf/*
chmod -R g+w /usr/local/freeswitch/conf/*
chmod 777 freepbx-v3/freepbx/logs/
chmod 777 freepbx-v3/freepbx/cache/
chgrp -R www-data freepbx-v3/freepbx/config/*
chmod -R g+w freepbx-v3/freepbx/config/*

These instruction as taken from the FreePBX v3 installation instructions and modified slightly for Ubuntu.

After putting the CF card in the ALIX board and booting it up you can then open a browser at it's IP address and start configuring your phone system!

So, how does the ALIX perform? It handles FreeSWITCH alone really quite well. You'll notice that I used lighttpd as the webserver, I originally tried loading Apache2 but due to the low memory on the ALIX (256MB) the OOM killer killed mysql when FreeSWITCH was started. Not a great start!

After starting mysql, lighttpd, FreeSWITCH, top shows about 5MB free RAM, that will do to get going. After creating a few extensions and registering a couple of phones I created a three person conference, two phones using G722 wideband and one using G711. Looking at top the ALIX board is running at 20% CPU and about 3MB free memory. Not too bad at all for the little box!

So the conclusion? It can be done! The ALIX board all loaded up with everything can handle at least a few calls. I haven't tested how many yet, perhaps I'll run it up again and see what it's limit is. Whether you want to load up the poor little ALIX with all this stuff like a web server, database server etc. is up to you. If you do there's probably many better ways to save resources, feel free to point them out in the comments :)

5 responses to "FreeSWITCH and FreePBX v3 running on Ubuntu on an ALIX board"

  1. Just trying to do this now, on a 2d13, what changes did you make to the install process?
  2. Hi Ross,

    The first thing was installing grub-pc instead of grub2 as that's the correct package.

    Then there's the below notes I made at the time (apologies they are so rough);

    ---------------------start-----------------------
    apt-get install language-pack-en-base

    echo 'proc /proc proc nodev,noexec,nosuid 0 0' > /etc/fstab

    echo 'deb http://nz.archive.ubuntu.com/ubuntu/ lucid main universe' > /etc/apt/sources.list
    echo 'deb http://nz.archive.ubuntu.com/ubuntu/ lucid-updates main universe' >> /etc/apt/sources.list
    echo 'deb http://security.ubuntu.com/ubuntu lucid-security main universe' >> /etc/apt/sources.list

    apt-get update && apt-get dist-upgrade

    apt-get install ubuntu-minimal openssh-server bash-completion screen wget

    echo "[options]" > /etc/e2fsck.conf
    echo "broken_system_clock" >> /etc/e2fsck.conf

    passwd
    ---------------------end-----------------------

    You probably won't need the broken_system_clock as you've got a 2D13 which has a RTC battery built in.

    Let me know how you get on.

    Cheers,
    hads
  3. Just trying to do this now, on a 2d13, what changes did you make to the install process?
  4. got it running last night, not a problem.
    Ubuntu 10.04 running on an alix 2d13, with a 4Gb CF card.
    Its a generic image at the moment, support the serial console and DHCP on eth0. I'll try and find a web site to make it available on. Thanks for the pointers.
  5. Hi Ross,

    Great stuff, glad you got it working.

    Cheers,
    hads

Leave a comment