DIY FreeSWITCH & FreePBXv3 from LiveCD
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
hello,
very good post
small, easy to understand and step by step
thank you!
Thanks! Hopefully it’ll start to build a little bit of “awareness” around FreeSWITCH, and get more people trying it out π
This is awesome!
We sure do need an ISO, don’t we? π I’m looking for volunteers!
The project continues moving forward – we are sooooo close to a release, lemme tell ya. We’ll keep you posted – keep up the great work checking this stuff out!
– Darren Schreiber
Great write up. Thanks for this!
I’ve been looking for an updated how-to for freeswitch and freepbx for a while.
Glad I could help. I went Debian instead of CentOS though, just because I like it more personally, even though most PBX distro’s these days seem to ship CentOS…
Maybe I’ll look at doing a “community-build” ISO when I’ve done the next write-up. Can’t wait to see a final release!! Glad you stopped by Darren π
A Debian PBX Distro would be awesome!
I think so too! Kind of “over” the whole CentOS personally, but that’s just me.
Anyways, with this blog, you can DIY, and easily too!
*Very* tempted now after talking with a few others to do an unofficial LiveCD for it…
Interesting article as I’ve been looking at moving to freeswitch from asterisk but found it hard to figure out the manual freeswitch configuration.
I decided to use vmware and mount an nfs partition from the host. This required the nfs-client package being installed.
However when trying to install the initial package list php5 … I ran out of space in /var/cache/apt/archives and even when linking this directory to the nfs mount later ran out of space when trying to install the packages. So I’m not entirely sure what I did wrong as mounting a flash disk under /usr/src would not have solved this.
I was doing great until this line:
Now, go to http://debian.ip/freepbx-v3/
That URL is dead, and most of the other links I have found for installing FreePBX on debian or Ubuntu lead off to dead ends as well.
Thanks for the heads up. When doing this via a VM I ran into this issue as well, running out of disk space on the ramdisk, so I’ve added a bit of extra info about putting /usr/src, /usr/local/freeswitch and /var/cache/apt/archives on to the USB drive instead of running from the ramdisk. Give it another try and see how you go π
Have you installed all the appropriate packages, such as php5-curl ?
Good article otherwise; lot of errors and, or typos expose an incompetency, inexpertise and, or ignorance.
BTW, you select/prefer a Debian system, but why don’t recommend ‘dpkg-buildpackage’; the freeswitch has/provider a Debian build scripts.
Moreover, git-core is a dummy package and automake is dependency for autoconf
Mostly because the debian build scripts are Ubuntu optimized, although they do work with debian. In fact, I’ve had a hand in adjusting the build scripts and re-contributing them back, so they don’t build FreeSWITCH in /opt (Which personally seems kind of retarded), but rather /usr/local/freeswitch as a “standard” build is. You left off “lack of caring” from your list, which probably sums it up more. It’s a blog article, not paid documentation, I’d suggest you get over it and overlook the minor errors.
Hello,
I was following your tutorial well until I arrive to the line
http://debian.ip/freepbx-v3/
what is debian.ip?
is it the ip of my computer?, I am using a laptop with wifi connection and the ip comes from DHCP
Do I have to set a fixed ip?
when I write http://localhost/freepbx-v3 I got a message that says that I want to open a phtml file, is this correct?
I have linux-mint installed.
Thank you for your help.
Hi Luis,
You want the IP Address of your Debian Live CD. If you’ve followed the instructions, you’ll have booted the Debian Live CD (NOT Mint Linux) from another PC, or Virtual Machine. That’s the one that you want the IP Address of.
Hope this helps
Chill.
Hello,
Thank you for your answer, I wonder if you have compared freepbx with fusionpbx and what your impressions are.
Regards.
Hi Luis,
To be honest I’ve not yet compared the two, though I’ve been doing a bit more with FreeSWITCH lately, so stay tuned and you may be in luck π