tag:blogger.com,1999:blog-24621884352089352592024-03-14T00:23:11.610-07:00The Technical Side of Mo IshUnknownnoreply@blogger.comBlogger6125tag:blogger.com,1999:blog-2462188435208935259.post-79740878957604965192016-11-23T01:07:00.002-08:002016-11-23T01:07:20.554-08:00Technical Issues<br />
Hi all,<br />
<br />
Sorry for the delay in posts....Had some difficulty posting here due password issues (old blog etc) so created a new blog for my travels....<br />
<br />
Find it <a href="https://roadtoalaqsa.blogspot.co.uk/">https://roadtoalaqsa.blogspot.co.uk/</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2462188435208935259.post-39697102792638672382013-05-23T14:13:00.001-07:002016-06-06T12:49:21.877-07:00<br />
<h2 style="text-align: center;">
<span style="color: blue; font-size: x-large;">Enterprise Week at Henley College Coventry Playing with the Raspberry Pi and Asterisk</span></h2>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif;">
Just want to say a massive thank you to <a href="https://en-gb.facebook.com/HenleyCollege" target="_blank">Henley College Coventry</a> for inviting me to their Enterprise Week. It gave me an opportunity to demonstrate the single SSR switching circuitry along with the ability for Asterisk to control lighting remotely using an iPad.</div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif;">
<br /></div>
<div style="background-color: white;">
<span style="color: #222222; font-family: "arial" , sans-serif;">The students were great, asked lots of questions. These inquisitive minds is what makes the UK so great at bringing innovation to the masses. I turned a new leaf yesterday. Standing in front of students, helping young minds develop and understand the world of computing, I realised a sense of job satisfaction teachers must get every day. </span></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif;">
<br /></div>
<span style="font-size: small;"><b>TO THE STUDENTS</b></span><br />
<div style="background-color: white; color: #222222; font-family: arial, sans-serif;">
<br /></div>
<div style="background-color: white;">
<span style="color: #222222; font-family: "arial" , sans-serif;">The rest of this post is dedicated to these students who attended the class and those who missed out but really wanted to be there.....</span></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif;">
<br /></div>
<div style="background-color: white;">
<span style="color: #222222; font-family: "arial" , sans-serif;">Guys and </span><span style="color: #222222; font-family: "arial" , sans-serif;">Gals, </span><span style="color: #222222; font-family: "arial" , sans-serif;">The star of the show is <u>YOU </u>because <u>YOU </u>are the Future of UK TECH.</span></div>
<div style="background-color: white;">
<span style="color: #222222; font-family: "arial" , sans-serif;">I have two messages for you, the first is, as Gary says:</span></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;">
<br /></div>
<h2 style="text-align: center;">
<span style="color: red; font-size: x-large;">THERE IS NO DOUBT IN MY MINE, </span></h2>
<h2 style="text-align: center;">
<span style="color: red; font-size: x-large;"><u>YOU</u> ARE GOING TO KILL IT!!!</span></h2>
<br />
<span style="color: #222222; font-family: "arial" , sans-serif;">I don't want to dwell on there being only one girl in the room so... I wont...But I will say this...Girls, <b>YOU NEED TO </b>get involved, the UK silicon Valley needs ya, end of! </span><br />
<span style="color: #222222; font-family: "arial" , sans-serif;"><br /></span><a href="http://en.wikipedia.org/wiki/Gary_Vaynerchuk" style="color: #222222; font-family: arial, sans-serif;" target="_blank">Gary Vaynerchuk</a><span style="color: #222222; font-family: "arial" , sans-serif;"> is a massive inspiration to me and many many hackers, entrepreneurs, inventors and visionaries, so if you do nothing today, please please check him out on </span>YouTube<span style="color: #222222; font-family: "arial" , sans-serif;">, my favorite </span>vid<span style="color: #222222; font-family: "arial" , sans-serif;"> here:</span><br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/EhqZ0RU95d4?feature=player_embedded' frameborder='0'></iframe></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: center;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: center;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; text-align: left;">
<span style="color: #222222; font-family: "arial" , sans-serif;">My second message to you is plane and simple,</span><b> Get out there and hack</b><span style="color: #222222; font-family: "arial" , sans-serif;">, there are million, and I mean millions of problems to solve. Start with solving the simple ones you see and hear around you. A lot of people will say I don't know where to start so from here on, am going to dedicate this </span><span style="color: black; font-family: "times new roman";">blog</span><span style="color: #222222; font-family: "arial" , sans-serif;"> to helping you all get started. Ask me anything, you will get a reply. Email me directly at<span style="font-size: x-small;"><b> </b></span></span><span style="color: black; font-family: "times new roman";">mohammed</span><span style="color: #222222; font-family: "arial" , sans-serif;"> at </span><span style="color: black; font-family: "times new roman";">coventryprinting</span><span style="color: #222222; font-family: "arial" , sans-serif;"> dot com. You have my </span><span style="color: #222222; font-family: "arial" , sans-serif;">address now so you have no excuse.</span></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; text-align: left;">
<span style="color: #222222; font-family: "arial" , sans-serif;"><br /></span></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; text-align: left;">
<span style="color: black; font-family: "times new roman";">To get you started, I suggested Python as a great language to learn however, if you have a Raspberry PI and just want to kick off with basic programming skills I would start playing with Scratch. Here is a cool set of Labs to get you going...</span></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; text-align: center;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; text-align: center;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; text-align: center;">
<a href="http://bridges.brooklyn.cuny.edu/collegenow/modules/P3_GameProgDesign/Labs/GameProg_Lab_1.htm" target="_blank">LAB ONE</a></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; text-align: center;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; text-align: center;">
<a href="http://bridges.brooklyn.cuny.edu/collegenow/modules/P3_GameProgDesign/Labs/GameProg_Lab_2.htm" target="_blank">LAB TWO</a></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; text-align: center;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; text-align: center;">
<a href="http://bridges.brooklyn.cuny.edu/collegenow/modules/P3_GameProgDesign/Labs/GameProg_Lab_3.htm" target="_blank">LAB THREE</a></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; text-align: center;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif;">
If you want to get in to the kind of stuff we looked at in the presentation yesterday, have a look at the links in the following text:</div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif;">
The place to get the latest news in hacking, it's the only place to be every day:</div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; text-align: center;">
<a href="https://news.ycombinator.com/" target="_blank">HACKER NEWS</a></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif;">
The Open Source Telephony system created by Mark Spencer at Digium called <a href="http://www.asterisk.org/" target="_blank">Asterisk</a>:</div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; text-align: center;">
<a href="http://www.raspberry-asterisk.org/" target="_blank">The Raspberry PI PBX RasPXB</a></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif;">
Turning the Raspberry Pi Into an FM Transmitter:</div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; text-align: center;">
<a href="http://www.icrobotics.co.uk/wiki/index.php/Turning_the_Raspberry_Pi_Into_an_FM_Transmitter" target="_blank">PiFM</a></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; text-align: center;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; text-align: center;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif;">
One of the students asked me to explain how to connect LED's. She planned to use this for mood lighting, I would love to see this project develop, blog it out, the world can't wait to see what YOU can do with a PI.</div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif;">
All work and no play is not fun so here are the labs above, ready to play.....<a href="http://bridges.brooklyn.cuny.edu/collegenow/modules/P3_GameProgDesign/OtherMaterials/ExampleGames/Examples.htm" style="background-color: transparent; text-align: center;" target="_blank">Games</a></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif;">
Hope you enjoyed the post, leave me your comments...have fun and happy hacking!</div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif;">
Mohammed</div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif;">
Other cool links:</div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif;">
Who is Gary? <a href="http://en.wikipedia.org/wiki/Gary_Vaynerchuk" style="color: #1155cc;" target="_blank">http://en.wikipedia.org/wiki/<wbr></wbr>Gary_Vaynerchuk</a></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif;">
One of my Top Inspirations, Soichiro Honda, who's that you ask? <a href="http://en.wikipedia.org/wiki/Soichiro_Honda" style="color: #1155cc;" target="_blank">http://en.wikipedia.org/wiki/<wbr></wbr>Soichiro_Honda</a></div>
Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-2462188435208935259.post-47923245131788233202012-07-29T04:08:00.001-07:002012-07-29T04:09:34.391-07:00Home Automation For Under £30 - Part 2<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/TaONAhFaMuQ?feature=player_embedded' frameborder='0'></iframe></div>
<br />
<br />
PART 2 of the Home automation project. Again, using my limited knowledge, I have sellotaped together a Raspberry PI with the using of the GPIO pins to automate the process of switching home lighting (or LED in this case to emulate home lighting). <br />
<br />
The Idea here is to emulate the upstairs and downstairs landing lighting which works in a process where either one can be switched.<br />
<br />
Additionally, we will use the Asterisk PBX (http://www.asterisk.org) and a Softphone client (http://www.zoiper.com) on the Android to control the relay circuit. All instructions will be available on the here soon....Unknownnoreply@blogger.com7tag:blogger.com,1999:blog-2462188435208935259.post-68270128245662346192012-06-23T16:13:00.003-07:002012-06-23T16:15:47.506-07:00Home Automation under £30 - Lighting Control Using a Raspberry PI<br />
<br />
<b>Finally....I get my Home Automation project off the ground...... </b><br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div style="text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/6E83eCIlOMU?feature=player_embedded' frameborder='0'></iframe></div>
<br />
<br />Unknownnoreply@blogger.com10tag:blogger.com,1999:blog-2462188435208935259.post-23092762605886510312012-06-08T19:06:00.002-07:002012-06-08T19:06:49.424-07:00<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/OSTCdjA82fg?feature=player_embedded' frameborder='0'></iframe></div>
<br />
<h1 id="watch-headline-title" style="text-align: center;">
<span style="font-size: small;"><span class="long-title" dir="ltr" id="eow-title" title="Carputer or CarPC using a Raspberry PI, RaspbMC beta - XMBC">Carputer or CarPC using a Raspberry PI, RaspbMC beta - XMBC
</span></span></h1>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2462188435208935259.post-60000176892814432232012-06-01T02:28:00.001-07:002012-08-02T07:02:37.065-07:00Setup And Run Asterisk and FreeBPX on A Raspberry PIFinally recieved the Raspberry PI on Friday (25th May 2012) after a two and half year wait! My plan, which I had all that time to think about, discuss with others and have ready is still not concrete but initially, I have order 3 devices to play with.<br />
<br />
As a Asterisk Engineer, one of the first things I wanted to tackle was to install the latest Asterisk and FreePBX on it. I build Asterisk based PBX systems for a living, so this shouldn't be that difficult. I responded on http://www.raspberry-asterisk.org/ to say I was going to attempt this and report back but so far the Admin has not got back to me on how I can add there so I have written this up here.<br />
<br />
<div style="text-align: center;">
<span style="font-size: large;"><b><br /></b></span> <br />
<span style="font-size: large;"><b>This guide is for complete newbies in getting the Raspberry PI to get set-up and run as a IP PBX using Asterisk and FreePBX</b></span><br />
<span style="font-size: large;"><b> </b></span> </div>
<br />
I intended to install Asterisk and FreePBX 2.9 (this is a matter of choice as I am accustomed to the layout before 2.10). I purchased a 8GB SD card instead of 2GB, which is sufficient for just Asterisk 1.8 but not enough for FreePBX. Here's the install process....<br />
<br />
<b>Install Squeeze - Get The PI Ready</b><br />
Anyone with a Raspberry PI in their hands should first go though the following process and set up Debian Squeeze. For my setup, I had an 8GB SD Card. I downloaded Debian Squeeze for the PI from <a href="http://downloads.raspberrypi.org/download.php?file=/images/debian/6/debian6-19-04-2012/debian6-19-04-2012.zip" target="_blank">here </a>and the Win32DiskImager from <a href="http://www.softpedia.com/get/CD-DVD-Tools/Data-CD-DVD-Burning/Win32-Disk-Imager.shtml" target="_blank">here</a>, Stuck my SD card in to my windows laptop and fired up Win32 Disk Imager. Next, Unzipped the debian file and browsed to it in Win32 Disk Imager, select the correct drive letter in the drop down and let the imaging start. This is by far the quickest and dirtiest way to get Squeeze on to the SD.<br />
<br />
After completion, I launched a Live CD of GParted, which is an amazing tool to partition disks. I increased the swap partition to 300Mb and moved it to the end of the drive. I then rezised the rootfs partition to used all the unallocated space on the drive.<br />
<br />
<i>Alternatively, you can follow the information on <a href="http://blogs.arcsoftwareconsultancy.com/pi/2012/02/23/how-to-make-a-bootable-sd-card-for-the-raspberry-pi-using-windows/" target="_blank">this</a> great guide to go through and set up the drive properly and learn how to do the GParted stuff I mentioned above. </i><br />
<br />
<b>Internet Access on the Raspberry PI</b><br />
<br />
If you connect the PI to your local network which has a ADSL/CABLE router or mode, then it should have DHCP on. DHCP will provide it an IP address and this will be displayed on-screen when the PI boots up before the log in screen. If it doesnt, you need to get an IP and add this in manually. To do this, log in to the PI using the default username: pi and password: Raspberry and type the following command:<br />
<br />
<div style="color: #444444;">
<span style="font-size: x-small;">sudo vi /etc/network/interfaces</span></div>
<br />
<br />
<b>Using VI</b> : Edit the file using by pressing 'a' to insert text. Once editied, press escape to come out of editing mode.<br />
<br />
The IP parameters should be as follows with your specific IP address information:<br />
<br />
<span style="color: #444444; font-size: x-small;">iface eth0 inet static<br />address 192.168.1.100<br />gateway 192.168.1.1<br />netmask 255.255.255.0<br />network 192.168.1.0<br />broadcast 192.168.1.255</span><br />
<br />
<span style="font-size: small;">NOTE: Dont forget to comment/remove line stating:</span> <span style="font-size: x-small;"> </span><br />
<br />
<div style="color: #444444;">
<span style="font-size: x-small;">iface eth0 inet dhcp</span></div>
<br />
Additionally you will need to set up DNS in order to get out on the internet. This setting should be done in the resolve.conf file as follows:<br />
<br />
<div style="color: #444444;">
<span style="font-size: x-small;">sudo vim /etc/resolv.conf</span></div>
<br />
This should say something like:<br />
<br />
<div style="color: #444444;">
<span style="font-size: x-small;">nameserver 8.8.8.8</span></div>
<div style="color: #444444;">
<span style="font-size: x-small;">nameserver 192.168.1.1</span></div>
<div style="color: #444444;">
</div>
<br />
to test network connectivity, at the command line, type in<br />
<br />
<div style="color: #444444;">
<span style="font-size: x-small;">ping <your favourite serach engine.com></span></div>
<br />
Press CTRL+C to stop pinging.<br />
<br />
<br />
<br />
<b>Update Asterisk Install Pre-requisites</b> <br />
<br />
To start with, update the system and install the required componants by copying the command below: <br />
<br />
<div style="color: #444444;">
<span style="font-size: x-small;">sudo apt-get update</span><br />
<br />
<span style="font-size: x-small;">sudo apt-get -y install make gcc g++ libxml2 libxml2-dev ssh libncurses5 libncursesw5 libncurses5-dev libncursesw5-dev linux-libc-dev sqlite libnewt-dev libusb-dev zlib1g-dev libmysqlclient15-dev libsqlite0 libsqlite0-dev bison openssl libssl-dev libeditline0 libeditline-dev libedit-dev mc sox libedit2 libedit-dev curl libcurl4-gnutls-dev apache2 libapache2-mod-php5 php-pear openssh-server build-essential openssh-client zlib1g zlib1g-dev libtiff4 libtiff4-dev libnet-telnet-perl mime-construct libipc-signal-perl libmime-types-perl libproc-waitstat-perl mpg123 libiksemel-dev php5 php5-cli mysql-server php5-mysql php-db libapache2-mod-php5 php5-gd php5-curl mysql-client vim</span></div>
<br />
<b>Dowload and </b><b>Extract </b><b>Asterisk</b> <br />
<br />
To Download and Extract asterisk, enter the commands as below:<br />
<br />
<div style="color: #444444;">
<span style="font-size: x-small;">cd /usr/src </span></div>
<div style="color: #444444;">
<span style="font-size: x-small;">sudo wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-1.8-current.tar.gz </span></div>
<div style="color: #444444;">
<span style="font-size: x-small;">sudo tar xvfz asterisk-1.8-current.tar.gz </span></div>
<div style="color: #444444;">
<span style="font-size: x-small;">cd asterisk-1.8*</span></div>
<br />
<b>Set Up Correct Compilation For ARM Platform</b><br />
Using your favorite editor, make the change below. I prefer VIM, an enhanced version of the popular VI command line editor:<br />
<br />
<div style="color: #444444;">
<span style="font-size: x-small;">sudo vim makeopts.in</span></div>
<br />
Search for the word "proc=" in the file and change this to read "proc=arm". For those new to VIM, move to the end of this line using the arrow keys and press 'a', then remove all the chractors before the = sign using back space and type in 'arm'. Finally press escape to come out of editing mode. Then press SHIFT+Z+Z to save and exit the file.<br />
<br />
<b>Compile and Install Asterisk</b><br />
Using the following commands:<br />
<br />
<span style="color: #444444; font-size: x-small;">sudo ./configure<br />sudo make<br />sudo make install<br />sudo make samples<br />sudo make config</span><br />
<br />
Finally, restart the PI by typing the fillowing command:<br />
<br />
<span style="color: #444444; font-size: x-small;">sudo init 6</span><br />
<br />
<div style="text-align: center;">
<b>Congratulations </b>- Asterisk installed is now installed</div>
<br />
<br />
<br />
To test the install, log in to the PI and type the following command:<br />
<br />
<div style="color: #444444;">
<span style="font-size: x-small;">sudo asterisk -r</span></div>
<br />
<br />
<br />
If this all works, great...lets move on to installing FreePBX.<br />
<br />
<b>Create And Setup Asterisk Users And Groups Permissions</b><br />
<br />
<span style="color: #444444; font-size: x-small;">sudo useradd -c "Asterisk PBX" -d /var/lib/asterisk asterisk</span><span style="color: #444444; font-size: x-small;">sudo </span><span style="color: #444444; font-size: x-small;">chown -R asterisk:asterisk /var/run/asterisk</span><span style="color: #444444; font-size: x-small;">sudo </span><span style="color: #444444; font-size: x-small;">chown -R asterisk:asterisk /var/log/asterisk</span><span style="color: #444444; font-size: x-small;">sudo </span><span style="color: #444444; font-size: x-small;">chown -R asterisk:asterisk /var/lib/php/session/</span><br />
<br />
<br />
<b>Install Pear and DB</b><br />
FreePBX uses the php pear repository and specifically requires the database repositor. Enter the commands below to install them:<br />
<br />
<div style="color: #444444;">
<span style="font-size: x-small;">sudo apt-get install php-pear</span></div>
<div style="color: #444444;">
<span style="font-size: x-small;">sudo pear install db</span></div>
<div style="color: #444444;">
<br /></div>
<br />
<b>Download And Extract FreePBX</b><br />
<br />
To Download and Extract FreePBX, enter the commands as below:<br />
<br />
<span style="font-size: x-small;"><span style="color: #444444;">cd /usr/src/</span><br style="color: #444444;" /><span style="color: #444444;">sudo wget http://mirror.freepbx.org/freepbx-2.9.0.tar.gz</span><br style="color: #444444;" /><span style="color: #444444;">tar zxvf freepbx*</span></span><br />
<br />
<br />
<b>Start The MySQL Server And Import In The FreePBX Data</b><br />
Lets start the database server and import in the tables FreePBX will require using th following commands:<br />
<br />
<div style="color: #444444;">
<span style="font-size: x-small;">sudo service mysql start<br />cd /usr/src/freepbx*<br /><br />sudo mysqladmin create asterisk<br />sudo mysqladmin create asteriskcdrdb<br />sudo mysql asterisk < SQL/newinstall.sql<br />sudo mysql asteriskcdrdb < SQL/cdr_mysql_table.sql</span></div>
<div style="color: #444444;">
<span style="font-size: x-small;">sudo mysql </span></div>
<br />
<br />
<br />
<br />
<br />
Lets add the mysql user and give it the correct permissions under the MySQL prompt:<br />
<br />
<span style="font-size: x-small;">GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY '******';<br />GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY '******';</span><span style="color: #444444; font-size: x-small;"><br />flush privileges;</span><br />
<span style="color: #444444; font-size: x-small;">exit</span><br />
NOTE where I have put '******', replace with your own password. Please keep a log of this as it will be required later. The password should secure (aplhanumeric with symbols) and in single speech marks as seen above <br />
<br />
Now lets secure MySQL with a root password of your choice (See note above).<br />
<br />
<span style="color: #444444; font-size: x-small;">sudo mysqladmin -u root password '******'</span><br />
<br />
<br />
<b>Restart Asterisk With Correct Permissions</b><br />
<br />
cd /use/src/freepbx*<br />
sudo service asterisk stop<br />
sudo ./start_asterisk start<br />
<br />
<br />
<b>Set The Correct Timezone for PHP</b><br />
Open the PHP Configuration file:<br />
<br />
<span style="font-size: x-small;">sudo vim /etc/php5/apache2/php.ini</span><br />
<br />
Under Module Settings, change the timezone accordingly: <br />
<br />
<span style="color: #444444; font-size: x-small;">;;;;;;;;;;;;;;;;;;;<br />; Module Settings ;<br />;;;;;;;;;;;;;;;;;;;<br /><br /><br />[Date]<br />; Defines the default timezone used by the date functions<br />; http://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone<br /><br /><span style="font-size: small;"><br style="color: black;" /><span style="color: black;">Uncomment date.timezone and set to the correct setting according to the link above. In my case, this was as follows:</span></span><br /><br />date.timezone = Europe/London</span><br />
<br />
To do this, move over the first charactor in the line, press 'a' the backspace to uncomment the line. Then move to the end of the line and type in your timezone after the '='. Press escape to come out of editing mode and save the file using the SHIFT+Z+Z combination.<br />
<br />
<br />
<b>Setup Apache For FreePBX and Asterisk</b><br />
Apache user and group will need to be set to asterisk. To do this, run the following command to open the Apache configuration file:<br />
<br />
sudo vim /etc/apache2/apache.conf<br />
<br />
Find the line that states:<br />
<br />
<span style="color: #444444; font-size: x-small;">User www-data<br />Group www-data </span><br />
<br />
<br />
Change these to read:<br />
<br />
<div style="color: #444444;">
<span style="font-size: x-small;">User asterisk</span></div>
<span style="color: #444444; font-size: x-small;">Group asterisk</span><br />
<br />
For those new to VIM, move to the end of this line using the arrow keys and press 'a', then
remove all the charactors before the user or group using back space and type in
'asterisk'. Finally press escape to come out of editing mode. Then press
SHIFT+Z+Z to save and exit the file. <br />
<br />
Additionally, change the default sites settings by:<br />
<br />
<div style="color: #444444;">
<span style="font-size: x-small;">sudo vim /etc/apache2/sites-available/default</span></div>
<br />
Under tags "<Directory />" and "<Directory /var/www/>" change the following settings:<br />
<br />
<br />
<br />
<span style="color: #444444; font-size: x-small;">Options FollowSymLinks<br />AllowOverride All</span><br />
<br />
<br />
For those new to VIM, follow the origional instuction on editing above using the 'a' to go in to editing mode and escape key to come out of editing mode. Remember to save the file using SHIF+Z+Z.<br />
<br />
Finally restart apache using the following command:<br />
<br />
<div style="color: #444444;">
<span style="font-size: x-small;">sudo service apache2 restart</span></div>
<br />
<br />
<br />
<b>Install FreePBX</b><br />
To install FreePBX, you will need to specify the username and password to the database we setup earlier, start by typing in the following command:<br />
<div style="color: #444444;">
<span style="font-size: x-small;"><br /></span></div>
<div style="color: #444444;">
<span style="font-size: x-small;">sudo ./install_amp --username=asteriskuser --password=******</span></div>
<br />
For each of the prompts, just hit enter except when prompted for<br />
<br />
<span style="color: #444444; font-size: x-small;">Enter the path to use for your AMP web root:<br />
[/var/www/html]</span><br />
<br />
<span style="color: #444444; font-size: x-small;">in this case type the following:</span><br />
<br />
<span style="color: #444444; font-size: x-small;">/var/www</span><br />
<br />
Then hit enter. You should see something like this :<br />
<br />
<span style="color: #444444; font-size: x-small;">Checking for PEAR DB..OK<br />Checking for PEAR Console::Getopt..OK<br />Checking user..OK<br />Checking if Asterisk is running..running with PID: 2591..OK<br />Checking for /etc/amportal.conf../etc/amportal.conf does not exist, copying default<br />Creating new /etc/amportal.conf<br /><br />Enter the hostname of the 'asterisk' database:<br /> [localhost]</span><br />
<span style="color: #444444; font-size: x-small;">Enter a USERNAME to connect to the Asterisk Manager interface:<br /> [admin]<br />Enter a PASSWORD to connect to the Asterisk Manager interface:<br /> [amp111]<br />Enter the path to use for your AMP web root:<br /> [/var/www/html] /var/www<br /><br />Enter the IP ADDRESS or hostname used to access the AMP web-admin:<br /> [xx.xx.xx.xx]<br />Enter a PASSWORD to perform call transfers with the Flash Operator Panel:<br /> [passw0rd]<br />Use simple Extensions [extensions] admin or separate Devices and Users [deviceanduser]?<br /> [extensions]<br />Enter directory in which to store AMP executable scripts:<br /> [/var/lib/asterisk/bin]<br />Created /var/lib/asterisk/bin<br />Enter directory in which to store super-user scripts:<br /> [/usr/local/sbin]</span><span style="color: #444444; font-size: x-small;"><br /></span><br />
One this is complete, lets set the file permissions for FreePBX to be accessable to apache users:<br />
<br />
sudo chmod 777 /var/www/* -R <br />
<br />
<b>Finally Restart all services</b><br />
Although in a lot of the cases, service restart is not required, I have had issues in previous versions of FreePBX, therefore as a final step, restart all the service to ensure they start with the correct permissions:<br />
<br />
sudo amportal stop<br />
sudo service apache2 stop<br />
sudo service mysql stop<br />
<br />
sudo service apache2 start<br />
sudo service mysql start<br />
sudo amportal start<br />
<br />
<div style="text-align: center;">
<b>Congratulations </b>- Free PBX is now installed.</div>
<div style="text-align: left;">
<br /></div>
To test the install, open your favourite browser on another PC and browse to the address of your PI <br />
<br />
<br />Unknownnoreply@blogger.com39