1. Introduction

This guide will allow you to install a voip server running …

We will be using the default install of Debian and installing Asterisk from source and compiling. Freepbx will be downloaded from the website and installed.

Debian is the operating system, Asterisk is the PBX and Freepbx is the configuration tool for Asterisk. We have chosen to use these three tools because …

Debian in my opinion is the best Linux distribution, Asterisk is the best PBX available to us and Freepbx is the best config tool. I have used all these things in the past and find them a great combination as do many others.

Note
This document written under Ubuntu Linux from the command line using midnight commander as an editor and then it was processed using the asciidoc tool. nice eh?

We really need to appreciate all the people who give us this great software free of charge, they are truely generous.

Consider that if you use a setup like this in a business with 5 or more phones, you can save thousands of dollars a year in call costs. Think about donating a portion of that money to some of the companies in this doco so they can keep developing great apps like these.

2. Disclaimer

I think this is a pretty good doc however I am sure something is missing and it may not work for everyone. I have reinstalled using this doc from scratch about 5 times just to iron out all the bugs. I am not responsible for anything that goes wrong, so dont blame me. This is a complete install. Following this doco on an existing OS probably will give you strange issues, with those, you are on your own. If you follow all the instructions, you are going to wipe everything on your hard disk. Be aware of that and dont use your family photo's hard disk.

3. Prerequisites

3.1. You will need …

Some will disagree on the CPU requirements here and I am not going to argue about that. What I will say is that for a 100 person call center, this pc is not going to cut it. In all cases, monitor the cpu and memory usage on your machine under different call loads. The easiest way to do that is to login to the console and run "top")

3.2. Timeline

This howto was written from a bare metal install and took many days to research, install and document. It should take you considerably less time to get running. Somewhere around the 3 hour mark you should be able to dial a couple of extentions. Following this, the configuration fun is endless.

3.3. What will I end up with?

This howto is not a magic bullet. Finishing this howto will ensure you have a working VOIP server that you can add extentions and communicate between them. There are no hardware components required (other than the machine itself) You will also be able to add conference rooms and communicate with the outside world. Heading over to someone like Nerd Vittles will remind you how much more can be done with Asterisk and other open source gems.

3.4. Can I use this for a company or business?

Yes, this is a solid and stable build suitable for deployment in an office environment. Be aware there is no security in its basic form. Things such as firewalls and usernames and passwords should be added to protect the box from bad things. That is a whole other document.

4. Getting Started

4.1. Installing Debian

You need to get a Debian ISO from the website (try to use Bittorrent links if you can), this way we are giving back to the community in a small way by easing the burden on the download servers.

Burn the ISO to a cd and pop it in the cd draw and begin the installation.

Debian should now be detecting your hardware and for DHCP on the network

Debian should now be scanning the disks

this is the last chance to back out, (all previous data on the disk will be destroyed if you go ahead now.)

The system should now be formatting for a while …

At this point Debain will be installing a few things so just wait some more …

Debian will scan the mirror now and see what apps are there ;) this usually takes a while even on a fast connection

Note
Always select this as it will allow the guys & girls to ensure a better Debian product in the future by (anonomously) monitoring packages people are installing
Note
Selecting the desktop will install mountains of stuff you dont need on a server. Later we will install a minimal GUI that will give us more control and less bloat than the desktop selection of software.

Time for a quick coffee

Install should now be complete

4.2. Post install and testing

Now the install has completed, the first reboot should be done and you can login as root using password from above. A few tools I always like to use are listed below, install them now.

test the file manager by typing mc at the prompt

4.3. Setup the base Gnome gui

Setup Gnome so we can have much fun in a comfortable environment.

Install tomboy notes for a place to put all that info you pick up on the way.

Install ntp to set the PC clock accurately and that of the phones you connect later

5. Installing Asterisk

After doing the above, we need to get Asterisk from the Digium svn website. We use the source and compile it ourselves.

5.1. Downloading the source files

At this point we are going to get the source files so make sure you are logged in as root and change to the linux src directory

Note
To get Asterisk from the SVN repository, we need to know which version to download. Goto the asterisk web page (www.asterisk.org/downloads) and check what version is currently released as stable. (currently 1.4.11) Then we get that version from the svn site. Use this method to get the up to date versions of addons, zaptel, libpri as well. Use the same path in each of the examples, only changing the last few digits according to the currently released version.

5.2. Setup the build environment

Because we are installing from source, they (the source files) will rely on other components of the operating system. The build environment sets up those other components so there wont be errors during the building of the source.

at this point, we need to configure the linux-source that we just downloaded, the other apps will be fine.

5.3. Compiling the applications

The order we compile the applications is important. Compiling them out of order would mean that some of the dependancies of an application might not be fulfilled and things wont work as expected. You will need to be inside the actual directory of the source you are trying to install. eg cd zaptel compile cd libpri compile

Note
If you make a mistake and stop halfway through compiling, no problem but you will need to run make clean then ./configure and make install again.
Modules

Under your /lib/modules dir, you may end up with an extra directory put there by Asterisk. Create a link from the Asterisk modules dir into the original modules directory (asterisk wont find the new modules otherwise).

5.4. Free PBX

Freepbx is a web based GUI for control of the Asterisk server. It does all the hard work for you so no hand editing of config files. As with Asterisk, check the latest version from the webpage and use that version instead of the one here.

open mc and highlight the archive, press F2 and extract the freepbx archive into the /usr/src directory

Note
The info here is largely from the "install" document inside the freepbx archive with some adjustments on the command line related to Debian.

Need to modify /etc/asterisk.conf and look for the pid line which will look like …

Note
you will now be asked a series of questions which are pretty easy so I am not going to walk you through them here. In most cases, the defaults will be fine. check /etc/amportal.conf if you need to change anything related to the freepbx install.

5.5. Debian, Asterisk, FreePBX weirdness

Music on hold

wont work unless we create a symlink from /moh to /mohmp3

asterisk permissions

need to add www-data to the asterisk group so it can read all the asterisk files and directories

Note
you need to reboot the box now. Failure to do this will mean you spend the rest of your days resolving weird permissions problems because the asterisk user isnt loaded, apache hasnt been restarted etc etc.

5.6. Testing the system

Now the fun part, asterisk is built and the gui is installed. Goto the localhost address. We installed apache-ssl so although there is a webpage at 127.0.0.1, it is the one at https://127.0.0.1/html (if you left the freepx setup as the default) that we are interested in.

There should be a green frog image in the top left hand corner and 3 links.

First link is for voicmail management (users)

Click on the panel (2nd) link and you will be prompted to install flash player. - Here you can see the status of all the extentions.

Click on the 3rd link and you should get the administration panel for the PBX. Click around a few places and make sure there are no errors or issues.

Adding some extentions

Click on the link on the left hand side and add two extentions. You can download any number of softphones to use with asterisk or use standard VOIP phones which are a good investment.

I am not going to explain much else on this as there are more than enough howto's on the web to setup a PBX once you have the GUI running. Most people have stopped reading by now anyway.

5.7. Testing the VOIP services

After setting it all up and you have a working system, you may need to change some things and then do a round of testing to make sure nothing has broken as a result of your changes. Below is a list of things to check as a matter of course.

5.8. Helpful commands

Thats it! Hope you enjoyed building your PBX. I tried to make this doc as easy as possible to follow, hope it has helped you. Feel free to distribute this as you like provided you dont remove my name from the document. Dont try to pass this off as your own work. Send me your feedback to the address at the top of the document. -Matt