DIY FreeSWITCH & FreePBXv3 from LiveCD

April 23, 2010 Chilling_Silence How-To's / Guides / Tech info

This is a bit of a follow on from my previous post: http://chillingsilence.wordpress.com/2010/01/14/initial-thoughts-on-freepbxv3-and-freeswitch-vs-asterisk/

Everybody is starting to talk about FreeSWITCH as the next big PBX software (Amongst other things), and FreePBXv3 is shaping up to be a damn fine GUI.

The more I use it, the more I start to like FreeSWITCH as a progression from Asterisk. One will likely never completely kill the other, I can see a world where they both live happily, but for me I struggle knowing that Asterisk doesn’t 100% accurately do all CDR stuff, and it bugs me recommending that to a client.

I’ve blogged before on FreePBXv3, and the dev guys are still as friendly as ever (Granted they seem to be a truckload busier lately, but who can blame them).

What follows is a guide on booting a LiveCD (Debian!) and running FreeSWITCH & FreePBXv3 from this live system. From there, it’s up to you if you want to simply reboot and forget it ever happened, or potentially install it to a HDD. The choice is yours, I’m just going to give you a quick How-To on getting FreeSWITCH & FreePBXv3 up and running nicely, and in a flash! In fact, on a decent machine (C2D 2Ghz+) and a decent internet connection, you could be up n running from scratch, in less than 20 minutes πŸ™‚

You’ll need a Blank CD (Or VirtualBox for example), and potentially some form of external thumbdrive that you can format. In my case I used an 8GB SDHC card.

Start by grabbing yourself the LiveCD: http://cdimage.debian.org/cdimage/release/current-live/

I used: i386/iso-cd/debian-live-504-i386-standard.iso

Once you’ve downloaded it, burn it off or boot it up in VirtualBox

Great! Now, become root:

sudo bash

Change the root password:rm

passwd

Enter something nice, coz we’re presuming you’re going to copy / paste via SSH for the rest of this.

Now run:

apt-get update
apt-get install openssh-server

Once that’s done, login remotely with ssh and carry on as-per usual. This is kind of optional but saves you typing package names manually etc.

OK now before we run out of HDD space, we’re going to mount the USB drive.

Use cfdisk to create a linux partition, then format it with (something like):

mkfs.ext3 /dev/sdb1
mkdir /mnt/usb
mount /dev/sdb1 /mnt/usb

You may need this if you’re working on a machine with a low amount of RAM and you find you run out of “disk space” on the ramdisk:

mkdir /mnt/usb/src
mkdir /mnt/usb/freeswitch
mkdir /mnt/usb/archives
rm -rf /usr/src
ln -s /usr/src /mnt/usb/src
ln -s /usr/local/freeswitch /mnt/usb/freeswitch
ln -s /var/cache/apt/archives /mnt/usb/archives

Now we want you to install all the following:

apt-get install php5 php5-xcache php5-xmlrpc php5-mysql php5-gd php5-cli \
build-essential git git-core autoconf libgdbm-dev libdb-dev subversion php5-curl \
automake libtool libncurses5 libncurses5-dev php-db mysql-server-5.0 mysql-client-5.0

They’re all going to come in handy at some point for either FreePBXv3 or FreeSWITCH.

Make note of your MySQL root password, you’ll need it for later on!

Now we begin with the FreeSWITCH compile:

cd /usr/src
git clone git://git.freeswitch.org/freeswitch.git

This will pull the latest version from subversion, which for most applications is a bit of a No-no, but FreeSWITCH seems to be relatively stable on a day-to-day basis and it’s actually recommended from what I can tell.

cd freeswitch.git
./bootstrap.sh

This is the beginning of what could be a very long compile if you don’t have semi-recent hardware…

Provided there’s no errors, proceed on to:

./configure

Now, I’m doing it this way rather than the proposed “quick n nasty” because for some reason it kept being unable to find the right libraries when I *know* they’re on the system. YMMV.

Next we make with:

make

Then we make install:

make install

IF you get errors right away like I did, then try running:

make current

I’m unsure why, but it worked for me after make install errors (Thanks to bruce from #freeswitch).

Next we install sounds:

make sounds-install moh-install

Tada, all done (For FreeSWITCH at least)!

Note, you can also do the High Definition sounds with:

make uhd-sounds-install uhd-moh-install hd-sounds-install hd-moh-install

Start the service with:

/usr/local/freeswitch/bin/freeswitch

You should be able to point a SIP device at your debian box’ IP address, with Ext 1000 & Secret of 1234, then dial 9999 or 5000 to test, as-per the instructions here: http://wiki.freeswitch.org/wiki/Quick_and_Dirty_Install

You can quit it at any time by typing “shutdown”.

FreeSWITCH down. Now on to FreePBXv3!

cd /var/www
svn co http://www.freepbx.org/v3/svn/trunk/ freepbx-v3/

Now we’re going to sort out the permissions:

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/*
mkdir freepbx-v3/upload
chgrp -R www-data freepbx-v3/upload
chmod -R g+w freepbx-v3/upload

Debian uses www-data for the http group, instead of apache.

We’re not going to bother with mod_rewrite, I’m lazy and it’s not crucial.

Now, go to http://debian.ip/freepbx-v3/

Follow through the first part of the install, accepting the terms, the pre-flight checklist should be all good except for mod_rewrite, and now we’re onto the actual configuration:

Leave the host as 127.0.0.1, but set the username as “root” and the password as the one you defined earlier. Pick your timezone as applicable and hit Next.

Create a Master Admin account and hit Next

The defaults are fine on the next page, leave it as the “FreeSWITCH Driver” and hit Next, twice (To tell it it’s safe to overwrite the config files).

The default selections are fine for “packages” to be installed, click next, twice (to ignore the errors).

We’re not ready to install! Hit the button to begin the process πŸ™‚

It’ll then say Installation Complete, click the link and begin using FreePBXv3!

Don’t forget, you may need to restart freeswitch if you killed it earlier, with:

/usr/local/freeswitch/bin/freeswitch

I’ll post a brief intro to FreePBXv3 shortly. In the mean time, enjoy, and please post feedback!!

NOTE: You will no longer be able to connect immediately to FreeSWITCH with your SIP device as you did earlier. This is because FreePBXv3 has overwritten the config files with it’s own, however we’ve accomplished the goal of this post, to get FreeSWITCH & FreePBXv3 up and running on a LiveCD in no time at all! From here, you’ll need to configure everything with FreePBXv3

Asterisk, Debian, FreePBX, FreePBXv3, FreeSWITCH,

19 Responses to “DIY FreeSWITCH & FreePBXv3 from LiveCD”


Leave a Reply

Powered by WordPress. Designed by elogi.