{"id":219,"date":"2010-04-23T00:01:20","date_gmt":"2010-04-22T11:01:20","guid":{"rendered":"http:\/\/chillingsilence.wordpress.com\/?p=219"},"modified":"2010-04-23T00:01:20","modified_gmt":"2010-04-22T11:01:20","slug":"diy-freeswitch-freepbxv3-from-livecd","status":"publish","type":"post","link":"http:\/\/www.c2s.co.nz\/blog\/diy-freeswitch-freepbxv3-from-livecd\/","title":{"rendered":"DIY FreeSWITCH &amp; FreePBXv3 from LiveCD"},"content":{"rendered":"<div class=\"8781ca4f97038dd0d58a1ad8af045721\" data-index=\"3\" style=\"float: none; margin:10px 0 10px 0; text-align:center;\">\n<script type=\"text\/javascript\"><!--\r\ngoogle_ad_client = \"ca-pub-6411751809866006\";\r\n\/* BlogHorizontalSlim *\/\r\ngoogle_ad_slot = \"6442664612\";\r\ngoogle_ad_width = 468;\r\ngoogle_ad_height = 60;\r\n\/\/-->\r\n<\/script>\r\n<script type=\"text\/javascript\"\r\nsrc=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\">\r\n<\/script>\n<\/div>\n<p>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\/<\/p>\n<p>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.<\/p>\n<p>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&#8217;t 100% accurately do all CDR stuff, and it bugs me recommending that to a client.<\/p>\n<p>I&#8217;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).<\/p>\n<p>What follows is a guide on booting a LiveCD (Debian!) and running FreeSWITCH &amp; FreePBXv3 from this live system. From there, it&#8217;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&#8217;m just going to give you a quick How-To on getting FreeSWITCH &amp; 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 \ud83d\ude42<\/p>\n<p><!--more--><\/p>\n<p>You&#8217;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.<\/p>\n<p>Start by grabbing yourself the LiveCD: http:\/\/cdimage.debian.org\/cdimage\/release\/current-live\/<\/p>\n<p>I used: i386\/iso-cd\/debian-live-504-i386-standard.iso<\/p>\n<p>Once you&#8217;ve downloaded it, burn it off or boot it up in VirtualBox<\/p>\n<p>Great! Now, become root:<\/p>\n<pre>sudo bash<\/pre>\n<p>Change the root password:rm<\/p>\n<pre>passwd<\/pre>\n<p>Enter something nice, coz we&#8217;re presuming you&#8217;re going to copy \/ paste via SSH for the rest of this.<\/p>\n<p>Now run:<\/p>\n<pre>apt-get update\napt-get install openssh-server<\/pre>\n<p>Once that&#8217;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.<\/p>\n<p>OK now before we run out of HDD space, we&#8217;re going to mount the USB drive.<\/p>\n<p>Use cfdisk to create a linux partition, then format it with (something like):<\/p>\n<pre>mkfs.ext3 \/dev\/sdb1\nmkdir \/mnt\/usb\nmount \/dev\/sdb1 \/mnt\/usb\n<\/pre>\n<p>You may need this if you&#8217;re working on a machine with a low amount of RAM and you find you run out of &#8220;disk space&#8221; on the ramdisk:<\/p>\n<pre>mkdir \/mnt\/usb\/src\nmkdir \/mnt\/usb\/freeswitch\nmkdir \/mnt\/usb\/archives\nrm -rf \/usr\/src\nln -s \/usr\/src \/mnt\/usb\/src\nln -s \/usr\/local\/freeswitch \/mnt\/usb\/freeswitch\nln -s \/var\/cache\/apt\/archives \/mnt\/usb\/archives\n<\/pre>\n<p>Now we want you to install all the following:<\/p>\n<pre>apt-get install php5 php5-xcache php5-xmlrpc php5-mysql php5-gd php5-cli \\\nbuild-essential git git-core autoconf libgdbm-dev libdb-dev subversion php5-curl \\\nautomake libtool libncurses5 libncurses5-dev php-db mysql-server-5.0 mysql-client-5.0<\/pre>\n<p>They&#8217;re all going to come in handy at some point for either FreePBXv3 or FreeSWITCH.<\/p>\n<p>Make note of your MySQL root password, you&#8217;ll need it for later on!<\/p>\n<p>Now we begin with the FreeSWITCH compile:<\/p>\n<pre>cd \/usr\/src\ngit clone git:\/\/git.freeswitch.org\/freeswitch.git<\/pre>\n<p>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&#8217;s actually recommended from what I can tell.<\/p>\n<pre>cd freeswitch.git\n.\/bootstrap.sh<\/pre>\n<p>This is the beginning of what could be a very long compile if you don&#8217;t have semi-recent hardware&#8230;<\/p>\n<p>Provided there&#8217;s no errors, proceed on to:<\/p>\n<pre>.\/configure<\/pre>\n<p>Now, I&#8217;m doing it this way rather than the proposed &#8220;quick n nasty&#8221; because for some reason it kept being unable to find the right libraries when I *know* they&#8217;re on the system. YMMV.<\/p>\n<p>Next we make with:<\/p>\n<pre>make<\/pre>\n<p>Then we make install:<\/p>\n<pre>make install<\/pre>\n<p>IF you get errors right away like I did, then try running:<\/p>\n<pre>make current<\/pre>\n<p>I&#8217;m unsure why, but it worked for me after make install errors (Thanks to bruce from #freeswitch).<\/p>\n<p>Next we install sounds:<\/p>\n<pre>make sounds-install moh-install<\/pre>\n<p>Tada, all done (For FreeSWITCH at least)!<\/p>\n<p>Note, you can also do the High Definition sounds with:<\/p>\n<pre>make uhd-sounds-install uhd-moh-install hd-sounds-install hd-moh-install<\/pre>\n<p>Start the service with:<\/p>\n<pre>\/usr\/local\/freeswitch\/bin\/freeswitch<\/pre>\n<p>You should be able to point a SIP device at your debian box&#8217; IP address, with Ext 1000 &amp; Secret of 1234, then dial 9999 or 5000 to test, as-per the instructions here: <a href=\"http:\/\/wiki.freeswitch.org\/wiki\/Quick_and_Dirty_Install\">http:\/\/wiki.freeswitch.org\/wiki\/Quick_and_Dirty_Install<\/a><\/p>\n<p>You can quit it at any time by typing &#8220;shutdown&#8221;.<\/p>\n<p>FreeSWITCH down. Now on to FreePBXv3!<\/p>\n<pre>cd \/var\/www\n<span style=\"font-family:Consolas, Monaco, 'Courier New', Courier, monospace;line-height:18px;font-size:12px;white-space:pre;\">svn co http:\/\/www.freepbx.org\/v3\/svn\/trunk\/ freepbx-v3\/<\/span><\/pre>\n<p><span style=\"font-family:Consolas, Monaco, 'Courier New', Courier, monospace;line-height:18px;font-size:12px;white-space:pre;\">Now we&#8217;re going to sort out the permissions:<\/span><\/p>\n<pre>chgrp -R www-data \/usr\/local\/freeswitch\/conf\/*\nchmod -R g+w \/usr\/local\/freeswitch\/conf\/*\nchmod 777 freepbx-v3\/freepbx\/logs\/\nchmod 777 freepbx-v3\/freepbx\/cache\/\nchgrp -R www-data freepbx-v3\/freepbx\/config\/*\nchmod -R g+w freepbx-v3\/freepbx\/config\/*\nmkdir freepbx-v3\/upload\nchgrp -R www-data freepbx-v3\/upload\nchmod -R g+w freepbx-v3\/upload<\/pre>\n<p>Debian uses www-data for the http group, instead of apache.<\/p>\n<p>We&#8217;re not going to bother with mod_rewrite, I&#8217;m lazy and it&#8217;s not crucial.<\/p>\n<p>Now, go to http:\/\/debian.ip\/freepbx-v3\/<\/p>\n<p>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&#8217;re onto the actual configuration:<\/p>\n<p>Leave the host as 127.0.0.1, but set the username as &#8220;root&#8221; and the password as the one you defined earlier. Pick your timezone as applicable and hit Next.<\/p>\n<p>Create a Master Admin account and hit Next<\/p>\n<p>The defaults are fine on the next page, leave it as the &#8220;FreeSWITCH Driver&#8221; and hit Next, twice (To tell it it&#8217;s safe to overwrite the config files).<\/p>\n<p>The default selections are fine for &#8220;packages&#8221; to be installed, click next, twice (to ignore the errors).<\/p>\n<p>We&#8217;re not ready to install! Hit the button to begin the process \ud83d\ude42<\/p>\n<p>It&#8217;ll then say Installation Complete, click the link and begin using FreePBXv3!<\/p>\n<p>Don&#8217;t forget, you may need to restart freeswitch if you killed it earlier, with:<\/p>\n<pre>\/usr\/local\/freeswitch\/bin\/freeswitch<\/pre>\n<p>I&#8217;ll post a brief intro to FreePBXv3 shortly. In the mean time, enjoy, and please post feedback!!<\/p>\n<p><strong>NOTE:<\/strong> 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&#8217;s own, however we&#8217;ve accomplished the goal of this post, to get FreeSWITCH &amp; FreePBXv3 up and running on a LiveCD in no time at all! From here, you&#8217;ll need to configure everything with FreePBXv3<\/p>\n\n<div style=\"font-size: 0px; height: 0px; line-height: 0px; margin: 0; padding: 0; clear: both;\"><\/div>","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[4],"tags":[20,47,68,69,70,106],"class_list":["post-219","post","type-post","status-publish","format-standard","hentry","category-how-tos-guides-tech-info","tag-asterisk","tag-debian","tag-freepbx","tag-freepbxv3","tag-freeswitch","tag-livecd"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pWi3e-3x","_links":{"self":[{"href":"http:\/\/www.c2s.co.nz\/blog\/wp-json\/wp\/v2\/posts\/219","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.c2s.co.nz\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.c2s.co.nz\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.c2s.co.nz\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/www.c2s.co.nz\/blog\/wp-json\/wp\/v2\/comments?post=219"}],"version-history":[{"count":0,"href":"http:\/\/www.c2s.co.nz\/blog\/wp-json\/wp\/v2\/posts\/219\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.c2s.co.nz\/blog\/wp-json\/wp\/v2\/media?parent=219"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.c2s.co.nz\/blog\/wp-json\/wp\/v2\/categories?post=219"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.c2s.co.nz\/blog\/wp-json\/wp\/v2\/tags?post=219"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}