Installation

Installing the FreePBX application

FreePBX is a program that works together with Asterisk and a number of other programs to make it easy to set-up and configure a VOIP PBX. By itself, FreePBX won't do anything. You also need to install Linux, Asterisk, Dahdi, Postfix/Sendmail, TFTP, and a host of other programs.

If you are not an expert with Linux and its dependent components, you'll want to choose and install a Distro. If you are an expert, you can simply install FreePBX on top of an existing Linux/Asterisk installation.

We'll cover both, below.

The Easy Way (use a Distro)

There are a number of distributions ("Distros") available that will automatically install include FreePBX, Linux, and all the other components you need. When you use a distribution, you avoid having to learn how to install, compile, and configure each of these required components. A good distribution comes with everything you need to get started.

There are several distributions available, including the FreePBX Distro, PBX In A Flash, AsteriskNOW and Elastix. The easiest way to install FreePBX is to download the FreePBX Distro from the download page. For step by step instructions to install the FreePBX distro, click on this link: Installing the FreePBX Distro

Be aware that doing so almost always involves wiping the contents of every drive on the computer, so only install a distro on a machine whose contents you don't mind losing!

For some suggestions on what to do after you finish the installation read about the First Steps After Installation.

For information on the release versions and how to upgrade the FreePBX Distro read Upgrading the FreePBX Distro.

Be sure not to confuse "FreePBX" (which is a program) with the FreePBX Distro (which is a distribution that includes FreePBX and all the other stuff you need).

The Hard Way

The hard way to install FreePBX is to set-up a machine running Centos 5.5, Asterisk 1.4/1.6 or 1.8, and all other required applications.

FreePBX is an application that is built on the LAMPA stack, so in theory any system running this stack could run FreePBX.

If you already have Linux, Asterisk, and all related applications installed, you can download and install FreePBX using the following commands:

cd /usr/src
wget http://mirror.freepbx.org/freepbx-2.9.0.tar.gz
tar zxvf freepbx-2.9.0.tar.gz
cd /freepbx-2.9.0
/.start_asterisk start
/.install_amp

For instructions on installing Asterisk 1.8, see this forum post:

http://www.freepbx.org/forum/freepbx/installation/asterisk-1-8-installat...

First Steps After Installation

For some suggestions on what to do after you finish the installation read this:

http://www.freepbx.org/support/documentation/installation/first-steps-af...


Asterisk Extra Sounds

If you are using FreePBX in an embedded enviornment, you may be interested in reducing the overall size of the files necessary for FreePBX. FreePBX uses sounds from the asterisk-extra-sounds package (from Digium), but doesn't necessarily need all 34M of the sounds.

As of FreePBX 2.5, you need the following sounds from the asterisk-extra-sounds package to be in /var/lib/asterisk/sounds:

activated
added
all-circuits-busy-now
an-error-has-occured
at-tone-time-exactly
call-forwarding
call-fwd-no-ans
call-fwd-on-busy
call-fwd-unconditional
call-waiting
cancelled
cannot-complete-as-dialed
check-number-dial-again
day
de-activated
disabled
do-not-disturb
enabled
enter-conf-pin-number
enter-num-blacklist
enter-password
ent-target-attendant
extension
feature-not-avail-line
for
from-unknown-caller
goodbye
ha/phone
if-correct-press
im-sorry
info-about-last-call
is-curntly-unavail
is-in-use
is-set-to
is
location
number
num-was-successfully
one-moment-please
please-enter-your
pls-try-call-later
pm-invalid-option
press-0
press-1
press-2
press-3
press-4
press-5
press-6
press-7
press-8
press-9
press-star
privacy-to-blacklist-last-caller
reception
sorry-youre-having-problems
speed-dial-empty
speed-dial
telephone-number
to-call-this-number
to-listen-to-it
with
your


Enabling Device and User Mode

What is Device & User Mode?

For information on what Device & User Mode does, click here:

http://www.freepbx.org/support/documentation/module-documentation/freepb...

Enabling Device and User Mode

If you're using FreePBX 2.9 (or later), you can easily change from Extensions mode to Device and User mode (and back) using the "Advanced Settings" module. Under the System Setup heading, change the "User & Devices Mode" pull-down from "extensions" to "device and user". The click the green check box that appears to the right of that option to confirm your selection. Then click the orange bar at the top of the screen to reload FreePBX.

If you're using FreePBX 2.8 (or earlier) and you'd like to enable Device and User Mode, you'll need to edit one of the FreePBX configuration files. Open a command prompt on your PBX (either by sitting down in front of the machine or by using the Java SSH module that FreePBX provides) and type the following:

cd /etc
nano amportal.conf

Then change AMPEXTENSIONS=extensions

to

AMPEXTENSIONS=deviceanduser

When you're done editing the file, hit Ctrl-O to save, and Ctrl-X to Exit.

If you will be assigning users to devices in the FreePBX Web GUI only, then you're done. This change can be done on the fly, no restart needed. Once you do this, the "Extensions" module will disappear and be replaced by a "Devices" module and a "Users" module.

If you don't like device and user mode, and you're using FreePBX 2.9, just change it back in the "Advanced Settings" module. If you're using FreePBX 2.8, just change AMPEXTENSIONS= back to

AMPEXTENSIONS=extensions

Enabling Message Waiting Indications

If you're using a distribution with Asterisk 1.6 or 1.8, you may find that Message Waiting does not work once you enable Device and User Mode. If that happens, you can correct it by enabling pollmailboxes.

If you're using FreePBX 2.9, log in to the FreePBX GUI using a web browser and select PBX Adminstrator. At the top on the left hand side, select "setup." Then select the "voicemail admin" module. At the top, center of the screen, select "settings." Scroll down until you find the setting called "pollmailboxes" and change it from "undefined" to "yes." Immediately above "pollmailboxes" you'll see "pollfreq." By default, asterisk will update MWI every 30 seconds. If you want updates more frequently, such as every 15 seconds, enter the number of seconds you want MWI updated in the "poll freq" field.

When you're done, scroll to the bottom and hit submit. Now go to the command line on your PBX and type "amportal restart."

If you're using a version of FreePBX prior to 2.9, you'll have to do everything from the command line. Get to the command line on your machine and type the following:

cd /etc/asterisk
nano voicemail.conf

Under the [general] section, create the following new entries:

pollmailboxes=yes
pollfreq=15

Then hit Ctrl-O to save, and Ctrl-X to Exit.

Then issue the following command:

amportal restart

Enabling Dynamic Hints

If you plan to allow users to login and logout of devices on the fly (using a feature code designated in the Feature Codes module), you also need to enable DYNAMICHINTS.

If you're using FreePBX 2.9 or later, you can enable Dynamic Hints from the "Advanced Settings" module, after you set Display ReadOnly Settings = True.

If you're using FreePBX 2.8 or earlier, you have to go to your Linux command prompt and issue the following commands:

cd /etc
nano amportal.conf

Remove the # and leading spaces before the line that reads:

# DYNAMICHINTS=true

so that it reads:

DYNAMICHINTS=true

When you're done editing the file, hit Ctrl-O to save, and Ctrl-X to Exit.

If you enable DYNAMICHINTS in ANY version of FreePBX, you need to make sure that execincludes=yes appears in asterisk.conf:

cd /etc/asterisk
nano asterisk.conf

Add the following line under [options], if it isn't already there:

execincludes=yes

Ctrl-O to save
Ctrl-X to Exit

If the execincludes=yes was already there under [options], you're done. If you had to add execincludes=yes, then you need to restart asterisk:

amportal restart


First Steps After Installation

After you finish installing FreePBX, the FreePBX Distro, or another Distro that includes FreePBX, there are a few things you want to do first:

1. LOGIN TO THE FREEPBX GRAPHICAL USER INTERFACE ("GUI"): Using another machine on your same network, open a web browser and enter the IP address of your PBX.

If you don't know the IP address of your PBX, go to the Linux console/command prompt. You can login here using the username "root" without quotes, and the Root password you selected during installation. After you login, type "ifconfig" at the command line and determine the IP address of your machine (to the right of eth0). Then type "exit" to return to the login screen.

If you're using the FreePBX Distro, you'll be asked to set your default username and password the first time you login. That username and password will be used in the future to access the FreePBX configuration screen. You will also be asked to set the "FOP Password" which you can use to access the "Flash Operator Panel."

Note: These passwords do not change the Root password used to login to the Linux command prompt! They are only used for access to the web interface.

The main FreePBX screen will offer you four options: PBX Adminstrator will allow you to configure your PBX. The default username is "admin" and the default password is "admin." Your Distro may have already changed the default password, and if so, use whatever you set during the installation process.

The User Control Panel (aka ARI) allows users to listen to their voicemail mesages and change certain features such as call forwarding. Users login using their extension number and voicemail password. The Administrator logs in using the username "admin" and the password set-up during the install (or the default, which is ari_admin).

The Flash Operator Panel is a screen that allows an operator to control calls, using the FOP Password you configured above. It is disabled by default in the FreePBX Distro, but can be enabled in the Advanced Settings Module, by changing "Disable FOP" to False, clicking the green check-box to the right that appears after changing it to False, and then clicking the Orange "Apply Configuration Changes" at the top.

2. SET A STATIC IP ADDRESS: You can do this by configuring your DHCP server to issue the same IP address to your PBX every time it boots, or by configuring the PBX to use a static IP address instead of DHCP.

If you are using the FreePBX Distro or any distro with FreePBX 2.9, you can set a static IP address using the web interface. Using another machine on your network, point your browser at the IP address of your PBX. Select PBX Administrator. Click Tools, System Admin on the left hand side of the screen, and then Network Settings, on the right hand side of the screen.

If you set a static IP address, be sure to also set your subnet mask (typically 255.255.255.0), default gateway (usually 192.168.1.1), and DNS servers (you can't go wrong with 8.8.8.8 and 8.8.4.4). Be sure to Save and then exit. When you're done, click "Save Settings."

If you're using a distribution that includes an earlier version of FreePBX (2.8 or earlier), you'll probably need to login to the command prompt. Most versions on Linux allow you to set the IP address by typing "setup" or "netconfig" or "system-config-network" from the Linux command prompt. Use the TAB key to move from option to option, and press the ENTER key or SPACE bar to select one. When you return to the command line, issue the following command in order to apply the changes:

service network restart

Then issue this command to verify your settings:

ifconfig

Then try pinging something on the internet to make sure you can reach it:

ping www.google.com

Hit CTRL-C to abort the ping operation. If the ping is not successful, try setting the IP address again.

3. CHANGE THE DEFAULT FREEPBX GUI PASSWORD: This is only necessary if you didn't change the default password during your installation. Using the web interface, click Setup, Administrators on the left hand column, and then click on "admin" on the right. Change the admin password to a new, secure password. Click "Submit Changes" at the bottom, and then click "Apply Configuration Changes" at the top.

4. UPDATE FREEPBX MODULES AND INSTALL MISSING MODULES: Click Tools – Module Admin on the left hand side. Click “Check for Updates Online.” Click “Upgrade All.” You may wish to review the list of modules and change the major upgrades, i.e. “x.x update module” to “no action.” Click Process. When prompted, click “Confirm.” This will upgrade all currently installed modules. The screen will go dark and a smaller white window will appear showing the status (you may have to scroll up to find it). When prompted, click “return”. You may have to scroll down inside the smaller white window to see the “return” button. Click the orange bar at the top of the screen that reads “Apply Configuration Changes.” The upgrade is now complete.

If you want to install new modules (each module adds new features to FreePBX, so you probably want all of them just to try them out), then after clicking “Check for Updates Online,” click “Download all.” If you don’t want to upgrade to the next version of FreePBX, then go to the “x.x upgrade tool” and change the action to “No action.” Click Process.

The system may present you with an error screen that indicates that some modules cannot be installed because other modules are required. If that’s the case, proceed with the installation, and then repeat the download process again to get the modules that couldn’t be installed the first time.

Click “Confirm.” This will install all of the available new modules (unless you changed their action to “no action”). The screen will go dark and a smaller white window will appear showing the status. You may have to scroll up to see the smaller white window. When prompted, click “return”. You may have to scroll down inside the smaller white window to see the “return” button. Click the orange bar at the top of the screen that reads “Apply Configuration Changes.” The upgrade is now complete.

If you got an error message stating that some modules couldn’t be installed, go back to “Tools – Module Admin” and “Check for Updates Online” again. Repeat the process until there are no new or upgradeable modules.

5. CONFIGURE ASTERISK SIP SETTINGS: The Asterisk SIP Settings pages has one section that you MUST modify and one section that you may want to modify:

NAT SETTINGS (Must Modify):

Unless you have your PBX on a public IP address (which is a very bad idea), then you need to tell FreePBX which IP addresses are internal addresses and which IP addresses are external, public IP addresses. It is important for FreePBX to have this information so that it can adjust the SIP headers to use your external IP address when it is contacting extensions outside of your local network.

Even if you have your PBX in a public IP, you still want to modify these settings and hit submit, to avoid a bug in Asterisk, which we'll explain in more detail at the bottom of this section.

Open your browser and access the FreePBX GUI. Click on "Tools," and then "Asterisk SIP Settings." If this module is not available on your installation of FreePBX, you can install it using the "Module Admin" module.

Under NAT Settings, click "Auto Configure." If FreePBX correctly enters your static IP address, your internal network address ending in .0 (i.e., 192.168.1.0), and your subnet (usually 255.255.255.0), then click "submit changes" and then click the orange bar to reload Asterisk.

If FreePBX doesn't accurately enter your static IP address and local address, enter them manually. If you have an IP address that never changes (i.e., a static IP addresss), you can select "Static IP," and enter the IP address into the "External IP" field. If your external IP address changes, you may wish to register for a Dynamic IP address (for example, using dyndns.org), and then select "Dynamic IP." Your internal IP address should be the IP address on the machines on your network, but ending in a zero. For example, if your PBX is 192.168.1.101, then you should enter 192.168.1.0 in the internal IP address field. Your subnet mask will probably be 255.255.255.0.

If you plan to connect to your PBX using a VPN from another network, click on the "Add Local Network Field," and enter the internal address used on that VPN (i.e., 192.168.2.0) along with the subnet mask (usually 255.255.255.0).

The following is typical of a small office user:

NAT:  Yes
IP Configuration:  Dynamic IP
Dynamic Host:  YOURDOMAINNAME.COM    (get one FREE at dyndns.org)
Local Networks:
192.168.1.0/255.255.255.0

Note: If you don't have any remote extensions and your VOIP providers have the ability to handle registrations through NAT, you may be able to get away with the following instead:

NAT: Yes
IP Configuration:  Public

The above may work, even if you are behind a NAT and your PBX isn't on a Public IP address.

Even if you are on a public IP, it is very important that you go to this page at least once, make at least one change somewhere on the page, hit "submit," and then hit the orange "apply configuration changes."

This is necessary to help prevent an Asterisk bug that can cause your entire system to stop working if you have any SIP trunks and your internet connection goes down.

If your version of Asterisk suffers from this bug, all of your phones will stop working when your internet goes down. You can fix the bug by doing the above, and then also ensuring that all references to every SIP trunk provider are by IP address (i.e., 64.33.22.105) and not by a domain name (i.e., voipprovider.com) in your trunk settings (including peer and user details and registration string). Using IP addresses will ONLY solve the problem if you have also made a change on this page and clicked submit, because doing so writes certain default values to the Asterisk configuration files that are not written by default.

MEDIA & RTP SETTINGS (May Want to Modify):

By default, Asterisk will terminate any call that is not placed on hold if there is no audio for 30 seconds. If you place a call on hold, and it hears no audio for 300 seconds (5 minutes), Asterisk will terminate the call. You may wish to change these. Otherwise, if you get placed on hold by the person you call, and you hit mute on your end, your call will be dropped in 30 seconds if there's no music or other audio from the other side.

The RTP Timeout field controls how long Asterisk will wait to drop a call when there is no audio at all. If you increase this value from 30 to 300 (for example), you may want to change RTP Keepalive to 30, so that when no audio is going through your firewall, Asterisk will send a keep alive packet every 30 seconds.

The RTP Hold Timeout field controls how long Asterisk will wait to drop a call that YOU have placed on hold when there is no audio. This timer applies EVEN IF you use Music on Hold. If you are happy with calls dropping after five minutes on hold, you can leave this setting as is.

6. CONSIDER "DEVICE AND USER MODE": By default, FreePBX runs in Extension mode. Extension mode works just fine, and for the novice user, it is probably a better choice.

However, FreePBX also has a mode called "Device and User Mode" which allows multiple devices (phones) to work as the same user (extension numbers), and which makes it easy for users (extension numbers) to move from one device (phone) to another device (phone). If you're interested in trying Device and User Mode, click on Enabling Device & User Mode.

7. CONFIGURE SENDMAIL/POSTFIX: Most distros include either sendmail or postfix, which handles sending e-mail. Configuration of these programs is often required in order to get FreePBX to correctly send e-mail notifications of updated modules and voicemails. If you want to use a feature that includes sending an e-mail, you'll need to configure whichever program (sendmail or postfix) that is installed with your distro.

8. CONSIDER FORWARDING RTP MEDIA PORTS FROM YOUR FIREWALL TO YOUR FREEPBX: If you don’t forward the RTP Media Ports from your router to your FreePBX, you can encounter situations where callers who come in from VOIP SIP Trunks and who are transferred directly to another outside line without first receiving a voice prompt will have no audio. There are several ways to fix this. First, you can ensure that all calls are answered by something on your system (such as an auto attendant) before being transferred outside your system. Or, you can use only IAX Trunks. If do either of these, no other changes are needed.

However, if you plan to use SIP Trunks from external VOIP providers and you want to forward calls before they are answered by your system, then you'll need to forward the RTP Media Ports from your Firewall to your FreePBX machine. Forward firewall UDP ports 10000 to 20000 to FreePBX server.

Please note that Port 10000 is also used for webmin (a tool that can be used to make substantial configuration changes on your machine using a web browser). If you have webmin on port 10000, either change webmin's default port to something else (such as 9001), or change the default RTP Media Ports from 10000-20000 to 10001-20000.

A range of 10000 ports available for RTP Media is often unnecessarily large for most small systems, because one call requires only 4 active ports. Thus, you might consider narrowing the range of ports used for RTP Media. If you do narrow the range, keep the range somewhere within 10000 to 20000 (i.e. don't select 43500 to 44500), as going outside this range can lead to call quality issues.
For all of these reasons,

If you want to change the RTP Media Ports from the standard 10000 to 20,000 range, open a command prompt on your server, and type the following:

cd /etc/asterisk
nano rtp.conf

Change 10000 and 20000 to something narrower, but in the same range.

CTRL-O, ENTER, CTRL-X. (Saves, Exits)

amportal stop
amportal start

9. EXPLORE THE MODULES: Explore the various FreePBX modules and configure your new PBX as you like it. The modules are listed along the left-hand side of the GUI, and are divided into two sections, "Setup" and "Tools." Once you're at a specific module's page, you can hover your mouse over the title of each entry and get instructions on what the entry does. Generally, you'll want to configure the modules in this order:

Trunks- Trunks are the PBX equivalent of a phone line. They are how your system makes calls to the outside world and receives calls from the outside world. Without a trunk, you can't call anyone. You can configure a trunk to connect with any VOIP service provider (such as FreePBX's SipStation), with a PSTN/Media Gateway (which allows you to make and receive calls over standard telephone lines from your local telephone company), or to connect directly to another PBX.

Most reputable VOIP providers will give instructions on how to configure a FreePBX trunk with their service.

The Dialed Number Manipulation Rules section lets you redirect calls to certain numbers to other numbers. For example, if someone dials 411, FreePBX can be configured to change that to 1-800-FREE-411. Or you could make 611 call your grandmother. Hover your mouse over the words "Dialed Number Manipulation Rules" for more details.

Outbound Routes- Outbound Routes are how you tell your PBX which Trunks (phone lines) to use when people dial certain telephone numbers. A simple installation will tell the PBX to send all calls to a single trunk. However, a complex setup will have an outbound route for emergency calls, another outbound route for local calls, another for long distance calls, and perhaps even another for international calls. You can even create a "dead trunk" and route prohibited calls (such as international and 976 calls) to it.

Extensions (or Devices and Users)- Extensions are where you set-up devices (telephones) and users (extensions) on your system.

To create one, click "add extension" on the right-hand side of the screen, and then select "generic SIP extension." Although there are a lot of fields available, most of them can be left blank or at the default setting. The only required fields are: User Extension (set the extension number here), Display Name (give the extension a name, usually a location or a person), and secret (the password used to register a phone to the extension).

All of the available fields have help available right on the Web GUI. Just hover your mouse over the field and a pop-up will tell you what it does.

Follow-me- The follow-me module allows you to create a more complicated method of routing calls that are placed to a specific extension. Using this module, you can make a call to one extension ring several other extensions, or even outside phone numbers. You can also make calls to one-extension end in the voicemail of another extension.

For example, using "follow-me," you could make a call to extension 10 actually ring extension 10, extension 11, and extension 12, and call someone's cellular phone, for 15 seconds, and then, if nobody answers, go the voicemailbox for extension 17.

Ring Groups- Ring Groups allow you to create a single extension number (the Ring Group Number) that will call more than one person.

For example, you could make a Ring Group so that when any user dials extension 601, extensions 10, 11, 12, and 13 ring for 15 seconds, and then the call goes to the voicemail for extension 17.

Inbound Routes- The Inbound Routes module is where you tell the PBX how to handle incoming calls. Typically, you tell the PBX the phone number that outside callers have called ("DID Number" or "Direct Inward Dial Number") and then indicate which extension, Ring Group, Voicemail, or other destination the call will go to.

Parking Lot- A parking lot allows anyone who has received a call to park the call on an extension that anyone else can access. Typically, you receive the call, transfer it to extension 70, and then listen as the system tells you where you can pick up the call (usually extension 71). Then, anyone else on your PBX can dial 71 to pick-up the call.

Feature Codes- This module allows you to set the special codes that users dial to access various features. You can also disable features if you don't want users to be able to access them.

General Settings-: This module has several important features you may want to consider changing:

. Dial Dial Voicemail Prefix: This feature allows you to directly dial an extension's voicemailbox by dialing the prefix listed on this page. So, for example, if you dial * (the default) and then an extension number, you'll skip ringing the extension and go straight to their mailbox. This is useful when you wish to transfer someone directly to voicemail. If you leave this at the default of *, and you use two digit extensions, the direct dial voicemail function will confict with certain feature codes. You may wish to change the direct dial voicemail prefix from the default of "*" to something else, such as *86.

. Optional Voicemail Recording Gain: If you find that the voicemail messages you receive are quiet compared to the system recordings, you might want to change this from the default of 0 to 5.

. Do Not Play "please leave message after tone" to caller- If you'd prefer that asterisk just play the outgoing message and then beep, then check this box.

. Operator Extension- You can specify the extension number/ring group number that people will get transferred to when they dial 0 while leaving a voicemail. If you leave this blank, the caller will return to whatever ring group they came from before reaching voicemail.

Paging and Intercom- By default, you dial *80 plus the extension number to intercom a specific user. The Paging and Intercom module allows you to define numbers you can dial to page a group of devices at once. For example, in a small office, you might define a paging group that allows any user to dial 00 to page the entire office.

Conferences- This module allows you to create an extension number that people can dial into in order to have a conference call.

For example, any user could dial extension 800 and they would be in a conference call.

IVR- This is the module where you configure an auto attendant to answer calls and direct them.

System Recordings- This is the module where you record the messages for use on your auto-attendant.

DISA ("Direct Inward System Access")- This module allows you to create a destination that allows people to call in from an outside line and reach a system dial tone. This is useful if you want people to be able to take advantage of your lower rate for toll calls, or if you want outside callers to be able to use the paging or intercom features of the system. Always password protect this feature, if you use it at all.

Backup and Restore- This module allows you to backup and restore the settings and recordings made by FreePBX/Asterisk. After they are made, you can find the backups by typing the following at your command prompt:

cd /var/lib/asterisk/backups

ls -l

There are many other modules, and most are self-explanatory. Be sure to check them all out.

10. Configure a Sangoma T1, PRI, FXO, or FXS Card: If you want to connect a T1, a PRI, or a regular phone line or telephone set directly to your PBX, you'll need to purchase and then configure a Sangoma card. For information on Sangoma's line of cards and for instructions on how to configure FreePBX to operate with those cards, click this link:

http://www.freepbx.org/support/documentation/installation/first-steps-af...

11. Configure Your Phones

The method used to configure your phones to connect to your system depends entirely upon which phones you choose.

The Aastra 6757i is a very popular phone, and it can be configured (1) by using the phone's web interface, (2) by creating the aastra.cfg and MACADDRESS.cfg files in the /tftpboot directory of your PBX, or (3) using the Endpoint Manager Module. Configuration using options 1 and 2 are well documented in Aastra's documentation, which you can find here:

http://www.aastra.com/cps/rde/aareddownload?file_id=7041-13675-_P06_XML&...

When you connect an Aastra phone to your network and power it up, it will obtain an IP address from your DHCP Server (in most cases, your router). To find out the IP address, hit Options, 3, 1 on your phone. Using a web browser, type in the IP address. The default username for an Aastra phone's web interface is admin, and the default password is 22222.

go to the Global SIP page on the phone's web interface, and set the Phone Number and Authentication Name fields to your extension #, Password field to the extension password (NOT the voicemail password), and Proxy Server and Registrar Server to your PBX's IP address. Save and reboot, and your phone should work. For more advanced configurations, you'll want to set-up an aastra.cfg and MACADDRESS.cfg files following Aastra's instructions.

Currently, we recommend sticking with Firmware version 2.6 for Aastra phones.

If you want to use your Android Phone as a Wifi VOIP Phone, you can download CSipSimple for free from the Android Market.

If you want to use a computer, Counterpath's X-Lite VOIP Softphone is available for free download from Counterpath's web-site.

12. Consider the Paid Modules

The FreePBX Distro includes all of the modules you need to set-up a first class PBX. There are, however, some additional modules available that you may wish to purchase. These modules are designed to work with the FreePBX Distro only, and may not be compatible with other Distros such as PBX In A Flash, Elastix, AsteriskNOW, Trixbox,etc.

You can find out more about the Paid Modules here:

http://www.freepbxdistro.org/index.php

13. Consider Third Party Modules

A number of third parties have created free third-party modules that you can download and add to your FreePBX installation.

You can find the modules here:

http://mirror.freepbx.org/modules/release/contributed_modules/

For installation instructions, read here:

http://www.freepbx.org/trac/browser/contributed_modules/modules/README.t...

For details about what each module does, click here:

http://www.freepbx.org/support/documentation/module-documentation/third-...

You can also find more information about Third Party Modules and other add-ons here:

http://pbxinaflash.com/forum/forumdisplay.php?f=10

14. Decide if you want to allow remote extensions/phones to connect to your system over the internet.

Allowing a remote extension to connect to your system over the internet is widely regarded as a serious security risk and generally a bad idea unless you really know what you are doing. However, if you want to try it, read the instructions here:

http://www.freepbx.org/support/documentation/howtos/howto-setup-a-remote...


Installing and Configuring a Sangoma Card

About Sangoma's Line of Asterisk Cards

Sangoma makes a series of PCI and PCI-E cards that can be installed in any computer and allow the user to use a PRI line, a T1 line, regular telephone lines (connected to FXO Ports), or to connect standard analog phones (connected to FXS Ports). A PRI Line and T1 line are digital lines that are usually supplied by either a local telephone company or a provider of business telephone and data services. The most common Sangoma cards used in FreePBX installations are the A100 series, A200 series, and A400 series.

A100 Cards

Sangoma's A100 cards are used for PRI and T1 connections. The A101 has one PRI/T1 port. A PRI/T1 port is a digital port that uses the same RJ45 connector that is used by an ethernet cable. One PRI port supports 24 channels, including 1 data channel and 23 audio channels. A T1 supports 24 channels, which can be used for data or audio. Sangoma's A102 card is identical to the A101, except that it has two PRI/T1 ports. The A103 has three ports, and so on.

A200 Cards

Sangoma's A200 cards can support up to four FXO or FXS Ports (minimum 2, maximum 4) as sold. They are sold in a variety of different configurations, ranging from bare boards (with no ports) which can have daughter boards installed on them later, to boards that have 4 FXOs or boards that have 4 FXS ports pre-installed.

You can add up to five REMORA cards to an A200 card. Each Remora card takes up an additional PCI Slot inside your computer case, but connects only to the main A200 Card. Each Remora card will give you an additional 4 ports.

For more information on Sangoma’s A200 Cards, follow this link:

http://sangoma.com/products/hardware_products/analog_telephony/a200.html

A400 Cards

Sangoma's A400 cards can support up to twelve FXO or FXS Ports (minimum 2, increasing by 2 at a time, maximum 12). They are sold in a variety of different configurations, just like the A200's.

You can add up to three REMORA cards to an A400 card. Each Remora card takes up an additional PCI Slot inside your computer case, but connects only to the main A200 Card. Each A400 Remora card will give you an additional 12 ports.

For more information on Sangoma’s A400 Cards, follow this link:

http://sangoma.com/products/hardware_products/analog_telephony/a400.html

Echo Cancellation and PCI-E

All Sangoma cards with model numbers ending in "D" have echo cancellation. Model numbers that don't have D do not have echo cancellation (and it cannot be added later). Model numbers ending in "E" are PCI-E. Model numbers that don't end in E are PCI.

The FreePBX Distro's Support for Sangoma Cards

The FreePBX Distro includes an easy way to configure any of Sangoma's cards. Install one or more cards in your machine, and then download the Sangoma Setup Scripts, execute them, and then create your trunks or extensions.

If you are not using the FreePBX Distro, then you cannot use the Sangoma Setup Scripts. For example, even though PBX In A Flash, Elastix, and AsteriskNOW include FreePBX, they are not the FreePBX Distro, and so the Sangoma Setup Scripts will not work. Instead, you’ll need to manually install the drivers and configure Asterisk. For more information follow this link:

http://wiki.sangoma.com/wanpipe-linux-asterisk

After you’ve manually installed and configured your Sangoma card, you can set-up your trunks as indicated below.

Download the FreePBX Distro Sangoma Setup Scripts:

If you are using the FreePBX Distro, after you have connected the Sangoma cards to the appropriate PCI or PCI-E slot, login as root at the Linux command prompt and issue the following command to install the drivers and scripts:

yum install wanpipe*

Note: Make sure you include the asterisk (*) at the end of the word wanpipe in the line above.

Then issue this command to run the setup script:

setup-sangoma

You'll be asked a series of configuration questions, which will differ depending upon which Sangoma card(s) you have installed on your computer. If you are configuring a PRI/T1 card, your provider should have given you the information necessary to answer these questions. For an FXO or FXS card, the questions are self-evident. For each question, a default answer will be provided, and the default answers are correct about 90% of the time.

By default, setup-sangoma will group all of the channels on the same card into one group. The first card will be configured to Group 0 (g0), the second card will be configured to Group 1 (g1), and so on.

A T1/PRI Card will be configured with up to 24 channels for each port (plug) on the card, depending upon how you answer the configuration questions. An FXO/FXS card will be configured with one channel for each port (plug).

If you want to reassign certain channels on your cards to other groups or just see which ports were assigned to which channels, use this command to manually edit the dahdi-channels.conf file:

nano etc/asterisk/dahdi-channels.conf

If you wish to reassign only some of the channels on a single card to a different group, you may need to duplicate an entry and then change the channel range and assigned group number.

When you're done editing, hit CTRL-X, and then hit ENTER to save your changes. Then issue this command to restart your system:

reboot

If you want to see a list of channels and devices, use this command:

dadhi_cfg -vv

Set-up a DAHDI Trunk (PRI, T1, and FXO only)

If you are using your Sangoma card as a PRI, T1, or FXO (i.e. a regular telephone line), you'll need to create a Trunk so that FreePBX can use the line. Using a web browser, access your PBX by entering its IP address in the address bar. Click on "PBX Administrator" and then enter your FreePBX Username and Password. Select the Trunks Module. Click on Add Dahdi Trunk. Enter a Trunk Name, Outbound Caller ID, Maximum Channels, and Dialed Number Manipulation Rules as you would for any other trunk.

In the "Dahdi Identifier" field, enter either the group number or channel number you want to use for this trunk. If you didn't manually edit dahdi-channels.conf as explained above, then all of the channels available on the Sangoma cards that were configured will be assigned to group 0. If you want to allow your Sangoma card to choose which channel (or line) to use for a particular call, you'll want to use a group number in this field.

If you want to use group 0, enter the following in the Dahdi Identified field:

g0

If you re-assigned some of your channels to another group by manually editing dahdi-channels.conf as indicated above, you can substitute that group number in this field, i.e. g1, g2, g3, etc.

If you only want to use a single channel for this trunk, instead of using a group, enter the channel number. This use is most common when you're using an FXO Card to connect to regular analog telephone lines, and you want to be able to send calls on one trunk to a specific line. For example, to use channel 3 (i.e., line 3), type the following in the Dahdi Identifier field:

3

Only one indicator can be used in each trunk. Thus, you cannot enter g0; g1 or 2, 3 in the Dahdi Identifier field.

Then click "Submit Changes" at the bottom of the screen, and click the Orange "Apply Configuration Changes" at the top of the screen.

Use this Trunk just like you would any other Trunk, by setting up an Outbound Route that sends calls to the Trunk, and by configuring Inbound Routes to accept calls from the DIDs associated with the Trunk.

Configure Zap Channel DIDS (Cards with FXO Ports only)

If you are using a Sangoma card with a PRI or T1, this step is unnecessary. With PRI and T1 connections, the phone company sends the DID (i.e. the telephone number called) with the data that initiates the incoming call. However, if you are using a Sangoma card that has an FXO Port (i.e. a regular telephone line), you'll need to tell FreePBX the phone number (DID) that is attached to each of the FXO Ports on the card, so that FreePBX knows what inbound route to use to process calls that come in on those FXO Ports.

Select the Zap Channel DIDs module. Click "Add Channel." Enter the Channel Number, a Description (for your use only), and the Channel Number.

Then click "Submit Changes" at the bottom of the screen, and click the Orange "Apply Configuration Changes" at the top of the screen.

Set-up a DAHDI Extension (FXS only)

If you are using a Sangoma cards with an FXS Port (i.e. a port to plug in a standard analog telephone), then you'll need to create a DAHDI Extension.

Using a web browser, access your PBX by entering its IP address in the address bar. Click on "PBX Administrator" and then enter your FreePBX Username and Password. Select the Extensions Module. Click on Add Extension, and then pull down and select "Generic Dahdi Device." Configure the extension as you would any other extension, but put the channel number for the FXS port in the "channel" field (under Device Options).

Then click "Submit Changes" at the bottom of the screen, and click the Orange "Apply Configuration Changes" at the top of the screen.

Next, plug a phone into your FXS Port and try making some calls.


Install Procedure for Centos 4.3

Centos 4.3 Installation Walkthrough

CentOS 4.3 (CentOS) is the distribution used throughout this guide.
We believe that the goals of the distribution are in good alignment
with the mission-critical nature of a corporate telephone system.
CentOS ISOs can be downloaded from a number of mirror sites. Check the
official CentOS website for more information.

Detailing a Linux installation is beyond the scope of this
document. There are numerous articles, HOW-TOs and books available to
the individual that deal with this subject. Therefore, for the purposes
of this document it is assumed that the CentOS installation is that of
a Server system. Furthermore, for the purposes of this
document it is assumed that the partitioning of the hard disk drive was
done automatically by selecting Autopartition when prompted, and that no previous partitions existed on the drive prior to installation.

Important Installation Notice During the installation you will be prompted about Firewalls and Selinux. Both of these MUST BE DISABLED.
The Sections to disable are highlighted in red below. After clicking
next, you will be prompted if you are sure this is correct - Click on Proceed.

Package Group Selection
Whilst It is not recommended to use the X Window System on a
production freePBX server, it is possible. If you're only doing this
for a test, or experementation, feel free to install X and Gnome or
KDE. If you are planning on using this as a production system, please
avoid installing X unless it's absoloutely necessary.

freePBX has several requirements (which we will cover in a later
section) but at this point of the CentOS installation ensure that at
least the following package groups are selected

  • Web Server
  • Mail Server (Not selected by default)
  • MySQL Database (Not selected by default)
  • Development Tools (Not selected by default)

After you've done this, the machine will install CentOS, install,
and reboot. At this stage, you have a functioning Linux system!

Post-Install Configuration

After your machine reboots, you need to log in as 'root' - You were
prompted for the root password on installation. When you log in
successfully, you will have a prompt li

For performance and security reasons it is important to update the system immediately after install. CentOS uses yum (or up2date but that is not a recommended way of doing updates) for this purpose. In this document we will use yum:

[root@dhcp1 ~]# yum -y update

Setting up Update Process

Setting up repositories

...etc....

...etc...

Update: gnupg.i386 0:1.2.6-3 python.i386 0:2.3.4-14.2 sendmail.i386 0:8.13.1-3.RHEL4.3 tzdata.noarch 0:2006a-2.EL4

Complete!

root[@dhcp1 ~]#

Additional Package Installation to Satisfy freePBX dependencies
You can check if a particular package is installed by doing either:

[root@dhcp1 ~]# yum info [package]

or:

[root@dhcp1 ~]# rpm -qa | grep [package]

If the package is not installed, install it by using yum:

[root@dhcp1 ~]# yum install [package]

Full documentation on 'yum' is available by typing man yum.

The following packages need to be additionally installed with yum:

[root@dhcp1 ~]# yum install gcc
libxml2-devel libtiff-devel mysql-server php-gd php-mysql kernel-devel
kernel-smp-devel bison ncurses-devel audiofile-devel subversion
libogg-devel openssl-devel mysql-devel

lame is not available through a yum repository; but it can be obtained and installed from Dag Wieers' RPM repository:

[root@dhcp1 ~]# rpm -ivh http://apt.sw.be/redhat/el4/en/i386/RPMS.dag/lame-3.96.1-2.2.el4.rf.i386.rpm

Satisfying freePBX's PERL module dependencies
freePBX, from version 2.1 does not have any specific perl
dependancies. There used to be a big list here, but we finally managed
to get rid of all of them!

Get the latest freePBX files
You may wish to check that the link specified here is actually the latest and greatest. Look at the files available on Source Forge and pick the latest one there.

[root@dhcp1 ~]# cd /usr/src

[root@dhcp1 src]# wget http://easynews.dl.sourceforge.net/sourceforge/amportal/freepbx-2.1.1.tar.gz

[root@dhcp1s src]# tar zxf freepbx-2.1.1.tar.gz

A pause while the files are extracted...

[root@dhcp1 src]#

Getting all the required Asterisk and Zaptel files.

[root@dhcp1 ~]# cd /usr/src

[root@dhcp1 src]# svn co http://svn.digium.com/svn/asterisk/branches/1.2 asterisk

..Lots of files...

[root@dhcp1 src]# svn co http://svn.digium.com/svn/asterisk-addons/branches/1.2 asterisk-addons

..Lots of files...

[root@dhcp1 src]# svn co http://svn.digium.com/svn/asterisk-sounds/trunk asterisk-sounds

..Lots of files...

[root@dhcp1 src]# svn co http://svn.digium.com/svn/zaptel/branches/1.2 zaptel

..Lots of files...

[root@dhcp1 src]# svn co http://svn.digium.com/svn/libpri/branches/1.2 libpri

..Lots of files...

Patch and Compile zaptel (and libpri)
If you plan on useing IAX or conferencing and _don't_ have any digium hardware skip this part and read this ztdummy install guide then continue on at "Compile Asterisk"

[root@dhcp1 src]# cd /usr/src/zaptel

[root@dhcp1 zaptel]# cp ztdummy.c ztdummy.c.orig

[root@dhcp1 zaptel]# sed -i "s/if 0/if 1/" ztdummy.c

[root@dhcp1 zaptel]# make

If you get an error that looks like this:

/usr/src/zaptel/zaptel.c:420: error: syntax error before "zone_lock"

/usr/src/zaptel/zaptel.c:420: warning: type defaults to `int' in declaration of `zone_lock'

/usr/src/zaptel/zaptel.c:420: error: incompatible types in initialization

..10 or so more lines..

it means that your CentOS header files have an error in them.

This is a known bug and is easily repaired by

[root@dhcp1 zaptel]# sed -i s/rw_lock/rwlock/ /usr/src/kernels/`uname -r`-`uname -m`/include/linux/spinlock.h

You can now retry the make command. After it's finished, you need to run make install and make config. If you will be using a Digium or Sangoma telephony card that supports T1/E1 signaling do this step as well:

[root@dhcp1 zaptel]# cd /usr/src/libpri

[root@dhcp1 libpri]# make install

Compile Asterisk
Now you get to compile the centre of the package - asterisk! This is relatively paineless:

[root@dhcp1 libpri]# cd /usr/src/asterisk

[root@dhcp1 asterisk]# mkdir /var/run/asterisk

[root@dhcp1 asterisk]# make install

[root@dhcp1 asterisk]# make config

Take a couple of minutes now and configure your zaptel
files, before continuing. If you think you'll want to have Asterisk and
freePBX itself handle faxing (rather than using a dedicated fax
device), you should read the Faxing page.

Create user and set permissions
Unfortunately, issues in Asterisk 1.2 require us
to run the web server process as the same user as asterisk. In this
situation, it's easier for us to run httpd as 'asterisk', rather than
asterisk as 'httpd', as there's far less configuration that needs to be
done.

[root@dhcp1 ~l]# useradd -c "Asterisk PBX" -d /var/lib/asterisk asterisk

[root@dhcp1 ~]# chown asterisk /var/lib/php/session/

Using nano (or your favourite editor, but nano is fine), you need to change User apache and Group apache to User asterisk and Group asterisk.

[root@dhcp1 ~]# nano +227 /etc/httpd/conf/httpd.conf (Push Control-X to save when you've finished)

You also want to change AllowOverride None to AllowOverride All

[root@dhcp1 ~]# nano +311 /etc/httpd/conf/httpd.conf (Push Control-X to save when you've finished)

Set up MySQL
Before you can do anything to MySQL, you need to make sure it's running:

[root@dhcp1 ~]# /etc/init.d/mysqld start

Initializing MySQL database: [ OK ]

Starting MySQL: [ OK ]

[root@dhcp1 ~]#

Now, to configure the databases for freePBX:

[root@dhcp1 ~]# cd /usr/src/freepbx-2.1.1

[root@dhcp1 freepbx-2.1.1]# mysqladmin create asterisk

[root@dhcp1 freepbx-2.1.1]# mysqladmin create asteriskcdrdb

[root@dhcp1 freepbx-2.1.1]# mysql asterisk < SQL/newinstall.sql

[root@dhcp1 freepbx-2.1.1]# mysql asteriskcdrdb < SQL/cdr_mysql_table.sql

They also need to be secured, so that not just anyone can access
them. freePBX will prompt you for a database password when you do the
install. You need to pick that now. We'll assume that you've picked
'asteriskuser' and 'amp109' - you probably shouldn't use these, as they
are well known passwords for Asterisk@Home builds. If anyone's trying
to attack your machine, they will try this.

[root@dhcp1 freepbx-2.1.1]# mysql

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 8 to server version: 4.1.16

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY 'amp109';

Query OK, 0 rows affected (0.00 sec)

mysql> GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY 'amp109';

Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;

Query OK, 0 rows affected (0.00 sec)

mysql> \q

Bye

[root@dhcp1 freepbx-2.0.1]

Now, after all of this, you need to pick a root 'mysql' password.
For this, we'll pretend it's 's33kret'. If you need to do anything else
with mysql, you'll need to provide this password.

[root@dhcp1 freepbx-2.1.1]# mysqladmin -u root password 's33kret'

Build the cdr_mysql module for Asterisk (Yep, more compiling!)

[root@dhcp1 freepbx-2.1.1]# cd /usr/src/asterisk-addons

[root@dhcp1 freepbx-2.1.1]# cp Makefile Makefile.orig

[root@dhcp1 freepbx-2.1.1]# sed -i 's/SOURCE/SOURCE -DMYSQL_LOGUNIQUEID/' Makefile

[root@dhcp1 freepbx-2.1.1]# make && make install

Install freePBX at last!
You're there - you've done the hard yards, and finally you can install freePBX!

WARNING! If you have an existing Asterisk installation, the script below will overwrite your Asterisk configuration files. Backup your

/etc/asterisk directory before running.

$cd /usr/src/freepbx-2.1-beta1

$./install_amp

Checking for PEAR DB..OK

Checking for PEAR Console::Getopt..OK

Checking for libasteriskperl (perl bindings for asterisk)...Checking user..OK

Checking for /etc/amportal.conf../etc/amportal.conf does not exist, copying default

Creating new /etc/amportal.conf

Enter your USERNAME to connect to the 'asterisk' database: [asteriskuser]

Enter your PASSWORD to connect to the 'asterisk' database: [amp109]

Enter the hostname of the 'asterisk' database: [localhost]

Enter a USERNAME to connect to the Asterisk Manager interface: [admin]

Enter a PASSWORD to connect to the Asterisk Manager interface:[amp111]

Enter the path to use for your AMP web root:[/var/www/html]

Enter the path to use for your FOP web root:[/var/www/html/panel]

Created /var/www/html/panel

Enter the path to your Apache cgi-bin:[/var/www/cgi-bin]

Enter the IP ADDRESS or hostname used to access the AMP web-admin:[xx.xx.xx.xx] The IP Address of your Asterisk Machine

Enter a PASSWORD to perform call transfers with the Flash Operator Panel: [passw0rd]

Use simple Extensions [extensions] admin or separate Devices and Users [deviceanduser]? extensions

Enter directory in which to store AMP executable scripts: [/var/lib/asterisk/bin]

Created /var/lib/asterisk/bin

Enter directory in which to store super-user scripts: [/usr/sbin]

/etc/amportal.conf writtenOK

Reading /etc/amportal.conf..OK

Checking for /etc/asterisk/asterisk.conf../etc/asterisk/asterisk.conf does not exist, copying default

OK

Reading /etc/asterisk/asterisk.conf..OK

Connecting to database..OK

Checking current version of AMP..1.10.010beta1

Installing new AMP files..OK

Configuring install for your environment..OK

Setting permissions on files..OK

Checking for upgrades..5 found

Upgrading to 1.10.010..

Upgrading to 1.10.010..OK

Upgrading to 2.0beta1..

-> Running PHP script /usr/src/freepbx-2.0-beta4/upgrades/2.0beta1/emergencycid.php

-> Running SQL script /usr/src/freepbx-2.0-beta4/upgrades/2.0beta1/tables.sql

PHP Notice: Undefined variable: data in /usr/src/freepbx-2.0-beta4/install_amp on line 305

Upgrading to 2.0beta1..OK

Upgrading to 2.0beta2..

Upgrading to 2.0beta2..OK

Upgrading to 2.0beta3..

-> Running PHP script /usr/src/freepbx-2.0-beta4/upgrades/2.0beta3/fixgotovm.php

Updating existing voicemail destinations..

..OK

Upgrading to 2.0beta3..OK

Upgrading to 2.0beta4..

Upgrading to 2.0beta4..OK

Generating AMP configs..

Generating Configurations.conf..

Checking for PEAR DB..OK

Checking for PEAR Console::Getopt..OK

Checking for /etc/amportal.conf..OK

Reading /etc/amportal.conf..OK

Connecting to database..OK

Please Reload Asterisk by visiting http://XXX.XXX.XXX.XX/admin

Generating AMP configs..OK

Restarting Flash Operator Panel..-bash: /var/www/html/admin/bounce_op.sh: Permission denied

OK

Please Reload Asterisk by visiting http://XXX.XXX.XXX.XX/admin

If you get any warnings or errors in the last part of the output,
they're usually not traumatic, but please use the IRC Support tool to
report a bug to the developers.

amportal control script

Starting with version 1.10.004, freePBX provided a new control
script. The functionality of which is to start, stop or kill services
in the freePBX environment, or to set permissions on directories/files
in the freePBX environment:

$amportal

----------AMP Control Script-----------

Usage: amportal start|stop|kill|chown

start: Starts Asterisk and Flash Operator Panel server

stop: Gracefully stops Asterisk and the FOP server

restart: Stop and Starts

kill: Kills Asterisk and the FOP server

chown: Sets appropriate permissions on files

The amportal script is the recommended way to stop and start asterisk:

$ /usr/sbin/amportal stop

$ /usr/sbin/amportal start

19.Automatic start-up

echo /usr/sbin/amportal start >> /etc/rc.local

Ensure services are starting at boot time and reboot

In order to access and use freePBX we will want both Apache (httpd)
and MySQL (mysqld) to be started at boot. You can check to see if they
are setup to start at boot by using chkconfig:

[root@dhcp1 freepbx-2.1.1]# chkconfig --list httpd

httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off

[root@dhcp1 freepbx-2.1.1]# chkconfig --list mysqld

mysqld 0:off 1:off 2:off 3:off 4:off 5:off 6:off

Here we see that both httpd and mysqld have off
across the board (runlevels). chkconfig can also be used to turn on a
particular service, which you would want to do in this case.

^[root@dhcp1 freepbx-2.1.1]# chkconfig httpd on

[root@dhcp1 freepbx-2.1.1]# chkconfig mysqld on

You can now access freePBX with your web browser.

The first time you click on the FreePBX Administration link you
will be prompted for a username and password. Use admin and admin.
CREATE A NEW ADMINISTRATIVE USER IMMEDIATELY AFTER LOGIN.


Install process for CentOS 5.1

1. Install CentOS, enabling the following packages:
*DNS Server
*Web Server
*Mail Server
*MySQL Database
*Development Tools

yum install nano

reboot

2. Edit Network settings
nano /etc/sysconfig/network

HOSTNAME=internal.hostname.DOMAIN.com (Set your internal hostname name here)

Ctrl-X to save, 'Y' to confirm

nano /etc/sysconfig/network-scripts/ifcfg-eth0

IPADDR=192.168.1.20    (Note: set this to an IP-address matching your net)
NETMASK=255.255.255.0  (Note: set this to an IP-mask matching your net)
GATEWAY=192.168.1.1    (Note: set this to an IP-address matching your gateway)
NETWORK=192.168.1.0    (Note: set this to an IP-address matching your net)

Ctrl-X to save, 'Y' to confirm

echo "options {" >> /etc/named.conf
echo " directory \"/var/named\";" >> /etc/named.conf
echo " dump-file \"/var/named/data/cache_dump.db\";" >> /etc/named.conf
echo " statistics-file \"/var/named/data/named_stats.txt\";" >> /etc/named.conf
echo "}" >> /etc/named.conf
echo "include \"/etc/rndc.key\";" >> /etc/named.conf

service named start
chkconfig named on

nano /etc/resolv.conf

search internal.DOMAIN.com (Set your internal domain name here)
nameserver 192.168.1.5     (Set your name server IP-address here)
nameserver 127.0.0.1

Ctrl-X to save, 'Y' to confirm

nano /etc/hosts

127.0.0.1         internal.hostname.DOMAIN.com (Set your internal hostname name here)
127.0.0.1         asterisk1.local
127.0.0.1         localhost

Ctrl-X to save, 'Y' to confirm

iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -F
iptables -X
/etc/init.d/iptables save
service network restart

3. Update:
yum -y update

4. Disable Selinux:
echo "selinux=disabled" > /etc/selinux/config
reboot

5. Install dependencies and extra packages:
yum install e2fsprogs-devel keyutils-libs-devel krb5-devel libogg libselinux-devel libsepol-devel libxml2-devel libtiff-devel gmp php-pear php-pear-DB php-gd php-mysql php-pdo kernel-devel ncurses-devel audiofile-devel libogg-devel openssl-devel mysql-devel zlib-devel perl-DateManip sendmail-cf sox

cd /usr/src
wget http://sourceforge.net/projects/lame/files/lame/3.98.4/lame-3.98.4.tar.gz
tar zxvf lame-3.98.4tar.gz
cd lame-3.98.4
./configure
make
make install

6. Install Asterisk and FreePBX:
cd /usr/src
note: there are later versions of Asterisk, 1.6.2 and 1.8
wget http://downloads.digium.com/pub/asterisk/asterisk-1.4-current.tar.gz
wget http://downloads.digium.com/pub/asterisk/asterisk-addons-1.4-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gz
note: libpri is only needed for ISDN, if you only want SIP skip this install
wget http://downloads.digium.com/pub/libpri/libpri-1.4-current.tar.gz
note: the latest FreePBX is 2.8, edited to reflect this
wget http://mirror.freepbx.org/freepbx-2.8.1.tar.gz
tar zxvf asterisk-1.4-current.tar.gz
tar zxvf asterisk-addons-1.4-current.tar.gz
tar zxvf dahdi-linux-complete-current.tar.gz
note: skip this step if you are not using ISDN
tar zxvf libpri-1.4-current.tar.gz
tar zxvf freepbx-2.8.1.tar.gz

cd /var/lib/asterisk/sounds
wget http://downloads.digium.com/pub/telephony/sounds/asterisk-extra-sounds-en-gsm-current.tar.gz
tar zxvf asterisk-extra-sounds-en-gsm-current.tar.gz
cd /usr/src/dahdi-linux-complete-CURRENT
make
make install
make config

note: skip these step if you are not using ISDN

cd /usr/src/libpri-1.4-CURRENT 
make clean
make
make install

cd /usr/src/asterisk-1.4-CURRENT
useradd -c "Asterisk PBX" -d /var/lib/asterisk asterisk
mkdir /var/run/asterisk
mkdir /var/log/asterisk
chown -R asterisk:asterisk /var/run/asterisk
chown -R asterisk:asterisk /var/log/asterisk
chown -R asterisk:asterisk /var/lib/php/session/
nano +231 /etc/httpd/conf/httpd.conf
Change User apache and Group apache to User asterisk and Group asterisk.
Ctrl-X to save, 'Y' to confirm

nano +329 /etc/httpd/conf/httpd.conf
Change AllowOverride None to AllowOverride All
Ctrl-X to save, 'Y' to confirm

./configure
make
make install

/etc/init.d/mysqld start
cd /usr/src/freepbx-2.8.1

mysqladmin create asterisk
mysqladmin create asteriskcdrdb
mysql asterisk < SQL/newinstall.sql
mysql asteriskcdrdb < SQL/cdr_mysql_table.sql

mysql
GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY 'SOMEPASSWORD';
GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY 'SOMEPASSWORD';
flush privileges;
\q

mysqladmin -u root password 'SOMEPASSWORD'
cd /usr/src/asterisk-addons
./configure
make
make install
cd /usr/src/freepbx-2.8.1
./start_asterisk start
./install_amp --username=asteriskuser --password=SOMEPASSWORD
echo "/usr/local/sbin/amportal start" >> /etc/rc.local
chkconfig httpd on
chkconfig mysqld on
Open browser to http://ipaddressofpbx/admin
Click red bar in FreePBX

7. Fix ARI password:
note: in FreePBX 2.8 you do this in /etc/amportal.conf
nano -w /etc/amportal.conf
ARI_ADMIN_PASSWORD=SOMEPASSWORD
Ctrl-X to save, 'Y' to confirm

8. Configure Sendmail:
nano /etc/mail/sendmail.mc
define(`SMART_HOST', `relay.DOMAIN.com)dnl
MASQUERADE_AS(`pbx.DOMAIN.com')dnl
FEATURE(`masquerade_envelope')dnl
Ctrl-X to save, 'Y' to confirm

make -C /etc/mail

9. Edit sip_nat.conf for proper NAT:
note: in FreePBX 2.8 you can download Asterisk SIP Settings module to do this
nano /etc/asterisk/sip_nat.conf

localnet=192.168.1.0/255.255.255.0
externhost=pbx.DOMAIN.com (Set your external hostname name here)
externrefresh=10
fromdomain=DOMAIN.com (Set your external domain name here)
nat=yes
qualify=yes
canreinvite=no

Ctrl-X to save, 'Y' to confirm

10. Add extra codecs to config:
note: in FreePBX 2.8 you can download Asterisk SIP Settings module to do this
nano /etc/asterisk/sip_custom.conf

allow=gsm
allow=h261
allow=h263
allow=h263p
videosupport=yes

Ctrl-X to save, 'Y' to confirm

note: in FreePBX 2.8 you can download Asterisk IAX Settings module to do this
nano /etc/asterisk/iax_custom.conf

allow=gsm
allow=h261
allow=h263
allow=h263p
videosupport=yes

Ctrl-X to save, 'Y' to confirm

asterisk -rx reload

11. Edit voicemail config:
nano /etc/amportal.conf
If the web interface on your PBX will be accessible on the internet:
AMPWEBADDRESS=pbx.DOMAIN.com (Set your external hostname name here)
If the web interface on your PBX will be accessible only on your internal network:
AMPWEBADDRESS=internal.hostname.DOMAIN.com (Set your internal hostname name here)
Ctrl-X to save, 'Y' to confirm

or if your users will NOT have access to the web interface:

nano /etc/asterisk/vm_email.inc
remove "Visit http://AMPWEBADDRESS/cgi-bin/vmail.cgi?action=login&mailbox=${VM_MAILBOX} to check your voicemail with a web browser.\n"
Ctrl-X to save, 'Y' to confirm

nano /etc/asterisk/vm_general.inc

serveremail=pbx@DOMAIN.com     ; Who the e-mail notification should appear to come from
fromstring=DOMAIN PBX          ; Real name of email sender

Ctrl-X to save, 'Y' to confirm

12. Fix MOH directory:
ln -s /var/lib/asterisk/moh /var/lib/asterisk/mohmp3
asterisk -rx reload

14. Open browser to http://ipaddressofpbx
Done!

Optional Package:
ConfControl is a partial rewrite of Web-MeetMe which includes only the conference control page and not all the scheduling options. It includes a replacement index.html page which adds a link to ConfControl from the FreePBX home page.
cd /var/www/html
wget http://www.2l2o.com/asterisk/ConfControl1.0.tar.gz
tar zxvf ConfControl1.0.tar.gz
rm ConfControl1.0.tar.gz


Install Process for ClarkConnect

Detailed guides for installing FreePBX on ClarkConnect can be found here:

http://samyantoun.50webs.com/asterisk/freepbx/clarkconnect/


Install Process for Debian

FreePBX 2.8 Installation on Debian 5 (Lenny) (Step by step):
http://mikeoverip.wordpress.com/2010/09/26/freepbx-2-8-installation-on-d...

A good guide is http://www.squishychicken.com/index.php?option=com_content&task=view&id=13&Itemid=2. It's for AMP and Asterisk 1.2, but can used to install freePBX instead.

Updated for FreePBX and other software version changes. I also felt it needed to be made more idiot proof for dummies like me who spent many frustrating hours trying to get it to work.
http://powerontech.com/freepbx-on-debian.htm

There is a good Ubuntu guide here that can be of assistance, until somebody writes an updated guide for freePBX 2.3 and Debian Etch.


Install Process for freeBSD

0.- In the meantime freepbx is not in the oficial freebs ddistribution download the port from here

http://www.freepbx.org/attachment/ticket/761/freepbx-2.1.tar

1.- Choose what apache, mysql and php version you want to use. For example, you could put this in your make.conf:

  DEFAULT_PHP_VER=5

  DEFAULT_MYSQL_VER=50

  APACHE_PORT=www/apache20

2.- cd /usr/ports/misc/freepbx

3.- If you have php previously install make sure you have pear in your php.ini include paths.

3.- make install

4.- drink a coffee

5.- Read the post instalation notes:

       1) enable .php files in your apache config

       2) adding index.php as default index files

       3) add pear and /.../admin to your php.ini includes

       4) Make sure asterisk and mysql are running fine

       5) Make sure asterisk accepts connections (manager.conf)

6.- http://localhost/FreePBX

7.- Complete this document!


Install Process for Gentoo

This is a work in progress

Notes
Basic gentoo knowledge is required, if you don't know what a USE flag then this will be hard to follow.

Look the the requirements in the INSTALL file and get your apache/php flags correct and reemerge dev-lang/php if needed.

emerge asterisk >= 1.2 - http://gentoo-portage.com/net-misc/asterisk

and asterisk-addons - http://gentoo-portage.com/net-misc/asterisk-addons

note: as of this writing the correct ebuild is asterisk-1.2.9_p1

Both are masked with ~x86 so (if you're not on x86 modify as needed) umask them with

`echo "net-misc/asterisk ~x86" >> /etc/portage/package.keywords`

and

`echo "net-misc/asterisk-addons ~x86" >> /etc/portage/package.keywords`

To emerge:

`emerge asterisk asterisk-addons`

Note: I have `net-misc/asterisk zaptel speex mysql -vmdbmysql` in
my package.use for asterisk but you may need otherwise, read the use
flags descriptions at gentoo-portage.com

This will get asterisk to be ready to futher configure.

Amportal Issues:

  • It appears some gentoo paths are not compatible with amportal:

in /usr/sbin/safe_asterisk change

ASTSBINDIR=/sbin to

ASTSBINDIR=/usr/sbin

  • amportal can't run the safe_opserver because the asterisk user on my machine had /bin/false for it's shell

check in /etc/passwd and make the asterisk user have /bin/bash as the shell if it's not already such.

I also needed asterisk ownership on the htdocs folder above the freepbx files.

  • note: this article used to tell you how to implement it
    with lighthttpd but I've cleared out that info as it is more specific
    than it needs to be and novices may make serious mistakes following
    them.

Install Process for Poundkey

"Engineered by Digium in conjunction with rPath, Pound Key includes all
the Linux components necessary to run, debug and build Asterisk, and
only those components. You no longer have to worry about kernel
versions and package dependencies. Unlike other Linux distributions
used to deploy Asterisk, no unnecessary components that might
compromise security or performance are included."

While technically true, PoundKey is missing several components
needed for FreePBX to run. Below are most of the commands neded to
ensure a smooth installation of FreePBX when following the normal
INSTALL document.

Install missing rPath components from the primary distributions:

conary update libxml2 libtiff bison audiofile php-mysql m4

Install lame from the Media Center Linux repository:

conary update lame=steel.rpath.org@rpl:devel

Repair PEAR for proper operation of the install_amp script:

pear install DB

Install perl MIME::Types:

perl -MCPAN -e "install MIME::Types"

Once these steps are complete, the normall INSTALL document can be easily followed.


Install Process for SuSE

FreePBX 2 has been tested with SuSe LES 9 and SuSe 10.

In reality seems fairly solid with not a lot of work needing to be
done to run FreePBX. Mainly check that you have DB (installable via
PEAR if required) and PHP4-GETTEXT (available as part of the SUSE
install) installed. If you have any PHP problems check that you have
the line include_path = ".:/usr/share/php" in /etc/php.ini. (The '.:' is the important bit)

To install DB, or if you aren't sure whether you have it installed, you can use pear. pear list will show a list of installed packages. To install DB either run pear install DB
on the command line or visit http://pear.php.net/package/DB and
download the latest stable version, 1.7.6 at present. A pear install
should download it and install it but it will complain about any
dependancies it needs and had a tendancy to fail on my system due for
this exact reason. The best way I found was to download the file onto
my SuSe? system and run pear install -n <location/filename>
manually. This tells pear to ignore any dependancies, as otherwise it
will probably complain about pear itself! Once finished you should have
DB.php and a DB directory in /usr/share/php.

When installing FreePBX remember that the webserver root is
different to the one defaulted to in the install_amp script. Your
webserver root should be /srv/www/htdocs so use that as the root and a
bit of common sense to change the panel and cgi-bin paths.

No other file changes should be required to get FreePBX working.


Install Process for Ubuntu 6.06

In this document there are various boxes, with text inside them.
These are examples of what you see on your screen, what you should
type, and/or the expected responses. For example:

rob@rob-laptop:~$ id

uid=1000(rob) gid=1000(rob)
groups=4(adm),20(dialout),24(cdrom),25(floppy),
29(audio),30(dip),44(video),46(plugdev),
106(lpadmin),110(scanner),112(admin),1000(rob)

In that situation, you would type 'id' and the response would be
similar to the response indicated. If you see an error, that probably
means you've typed something incorrectly, but it could also suggest
other problems. Read the error carefully, and if you don't know how to
fix it, feel free to post to the forums or ask on IRC.

Operating System Installation
Installation of Ubuntu is out of the scope of this document.. As a
reference point this document was written with accepting the defaults
for everything suggested in the installer..

Post Installation Configuration
After your machine has rebooted and you've logged in, you need to
switch to the 'root' account. Whilst installing you were prompted for a
password, which is what you must enter when prompted below:

rob@rob-laptop:~$ sudo su -

Password: Enter Password Here

root@rob-laptop:~#

This gives you full control of the system. It's the equivlent of typing 'sudo' before every command.

You now need to ensure that your machine is able to access the
internet, and once that is working you can proceed with the
installation Usually being able to browse the internet with Firefox is
a good indication that you won't be having any problems.

Check for updates and install required packages
Before running apt-get, you must edit the sources.list file so that you can install from the "universe".

nano +17 -w /etc/apt/sources.list

Remove the # signs from this line and add multiverse at the end:

deb http://us.archive.ubuntu.com/ubuntu/ dapper universe multiverse

Multiverse gives you access to a lot more packages then the standard repository does, useful for future reference.

Unless you've added extra repositories, your sources.list should look something like:

deb http://archive.ubuntu.com/ubuntu/ dapper main restricted universe multiverse

deb http://archive.ubuntu.com/ubuntu/ dapper-updates main restricted universe multiverse

deb http://archive.ubuntu.com/ubuntu/ dapper-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu/ dapper-security main restricted universe multiverse

In addition to this, you must update apt's package lists"

apt-get update

You need to ensure that your machine is up to date with the current
security packages release by Ubuntu. After doing so, an apt-get of the
modules below will install all the requirements for freePBX

root@rob-laptop:~# apt-get install
php5 php5-cli php5-mysql mysql-server php-pear php-db openssh-server
curl sox apache2 subversion build-essential libncurses5-dev libssl-dev
linux-headers-`uname -r` libmysqlclient15-dev

... Please copy-and-paste that line, rather than trying to type it in.

Reading package lists... Done

Building dependency tree... Done

The following extra packages will be installed:

apache-common apache2-common apache2-mpm-prefork apache2-utils

... Several more lines of automatically imported packages ...

mysql-server-5.0 openssh-server php-db php-http php-mail php-net-smtp

php-net-socket php-pear php-xml-parser php4 php4-cli php4-common php4-mysql

php4-pear php5-common sox ssl-cert zlib1g-dev

0 upgraded, 39 newly installed, 0 to remove and 6 not upgraded.

Need to get 40.6MB of archives.

After unpacking 107MB of additional disk space will be used.

Do you want to continue [Y/n]? y

Get:1 http://au.archive.ubuntu.com dapper/main libpcre3 6.4-1.1ubuntu4 [174kB]

Get:2 http://security.ubuntu.com dapper-security/main libapr0 2.0.55-4ubuntu2.1 [132kB]

Get:3 http://au.archive.ubuntu.com dapper/main ssl-cert 1.0.13 [9526B]

Get:4 http://au.archive.ubuntu.com dapper/main curl 7.15.1-1ubuntu2 [168kB]

... The machine now proceeds to download and install packages ...

Setting up sox (12.17.9-1) ...

root@rob-laptop:~#

Downloading and Installing Asterisk

Previous comment:
Options, if you use edgy instead of dapper, you will get the
latest version of asterisk without needing to compile etc etc etc, all
you need to do is: apt-get install asterisk and skip to the section on
MySQL... Dapper also has packaged versions of asterisk and is quite
useable also, and is a lot easier to manage then compiling and
re-compiling to upgrade all the time

Rob's Response:
Well, I tried this, (on 6.06 LTS) and got Asterisk-1.2.7.1, and
Zaptel-1.2.5. Both of these are _woefully_ out of date. Asterisk has 3
Denial-Of-Service bugs and 2 security bugs, and Zaptel doesn't have the
proper echo cancellation enabled in it. Yes. Maybe it might be easier
to type in 'apt-get install asterisk zaptel', but it'll be crap.
Compile from source, it's not that hard. To make it easier, I've put
one box at the bottom of the downloading section that you can
copy-and-paste from to install everything from source.

Downloading
We will be using subversion to download the latest version of the
1.2 branch of Asterisk, Zaptel, LibPRI and Asterisk-Addons.
asterisk-sounds will be the latest version.

root@rob-laptop:/usr/src# svn co http://svn.digium.com/svn/asterisk/branches/1.2 asterisk-1.2

... Lots of files are downloaded ...

root@rob-laptop:/usr/src# svn co http://svn.digium.com/svn/zaptel/branches/1.2 zaptel-1.2

... Zaptel files download ...

root@rob-laptop:/usr/src# svn co http://svn.digium.com/svn/libpri/branches/1.2 libpri-1.2

... LibPRI downloads - Note, this is quite small, only about 15 files. This is normal ...

root@rob-laptop:/usr/src# svn co http://svn.digium.com/svn/asterisk-addons/branches/1.2 asterisk-addons-1.2

... Asterisk-Addons downloads...

root@rob-laptop:/usr/src# svn co http://svn.digium.com/svn/asterisk/trunk/sounds asterisk-sounds

... The default Sounds package downloads now. This can be quite large ...

root@rob-laptop:/usr/src#

Compiling and Installing
You now need to compile and install the latest version of asterisk.

root@rob-laptop:/usr/src# cd libpri-1.2

root@rob-laptop:/usr/src/libpri-1.2# make install

gcc -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g -c -o copy_string.o copy_string.c

gcc -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g -c -o pri.o pri.c

... libpri compiles ...

install -m 644 libpri.a /usr/lib

if test $(id -u) = 0; then /sbin/ldconfig -n /usr/lib; fi

root@rob-laptop:/usr/src/libpri-1.2# cd ../zaptel-1.2

root@rob-laptop:/usr/src/zaptel-1.2# make install config

cc -I. -O4 -g -Wall -DBUILDING_TONEZONE -DSTANDALONE_ZAPATA
-DZAPTEL_CONFIG=\"/etc/zaptel.conf\" -DHOTPLUG_FIRMWARE -c -o
gendigits.o gendigits.c

cc -o gendigits gendigits.o -lm

./gendigits > tones.h

... zaptel compiles - Note that any errors here are usually
because of you not having the correct version of linux-headers'
installed ...

ZAPTELVERSION="SVN-branch-1.2-r1468" build_tools/make_version_h > version.h.tmp

if cmp -s version.h.tmp version.h ; then echo; else \

mv version.h.tmp version.h ; \

fi

... Zaptel compiles ...

root@rob-laptop:/usr/src/zaptel-1.2# cd ../asterisk-1.2

root@rob-laptop:/usr/src/asterisk-1.2# make install

if cmp -s .cleancount .lastclean ; then echo ; else \

make clean; cp -f .cleancount .lastclean;\

fi

make1: Entering directory `/usr/src/asterisk-1.2'

... Asterisk Compiles ...

root@rob-laptop:/usr/src/asterisk-1.2# cd ../asterisk-addons-1.2

root@rob-laptop:/usr/src/asterisk-addons-1.2# make install

./mkdep -fPIC -I../asterisk -D_GNU_SOURCE -I/usr/include/mysql `ls *.c`

make -C format_mp3 all

... Asterisk-Addons now install ...

root@rob-laptop:/usr/src/asterisk-addons-1.2# cd ../asterisk-sounds/

root@rob-laptop:/usr/src/asterisk-sounds# make install

... Lots of additional sound files are installed here ...

root@rob-laptop:/usr/src/asterisk-sounds#

Copy-And-Paste this, for ease of installation:

cd /usr/src
svn co http://svn.digium.com/svn/asterisk/branches/1.2 asterisk-1.2
svn co http://svn.digium.com/svn/zaptel/branches/1.2 zaptel-1.2
svn co http://svn.digium.com/svn/libpri/branches/1.2 libpri-1.2
svn co http://svn.digium.com/svn/asterisk-addons/branches/1.2 asterisk-addons-1.2
svn co http://svn.digium.com/svn/asterisk/trunk/sounds asterisk-sounds
cd /usr/src/libpri-1.2 && make install
cd /usr/src/zaptel-1.2
sed -i 's!^#define ECHO_CAN_KB1!/* #define ECHO_CAN_KB1 */!' zconfig.h
sed -i 's!/\* #define ECHO_CAN_MG2 \*/!#define ECHO_CAN_MG2!' zconfig.h
make install
cd /usr/src/asterisk-1.2 && make install
cd /usr/src/asterisk-addons-1.2
sed -i 's/_GNU_SOURCE/_GNU_SOURCE -DMYSQL_LOGUNIQUEID/' Makefile
make install

If all you wanted to do was install Asterisk on a Ubuntu machine,
you're done - you now have a fully functional Asterisk box, for you to
play with as you wish. If you want, you can run 'make samples' in the
asterisk-1.2 directory to install some example configuration files for
you to play with. However, since you're reading this on the FreePBX
site, we're now up to isetting the machine up and nstalling FreePBX.

Create user and set permissions
Unfortunately, issues in Asterisk 1.2 require us
to run the web server process as the same user as asterisk. In this
situation, it's easier for us to run httpd as 'asterisk', rather than
asterisk as 'httpd', as there's far less configuration that needs to be
done.

root@rob-laptop:~# addgroup asterisk

Adding group `asterisk' (1001)...

Done.

root@rob-laptop:~# useradd -g asterisk -c "Asterisk PBX" -d /var/lib/asterisk asterisk

root@rob-laptop:~# mkdir /var/run/asterisk

root@rob-laptop:~# chown -R asterisk /var/lib/php5

Using nano (or your favourite editor, but nano is fine), you need to change User apache and Group apache to User asterisk and Group asterisk.

[root@dhcp1 ~]# nano +101 /etc/apache2/apache2.conf (Push Control-X to save when you've finished)

You also want to change AllowOverride None to AllowOverride All

[root@dhcp1 ~]# nano +12 /etc/apache2/sites-enabled/000-default (Push Control-X to save when you've finished)

And then restart asterisk to re-load its configuration.

root@rob-laptop:~# /etc/init.d/apache2 restart

Set up MySQL
Before you can do anything to MySQL, you need to make sure it's running:

root@rob-laptop:~# /etc/init.d/mysql start

Starting MySQL database server: mysqld.

root@rob-laptop:~#

Now, you must cd to the /usr/src directory and get the source to freepbx using svn:

root@rob-laptop:/usr/src/freepbx# cd /usr/src/

root@rob-laptop:/usr/src# svn co https://svn.sourceforge.net/svnroot/amportal/freepbx/branches/2.2 freepbx-2.2

A freepbx/amp_conf

A freepbx/amp_conf/astetc

... freePBX now downloads ...

Checked out revision 2574.

root@rob-laptop:/usr/src# cd /usr/src/freepbx-2.2

Now, to configure the databases for freePBX:

root@rob-laptop:/usr/src/freepbx# mysqladmin create asterisk

root@rob-laptop:/usr/src/freepbx# mysqladmin create asteriskcdrdb

root@rob-laptop:/usr/src/freepbx# mysql asterisk < SQL/newinstall.sql

root@rob-laptop:/usr/src/freepbx# mysql asteriskcdrdb < SQL/cdr_mysql_table.sql

They also need to be secured, so that not just anyone can access
them. freePBX will prompt you for a database password when you do the
install. You need to pick that now. We'll assume that you've picked
'asteriskuser' and 'amp109' - you probably shouldn't use these, as they
are well known passwords for Asterisk@Home builds. If anyone's trying
to attack your machine, they will try this.

root@rob-laptop:/usr/src/freepbx# mysql

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 12 to server version: 5.0.22-Debian_0ubuntu6.06.2-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY 'amp109'; (This is the first username and password asked for below)

Query OK, 0 rows affected (0.00 sec)

mysql> GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY 'amp109';

Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;

Query OK, 0 rows affected (0.00 sec)

mysql> \q

Bye

root@rob-laptop:/usr/src/freepbx#

Now, after all of this, you need to pick a root 'mysql' password.
For this, we'll pretend it's 's33kret'. If you need to do anything else
with mysql, you'll need to provide this password.

root@rob-laptop:/usr/src/freepbx# mysqladmin -u root password 's33kret'

Install freePBX at last!
You're there - you've done the hard yards, and finally you can install freePBX!

WARNING! If you have an existing Asterisk
installation, the script below will overwrite your Asterisk
configuration files. Backup your /etc/asterisk directory before
running.

root@rob-laptop:/usr/src/freepbx# ./install_amp

Checking for PEAR DB..OK

Checking for PEAR Console::Getopt..OK

Checking user..OK

Checking for /etc/amportal.conf../etc/amportal.conf does not exist, copying default

Creating new /etc/amportal.conf

Enter your USERNAME to connect to the 'asterisk' database:

[asteriskuser] (Just push enter if you've done the defaults above, or, fill in the details you entered)

Enter your PASSWORD to connect to the 'asterisk' database:

[amp109] (As above, the password you picked in the MYSQL command)

Enter the hostname of the 'asterisk' database:

[localhost] (Just push enter)

Enter a USERNAME to connect to the Asterisk Manager interface:

[admin] (Just push enter)

Enter a PASSWORD to connect to the Asterisk Manager interface:

[amp111] (Just push enter)

Enter the path to use for your AMP web root:

[/var/www/html]

/var/www

Enter the path to use for your FOP web root:

[/var/www/html/panel]

/var/www/panel

Enter the path to your Apache cgi-bin:

[/var/www/cgi-bin] /usr/lib/cgi-bin

Enter the IP ADDRESS or hostname used to access the AMP web-admin:

[xx.xx.xx.xx] Enter the IP Address of your UBUNTU SERVER HERE

Enter a PASSWORD to perform call transfers with the Flash Operator Panel:

[passw0rd] (Just push enter)

Use simple Extensions [extensions] admin or separate Devices and Users [deviceanduser]?

[extensions](Just push enter)

Enter directory in which to store AMP executable scripts:

[/var/lib/asterisk/bin] (Just push enter)

Created /var/lib/asterisk/bin

Enter directory in which to store super-user scripts:

[/usr/sbin] (Just push enter)

/etc/amportal.conf writtenOK

Reading /etc/amportal.conf..OK

Checking for /etc/asterisk/asterisk.conf..OK

Reading /etc/asterisk/asterisk.conf..OK

Checking for Asterisk 1.2..OK

Checking for selinux..OK

At this stage, you're almost done, but there's quite often a
problem when people have made a typo, or forgotten to put a password in
the mysql server. If you see these lines:

Connecting to database..FAILED

Try running ./install_amp --username=user --password=pass (using your own user and pass)

[FATAL] Cannot connect to database

root@rob-laptop:/usr/src/freepbx#

it means that you haven't done the 'GRANT ALL PRIVILEGES ...'
command in MySQL, or, you've put the wrong password in when you were
doing the installation. All is not lost. If you want to re-run the
installation, with it prompting you again, you can simply delete the
/etc/amportal.conf file (rm /etc/amportal.conf) or edit it and put the correct password in. Then re-run ./install_amp and it should proceed along happily.

root@rob-laptop:/usr/src/freepbx# ./install_amp

Checking for PEAR DB..OK

Checking for PEAR Console::Getopt..OK

Checking user..OK

Checking for /etc/amportal.conf..OK

Reading /etc/amportal.conf..OK

Checking for /etc/asterisk/asterisk.conf..OK

Reading /etc/asterisk/asterisk.conf..OK

Checking for Asterisk 1.2..OK

Checking for selinux..OK

Connecting to database..OK

Checking current version of AMP..2.1.2

Installing new AMP files..OK

Configuring install for your environment..OK

Setting permissions on files..OK

Checking for upgrades..0 found

Generating AMP configs..

Generating Configurations.conf..

Checking for PEAR DB..OK

Checking for PEAR Console::Getopt..OK

Checking for /etc/amportal.conf..OK

Reading /etc/amportal.conf..OK

Reading /etc/asterisk/asterisk.conf..OK

Connecting to database..OK

Please Reload Asterisk by visiting http://192.168.1.53/admin

Generating AMP configs..OK

Restarting Flash Operator Panel..op_server.pl: no process killed

OK

Please Reload Asterisk by visiting http://192.168.1.53/admin

root@rob-laptop:/usr/src/freepbx# modprobe ztdummy

root@rob-laptop:/usr/src/freepbx# amportal start

Starting FreePBX and Asterisk automatically
If you don't have any zaptel hardware, you can automatically start
ztdummy and asterisk by editing /etc/rc.local, and before the 'exit 0'
line insert these two lines:

modprobe ztdummy
/usr/sbin/amportal start &

That ensures that the timing module (ztdummy) is loaded, and that
asterisk is running on bootup. You can also use the /etc/init.d/zaptel
script to start zaptel, hopefully someone with more ubuntu knowledge
can update this page with how to enable it.

Congratulations!
You're done - you now have a fully functional FreePBX
Installation. The first thing to do is log in (Go to the IP address of
the Ubuntu machine above, and click on 'Setup'). The default username
is 'admin' and the default password is 'admin'. Go to the
'Administrators' tab and change the password straight away. After that,
you can visit the Online Module Repository and see what modules are
available.


Install Process for Ubuntu Server 7.04

Placeholder until more detailed instructions can be written
For now, see UbuntuServer or the Ubuntu 6 Installation Instructions


Installing the FreePBX Distro

Installing the FreePBX Distro

1. Download the ISO file from the FreePBX web-site.

2. Convert the ISO file to a DVD or CD. On Windows 7 machines, right click on the file and select "open with," and then Windows Disc Image Burner. For computers running other operating systems, Google convert ISO to CD and you'll find plenty of instructions.

3. Select a computer to install the FreePBX Distro on. EVERYTHING ON THIS COMPUTER WILL BE DELETED AND REPLACED WITH THE FREEPBX DISTRO. Configure the computer to boot from a DVD or CD. Insert the DVD or CD into the computer and turn it on.

NOTE: You must be connected to the internet to run the installer

If you're installing using a USB drive, you may encounter a "kickstart" error while installing. If you do, don't fret! Just keep hitting enter when the prompts appear and everything will probably work just fine.

4. The installer will begin with a black background and with white text appearing down screen. Within 30 seconds, the screen will change to a blue background. A gray window will appear that asks you to configure your TCP/IP settings. The default settings should work fine, so press the TAB key until the red "OK" box is highlighted in white, and then press ENTER.

5. The system will present you with a window showing that it is retrieving images while it downloads the install package from the internet. That should take 3-5 minutes.

6. After the system is done downloading the install files from the internet, you'll see a series of messages asking you about your network configuration. The default selections are fine in most cases, so just press TAB until the red "Yes" box is highlighted in white and then press ENTER. Keep repeating this process until you reach the "Time Zone Selection" screen.

7. Eventually, you will reach the "Time Zone Selection" screen. If your system clock uses GMT (most do not), hit space. Then, hit TAB to move to the time zone selection area. Use the up and down arrows to select the time zone where you will use the system, and then hit TAB until the red "OK" button is highlighted in white. Then, hit ENTER.

8. The installer will ask you to to select your Root password. The Root password is the password you'll use to login to the Linux command prompt later. Selecting a secure password is very important. Type the password, hit TAB, type it again, hit TAB, and then hit ENTER.

9. The installer will do a dependency check, will format your hard drive, and then start the package installation process. There may be a significant delay before the installation actually starts, so be patient. Eventually, the installation will show you a progress bar indicating the percentage completed and the time elapsed/remaining. That process should take between 20 and 30 minutes.

10. The installer will install the bootloader and some other scripts, and then reboot your computer. More white text will appear on a black background as the completed installation boots. A few additional packages will be installed and updated while in this mode. Your computer will then reboot again.

11. Your computer will boot again, and you'll reach the Linux console/command prompt login. You can login here using the username "root" without quotes, and the Root password you selected earlier.

12. After you login, type "ifconfig" at the command line and determine the IP address of your machine (to the right of eth0). Then type "exit" to return to the login screen.

13. Go to another computer on the same network and enter that IP address into your web browser. The first time you do so you'll be asked to select the admin user and the admin password. That username and password will be used in the future to access the FreePBX configuration screen. You will also be asked to set the "FOP Password" which you can use to access the "Flash Operator Panel."

Note: These passwords do not change the Root password! They are only used for access to the FreepBX web interface.

14. The main FreePBX screen will offer you four options:

PBX Adminstrator will allow you to configure your PBX. Use the admin user and admin password you configured in the step above to login. This section is what most people refer to as "FreePBX."

The User Control Panel (aka ARI) allows users to listen to their voicemail mesages and change certain features such as call forwarding. Users login using their extension number and voicemail password. The Administrator logs in using the username "admin" and the password set-up during the install.

The Flash Operator Panel is a screen that allows an operator to control calls, using the FOP Password you configured above. It is disabled by default in the FreePBX Distro, but can be enabled in the Advanced Settings Module, by changing "Disable FOP" to False, clicking the green check-box to the right that appears after changing it to False, and then clicking the Orange "Apply Configuration Changes" at the top.

Alternatively, you can install the Flash Operator Panel 2 (a commercial product that works much better than the original, free Flash Operator Panel, but which has limited utility unless you pay for a license), by typing

yum install fop2-freepbx

at the command line.

15. The FreePBX Distro offers you the option of installing some additional features. From the command prompt, you can install certain additional features by typing "yum install (name of feature)".

For a full list of add-ons that can be installed using "yum install" click here:

http://www.freepbx.org/forum/freepbx-distro/distro-discussion-help/add-o...

For example, if you want to install Flash Operator Panel 2, type:

yum install fop2-freepbx

at the command line.

If you want to install the Aastra Scripts, type

yum install aastra-xml-scripts

at the command line.

For more information on the Aastra Scripts or to download instructions on how to use them, click on this link:

http://pbxinaflash.com/forum/showthread.php?t=7712

First Steps After Installation

For some suggestions on what to do after you finish the installation read about the First Steps After Installation.

Upgrading the FreePBX Distro

For information on the release versions and how to upgrade the FreePBX Distro read Upgrading the FreePBX Distro.


Updating the FreePBX Distro

Updating the FreePBX Distro

For information about the current and prior release versions and to download updates for the FreePBX Distro, follow this link:

http://www.freepbx.org/forum/freepbx-distro/distro-discussion-help/relea...

If you wish to update, you must run every individual update between your version and the version you wish to update to. You cannot simply download and install the latest update (unless you are only one version behind).

To find out which version of the FreePBX Distro you are running, type this command from the command prompt:

cat /etc/asterisk/freepbxdistro-version

To download and install an update, issue these commands from the command prompt on Linux:

cd /usr/src/upgrades/
wget http://upgrades.freepbxdistro.org/1.8.2.0/upgrade-1.8.2.0-2.sh
chmod +x upgrade-1.8.2.0-2.sh
./upgrade-1.8.2.0-2.sh

Once the update is complete, reboot your system by typing:

reboot

Note: Replace "1.8.2.0/upgrade-1.8.2.0-2.sh" above with the particular update from the Release Versions page (see link above). In the second and third line, replace "upgrade-1.8.2.0-2.sh" with the particular update from the Release Versions page. Note that the first line will require changing the directory and the second and third lines only require changing the file name (ending in .sh).


Upgrading your system

Upgrading FreePBX
Note: These directions are for source based installs, we recommend using Module Admin to upgrade your FreePBX GUI whenever possible. You may need to install subversion for your linux distribution if you have any errors. Do this by typing yum -y install subversion at the root prompt.
Upgrading to the latest Released Version: 2.9.0
You will want to pull the release tarball, and follow the instructions below. Once you have installed it you will want to navigate to Module Admin menu item and update all modules as well as install other available modules not included in the release tarball.

cd /usr/src/
wget http://mirror.freepbx.org/freepbx-2.9.0.tar.gz
tar zxvf freepbx-2.9.0.tar.gz
cd freepbx-2.9.0
./start_asterisk start # for upgrades use: amportal start 
./install_amp

On some rare cases you may experience an issue with the SQL database not being correctly updated. If that appears to be the case, you can safely add the --force-version option. For example, if you were upgrading from version 2.6.0 you might type:

cd /usr/src/freepbx-2.9.0
./install_amp --force-version=2.6.0

(Replace 2.6.0 with the version you are upgrading from, or an earlier version which is also safe)

You can also pull directly from SVN for beta/RC testing by following the instructions below but using the 2.9 branch instead of the 2.8 branch.

Upgrading to the 2.10 Beta/RC
You will want to pull the release tarball, and follow the instructions below. Once you have installed it you will want to navigate to Module Admin menu item and update all modules as well as install other available modules not included in the release tarball.

cd /usr/src/
wget http://mirror.freepbx.org/freepbx-2.10.0beta2.tar.gz
tar zxvf freepbx-2.10.0beta2.tar.gz
cd freepbx-2.10.0beta2
./start_asterisk start # for upgrades use: amportal start 
./install_amp

On some rare cases you may experience an issue with the SQL database not being correctly updated. If that appears to be the case, you can safely add the --force-version option. For example, if you were upgrading from version 2.6.0 you might type:

cd /usr/src/freepbx-2.10.0beta2
./install_amp --force-version=2.9.0

(Replace 2.9.0 with the version you are upgrading from, or an earlier version which is also safe)

You can also pull directly from SVN for beta/RC testing by following the instructions below but using the 2.10 branch.

Upgrading to the latest stable 2.9 branch from SVN
If you prefer to pull directly from the SVN repository you can follow these instructions below. Once you have installed FreePBX it is important to navigate to Module Admin in FreePBX and upgrade your modules. Installing FreePBX in this way (vs. using the release tarball) is not recommended for initial installs unless you are very familiar with the project. Without loading critical modules like core, framework, voicemail and some others your system will not be able to do anything for you or will function improperly.

cd /usr/src/
svn co http://svn.freepbx.org/freepbx/branches/2.9 freepbx-2.9

Installation instructions are the same as above after exploding the tarball

Note:Need to get the new func_devstate features to take advantage of the optional BLF? You can get a version that works on 1.4 from this website, and then you simply put the file in your apps subdirectory of your asterisk source and re-run make and make install. To use this mode, amportal.conf needs the setting:

USEDEVSTATE=true

Upgrading to 2.6 From trixbox
If you are using a version of trixbox that no longer connects to the FreePBX repository and does not provide you with the 2.6 Upgrade Tool, you can upgrade to 2.6 by following these simple instructions. The process will simply install a special version of the Upgrade Tool and then you will upgrade just the same as the normal GUI upgrade process. Although the tool may indicate you are upgrading to a beta or release candidate program, since 2.6 has gone final, you will actually be upgraded to the current 2.6 released version. The steps are simply:

  1. Download the upgrade module to your desktop by pressing this link: Download trixbox Upgrade Tool
  2. Navigate to Module Admin in FreeBPX, click on the Upload module link and then browse to the module you downloaded in step 1, choose it, and then press upload.
  3. Now you simply install the module as if you were downloading it from the Online Repository and then you can follow the instructions provided by the module to upgrade!

The process is almost identical to pulling the module from our repository and once you do this, you will have access to all the great features and many bug fixes no present elsewhere.
Upgrading to the trunk branch
The trunk is where active development happens. The project tries hard to keep it relatively stable and you will find it is fairly safe to run off of this branch most of the time, although it is actively being developed on so glitches can occur. This differs from release branches where they are limited to the latest bug fixes. You can access the development trunk as described below.
To run off of trunk and keep up-to-date with every change even before modules get published, there is a set of tools that will help you build an install environment where you do NOT use Module Admin to keep up-to-date. The instructions are:

cd /usr/src/
svn co http://svn.freepbx.org/freepbx/trunk freepbx-trunk
cd freepbx-trunk
./setup_svn.php

At this point, you will now have a special SVN environment where all the FreePBX modules are pulled into your install directory. You can then do a normal install:

./install_amp --force-version=2.4.1

Note that you will always want to do a force-version in case there are new schema changes introduced since the last time you updated. If you are updating from a release prior to 2.4.1, you should use that release number the first time, but 2.4.1 after that is fine.
Now, instead of using Module admin with this setup, you can simply follow the following procedure to update yourself to the newest updates that may have been committed:

cd /usr/src/freepbx-trunk
svn update
./install_amp --force-version=2.4.1 #(*)

(*) if there were no updates pulled, then there is no need to do an install amp again
The install will take longer because it will be going through the process of reinstalling all modules, but it will do such with all new changes even before they are published to the Online Repository.