FreePBX Production Install Guide (CentOS v5.x, Asterisk v1.4.x, FreePBX v2.4.x)

FreePBX Asterisk install and configure guide for CentOSv5.x, Asteriskv1.4.x, and FreePBX v2.4.x.  Includes every detail in the form of step by step instructions from bare metal to a running VoIP PBX in about 2 hours.

For printer friendly version of this guide create an account and login.  It will only take a few seconds.

Sections: 

My Hardware

I have used this install guide on various other hardware without any problems.

Qty 1 Supermicro SC823T-R500LP, 2U, redundant 500W ps w/ PFC, 6x1" SATA hot swap bays, DVD-RW/Floppy
Qty 1 Supermicro PDSME, Intel E7230 chipset, Dual LAN, 2x 64-bit 133MHz PCI-X, 2x 64-bit 100MHz PCI-X
Qty 1 Intel Pentium D805 2.66Ghz CPU
Qty 2 Kingston KVR667D2N5/512, 512MB 667MHz DDR2 Non-ECC CL5 DIMM
Qty 2 Seagate ST380811AS Barracuda 80GB 7200rpm SATA-II 8MB Cache Harddrive
Qty 1 Samgoma Remora A200D PCI Card 0 FXS / 8 FXO Ports + Echo Cancellation Low Profile
Qty 1 Aastra 57i SIP executive phone
Qty 1 Aastra 480iCT SIP executive phone with cordless handset
Qty 1 Aastra 55i SIP manager phone
Qty 7 Aastra 9133i SIP business phone

Conventions

Comments are Arial Italic
Linux command line entries are in courier

Software RAID1 CentOS Install

For default (non-software RAID) CentOS install skip to the next section.

Close ALL port forwards in the firewall  to the server IP we are about to install

Install CentOS from DVD by booting from it.  Set system time to UTC.

 
This procedure assumes your using the GUI install method.  For "linux text" based install it is a bit different and less intuitive.  I recommend using the GUI (default) method.
At the drive setup menu select "Remove all partitions from select drives"
Check the "create custom layout" box>select "next"
At the next menu it will show you the current default configuration.  If it shows ANYTHING beside 2 or more 100% free space drives click on the LVM and/or partitions and press "delete".  All you want right now is 2 or more drives showing 100% free space, no partitions or LVM volumes.

1) At the next menu select RAID>create software RAID partition>ok
Select one of the 2 RAID disks and create boot partition of 100MB check "force to be primary partition"
Repeat and again select the same drive and create size equal to twice the amount of RAM
Repeat and again select the same drive and select "fill to maximum allowable size"

Now you should see one of your two drives with three partitions labelled as type "Software RAID"

2) Now repeat the above procedure EXACTLY the same for your second drive.
Now you should see both drives with 3 equivalent partitions all labelled as type "Software RAID"
Go back to the first drive "root" partition and click "edit" and change from "fill to maximum allowable size" to "fixed size" and use the same size as it was before.  This is done so that the ordering of the partitions on both drives (boot=md0, swap=md1, root=md2) are exactly the same.

3) Now repeat but this time select "create RAID device"
Check the 100MB partition on each drive so you have 2 check marks and select RAID 1, boot, ext3
Now Repeat and select the partition equal to twice the size of your RAM on each of the two drives and select RAID 1, swap
Repeat again and select the root partition on each of the two drives and select RAID 1, /, ext3

We could also create LVM volumes but that is not required for an Asterisk installation so in my humble opinion it is not recommended and beyond the scope of this installation procedure.

So now the main menu should show 3 RAID 1 devices corresponding to the 3 identical pairs of Software RAID partitions on the two drives.  It sounds a bit confusing when in writing but when you go through the GUI and actually do everything it should make a lot more sense.
 

Now select "Next" twice (using default GRUB bootloader options).

 Set static IP, netmask, gateway, DNS server
Set hostname to something like "asterisk.local".  If you have multiple installs it is important to make this hostname unique for each install so when you get email notifications you will know which PBX is sending it.

NOTE: If you have 2 ethernet adapters/ports you can make eth0 and eth1 identical except eth0 is active on boot and eth1 is NOT!  That way if one ethernet port ever fails you can quickly make the other port active.

Ensure that all package groups and modules in default and custom install packages are DE-selected for install (including "base system") so that only a bare minimal install is done:

For performance and security reasons it is important to update the system immediately after install.
yum -y update
reboot

The following packages also need to be installed with yum:

yum groupinstall core
yum groupinstall base

yum install php-mysql mysql-devel ncurses-devel tftp-server php-pear libtermcap-devel nano ntp wget setuptool gcc gcc-c++ make flex patch bison kernel-devel byacc mysql-server sendmail cpuspeed system-config-network-tui acpid smartmontools


Disable Firewall and SELinux
setup agent

Go to firewall configuration and ensure SELinux and Firewall are disabled

Reboot
reboot

Skip the next section (non-RAID CentOS install) and proceed to the section after that.

Default (non-software RAID1) CentOS install

Close ALL port forwards in the firewall  to the server IP we are about to install
Install CentOS from DVD by booting from it.  Set system time to UTC.
Partition /dev/sda1 as “boot” 100Meg ext3
Partition /dev/sda2 as “/ “ 74000Meg ext3
Partition /dev/sda3 as “swap” 1900Meg
Set static IP, netmask, gateway, DNS server
Set hostname to something like "asterisk.local".  If you have multiple installs it is important to make this hostname unique for each install so when you get email notifications you will know which PBX is sending it.

Make eth0 and eth1 identical except eth0 is active on boot and eth1 is NOT!  That way if eth0 ever fails you can easily switch over the cable and activate eth1.

Ensure that all package groups and modules in default and custom install packages are DE-selected for install (including "base system") so that only a bare minimal install is done:

For performance and security reasons it is important to update the system immediately after install.
yum -y update

The following packages also need to be installed with yum:

yum groupinstall core
yum groupinstall base

yum install php-mysql mysql-devel ncurses-devel tftp-server php-pear libtermcap-devel nano ntp wget setuptool gcc gcc-c++ make flex patch bison kernel-devel byacc mysql-server sendmail cpuspeed system-config-network-tui acpid


Disable Firewall and SELinux
setup agent

Go to firewall configuration and ensure SELinux and Firewall are disabled

Reboot
reboot

CentOS Post Install Configuration

Enable the tftp server
nano /etc/xinetd.d/tftp
change “disable=yes” to “disable=no”
(Ctrl-X>y>ENTER)

Disable Hard Drive SMART monitoring if using SATA hardRAID
chkconfig smartd off

Configure the network time server for managing the time displayed on the server and the phones.
nano +21 /etc/ntp.conf

restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
server 0.north-america.pool.ntp.org
server 1.north-america.pool.ntp.org
server 2.north-america.pool.ntp.org

Leave everything else at defaults.  All other lines that start with “restrict” should be commented out “#”

Configure time server to start at boot
/sbin/chkconfig --level 345 ntpd on

Download and untar source files

lame is not available through a yum repository; but it can be obtained and installed from Dag Wieers' RPM repository
rpm -ivh http://apt.sw.be/redhat/el5/en/i386/RPMS.dag/lame-3.97-1.el5.rf.i386.rpm

Get the latest released version of freePBX
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.

cd /usr/src
wget
http://umn.dl.sourceforge.net/sourceforge/amportal/freepbx-2.4.x.tar.gz
tar zxvf freepbx-2.4.x.tar.gz

Get the latest released version of Asterisk
wget http://downloads.digium.com/pub/telephony/asterisk/asterisk-1.4.x.tar.gz
tar zxvf asterisk-1.4.x.tar.gz

wget http://downloads.digium.com/pub/telephony/zaptel/zaptel-1.4.x.tar.gz
tar zxvf zaptel-1.4.x.tar.gz 
wget
http://downloads.digium.com/pub/telephony/asterisk/asterisk-addons-1.4.x.tar.gz
tar zxvf asterisk-addons-1.4.x.tar.gz

Compile/install Zaptel and Asterisk

cd /usr/src/zaptel
make clean
./configure; make menuselect
At menu press "x"
make; make install

This command creates the start up scripts so zaptel starts on boot. If you have a Sangoma card then skip this step.
make config

cd /usr/src/asterisk-1.4.x
make clean
./configure; make menuselect
select core sounds and uncheck all except ulaw.  Same with addon sounds
At menu press "x" to save

make; make install
mkdir /var/run/asterisk
mkdir /var/lib/asterisk/sounds/custom

From a command prompt run 'genzaptelconf' to automatically create the /etc/zaptel.conf and /etc/asterisk/zapata.conf files

Sangoma Wanpipe Installation

If you don't have a sangoma card you can skip this and go to the next section.

cd /usr/src

#Create a virtual link to zaptel directory for Sangoma
ln -s zaptel-1.4.x zaptel

Check sangoma.com to see if this is the latest wanpipe driver.  Download the newest released or beta version for the A200D card.
wget ftp://ftp.sangoma.com/linux/current_wanpipe/wanpipe-2.3.4-13.tgz
tar zxvf wanpipe-2.3.4-13.tgz
cd /usr/src/wanpipe-2.3.4-13
./Setup install

Would you like to install WAN Router now? (y/n) y

Would you like update/upgrade wanpipe drivers? (y/n) y

Press [Enter] to continue...

Proceed to build WANPIPE kernel modules ? (y/n) y

Please Select Compilation Mode

1. WAN Protocol Support (Default)

        Protocols: Frame Relay, CHDLC, PPP, X25 and ADSL

2. TDM Voice (Asterisk) Support Only

        Protocols: TDMV (Asterisk) on AFT adatpers.

3. TDM Voice (Asterisk) + WAN Protocol Support

        Protocols: TDMV, Frame Relay, CHDLC, PPP, X25, ADSL

4. TDM Voice (Asterisk) + SS7 Support + WAN Protocol Support

        Protocols: TDMV, SS7, Frame Relay, CHDLC, PPP, X25, ADSL

5. Custom Compilation Mode

        Specify protocols to be added into the WANPIPE

        kernel drivers.

Please select (1,2,3,4 or 5) [Default: 1]: 2

Press Enter for Default
Press Enter for Default

Enable TDMV DCHAN Native HDLC Support & Patch Zaptel ? (y/n) y

Your Zaptel source was modified, recompile/reinstall zaptel ? (y/n) y

Everything else just continue to go with “y” or ENTER for defaults

To upgrade the Wanpipe driver proceed as follows:

check your current version

wanrouter version

Rename or delete original wanpipe source directory

Download new source from Sangoma

Stop Freepbx/Asterisk
amportal stop

And just to make sure asterisk stops
asterisk stop

Now stop the wanrouter software
wanrouter stop

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.

cd /usr/src
useradd -c "Asterisk PBX" -d /var/lib/asterisk asterisk
chown asterisk /var/lib/php/session/

Change (Copy) MOH directory:
cp -vR /var/lib/asterisk/moh /var/lib/asterisk/mohmp3
chown -vR asterisk.asterisk /var/lib/asterisk/mohmp3
chmod -v 775 /var/lib/asterisk/mohmp3
chmod -v 664 /var/lib/asterisk/mohmp3/*

You need to change User apache and Group apache to User asterisk and Group asterisk.

sed -i “s/User apache/User asterisk/” /etc/httpd/conf/httpd.conf
sed -i “s/Group apache/Group asterisk/” /etc/httpd/conf/httpd.conf

Change the default AllowOverride All to AllowOverride None to prevent .htaccess permission problems.
sed -i “s/AllowOverride All/AllowOverride None/” /etc/httpd/conf/httpd.conf

Set up MySQL

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

/etc/init.d/mysqld start
Initializing MySQL database:                               [  OK  ]
Starting MySQL:                                            [  OK  ]


Now, to configure the databases for freePBX:
Note: If mysql admin password is already configured, add "-p" after the command and enter password when asked.  For example, "mysqladmin -p create asterisk"

cd /usr/src/freepbx-2.3
mysqladmin create asterisk
mysqladmin create asteriskcdrdb
mysql asterisk < SQL/newinstall.sql
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.

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

Now, after all of this, you need to pick a root 'mysql' password. We'll make it 'abcdef'. If you need to do anything else with mysql, you'll need to provide this password.
mysqladmin -u root password 'abcdef'

FreePBX Pre-install

Build the cdr_mysql module for Asterisk (Yep, more compiling!)
cd /usr/src/asterisk-addons-1.4.x

make clean
./configure; make menuselect

At menu press "x"

make; make install

Install PEAR Database
pear install DB

Install freePBX

/usr/sbin/safe_asterisk
cd /usr/src/freepbx-2.3.x
./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
**NOTE: Leave this IP blank if you intend to access Flash Operator Panel from the Internet 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
.
.
.
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
Usage: amportal start|stop|restart|start_fop|stop_fop|restart_fop|kill|chownspan style="background-color: #E9ECEF; background-position: 0% 0%">

start: Starts Asterisk and Flash Operator Panel server if enabled
stop: Gracefully stops Asterisk and the FOP server
restart: Stop and Starts
start_fop: Starts FOP server and Asterisk if not running
stop_fop: Stops FOP serverg
restart_fop: Stops FOP server and Starts it and Asterisk if not running
kill: Kills Asterisk and the FOP server
chown: Sets appropriate permissions on files
 

Set FOP to run on startup
nano +52 /etc/amportal.conf
FOPRUN=true


The amportal script is the recommended way to stop and start asterisk:
/usr/local/sbin/amportal stop
/usr/local/sbin/amportal start

Automatic start-up
echo /usr/local/sbin/amportal start >> /etc/rc.local

For some reason it has become necessary to change amportal.conf access restrictions around about FreePBX v2.2.x
chmod 775 /etc/amportal.conf

Edit /etc/asterisk/cdr_mysql.conf and add logunieqid=yes nano /etc/asterisk/cdr_mysql.conf
loguniqueid=yes

FreePBX Post Install

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:

chkconfig --list httpd
httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off 
 

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.
chkconfig httpd on
chkconfig mysqld on

You can now access freePBX with your web browser.

Edit Apache web server for GUI access using a port other than 80 (optional):
nano /etc/httpd/conf/httpd.conf
change "Listen 80" to "Listen 8888" or whatever port you want

/etc/rc.d/init.d/httpd restart

Instead of accessing FreePBX by http://xxx.xxx.xxx.xxx
You now access it by
http://xxx.xxx.xxx.xxx:8888

Edit Flash Operator panel so that it is accessible from outside the LAN by leaving the "web_hostname" blank.  Note:  Port 4445 must be forwarded to the asterisk server on the Firewall/Router.

nano +34 /var/www/html/panel/op_server.cfg
web_hostname=
(Ctrl-X>y>ENTER)

The current default settings in FreePBX after a fresh install is no username/password required to access the GUI.  To enable the Admin password edit /etc/amportal.conf and change Authtype=none to Authtype=database.  The default username/password is admin/admin.

nano +582 /etc/php.ini
change the “max filesize” from 2M to 20M to allow larger music on hold files

NOTE:  Flash operator panel v0.28 does not seem to be working on IE browsers with the latest versions of Adobe Flash Player.  Until a new version of FreePBX is released with Flash Operator Panel v0.29 or higher you need to update FOP manually.  Download v0.29 of op_server.pl and operator_panel.swf to /var/www/html/panel/ replacing the existing files.  Then add "use_amportal_conf=1" (without "") to /var/www/html/panel/op_server.cfg under [general].  Do an "amportal restart" and delete your IE browser temp files.
 

Firewall/Router configuration

The following ports needed to be forwarded to the asterisk server for various remote access

Port 80 (Freepbx web access)
Port 4445 (Flash Operator Panel web access)
Port 4569 (IAX remote phone clients)
Port 5059-5061 (registration and proxy server access, default is 5060)
Port 10000-20000 (ports reserved for RTP voice packets for SIP phone conversations by Asterisk)

NOTE: The RTP ports 10000-xxxxx forwarded in the firewall/router need to match the setting in /etc/asterisk/rtp.conf

Adjust Zaptel Gain

To adjust gain you run:
/usr/src/zaptel ./ztmonitor 1 –v

Make or receive a phone call on line 1.  Adjust the rx and tx gain in /etc/asterisk/zapata.conf  accordingly, do a “amportal restart” and try again until you get a good range that is not too low and not too high on average.

External SIP extensions

nano /etc/asterisk/sip_nat.conf
nat=yes
externip=<your fixed external IP> or
;externhost=yourdns.com
localnet=192.168.1.0/255.255.255.0
externrefresh=10

(Ctrl-X>y>ENTER)

Also, when adding the external SIP extension in FreePBX, make sure to change the nat=never default in the configuration to nat=yes for the extension that will be external.

Logger.conf setup

By default, Asterisk/Freepbx installs with full (debug and verbose) logging enabled.  This generates a significant amount of extra write activity to the hard drives and creates a very large "var/log/asterisk/full" log file in a short amount of time.  After the initial settling in period when debug logging is no longer required it is a good idea to disable this to reduce the stress on the drives and extend their life.

nano /etc/asterisk/logger.conf

change
full => notice,warning,error,debug,verbose
to
full => notice,warning,error,verbose

you will need to restart Asterisk or type LOGGER ROTATE at the CLI to get this change to take effect (reload doesn't do it apparently).

Logrotate Setup

Asterisk/FreePBX does not set up a configuration to automatically rotate the log files for some reason.  Kind of suprising.  I only noticed because the /var/log/asterisk/full log file got to 300MB after only a month.  It would probably crash the system after awhile.  Create  the following file.

nano /etc/logrotate.d/asterisk

Now add the following  to make sure the asterisk log files are rotated weekly along with all the other log files.

/var/log/asterisk/messages /var/log/asterisk/*log /var/log/asterisk/full {
   missingok
   notifempty
   sharedscripts
   create 0640 asterisk asterisk
   postrotate
   /usr/sbin/asterisk -rx 'logger reload' > /dev/null 2> /dev/null
   endscript
}

Sendmail configuration

Edit /etc/aliases file  and add a “root: username_to_forward_to” to forward all ‘root’ messages to your personal email address.  Put in the full email address if it is not on the asterisk system itself.
Then run  
/usr/bin/newaliases
to restart the service.

If emails are not received you must set up masquerading in sendmail.  These still may be rejected if the email server requires the source of the email to also resolve to the same DNS that sendmail is masquerading as.
To enable this, add the following lines to the /etc/mail/sendmail.mc file:
MASQUERADE_AS(domain.com)dnl
FEATURE(masquerade_envelope)dnl
FEATURE(masquerade_entire_domain)dnl
MASQUERADE_DOMAIN(domain.com)dnl
 

Put a “dnl” in front of the line ”EXPOSED_USER (`root’) dnl”.  This enables host masquerading for root as well which is disabled by default.
Update the Sendmail configuration files using the m4 macro processor to generate a new sendmail.cf file by executing the following command:
# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
To get the Sendmail macro file, the sendmail-cf package must be installed on the system.
After creating a new /etc/mail/sendmail.cf file, restart Sendmail for the changes to take effect. To do this, use the following command:
# service sendmail restart

 

Backup suggestions

When backups are created in Freepbx, they are located in /var/lib/asterisk/backup and can be copied elsewhwere

If you want to restore a previous configuration, load the backup files into the above directory.  You must first create the “backup” directory or whatever name you want in freepbx backup and restore module.  If Voicemail problems occur after a backup restore, try restoring just the voicemail part.

Create Acronis Workstation 9.1 (or later) recovery DVD on a PC and boot the Asterisk server on it.  Follow instructions to create a hard drive image of the server onto the DVD.  In the event of an emergency when the Asterisk server is corrupted beyond repair, this recovery DVD can restore the server back to the fresh install state.  If it complains about writing to the same DVD disk as it booted from while making the backup, just eject the drive and slide it back in again.  Enable write cache on the 3ware RAID card for faster recovery.

Optional

Add password protection to the FreePBX splash page /var/www/html

Unfortunately this sort of defeats the purpose of using the 'Admin' module in FreePBX as it adds an additional log in step beforehand.  If you use the same username/password you don't need to log into the admin section again.  This is probably the best solution until the FreePBX team adds this security to their Admin module.

mkdir -p /usr/local/apache/passwd
htpasswd /usr/local/apache/passwd/wwwpasswd NewUserName

Apache will prompt you for a new password for the user name you've just indicated
New password:
Apache will prompt you to retype your new password
Re-type new password:
Apache will then confirm the new user
Adding password for user NewUserName

Now you have to add the user name you've just created to the "httpd.conf" file. To edit that file in "nano" type:
nano /etc/httpd/conf/httpd.conf
Now do a CTRL-W to search for "AuthUser" and you'll find the area where all the users are listed (for example: "maint", your AMP user).  If you don't find any try around line 587 right after the cgi-bin "<Directory....."  entry.

Now add the following lines:
#Password protect the FreePBX Splash Page /var/www/html
<Directory /var/www/html>
AuthType Basic
AuthName "Restricted Area"
AuthUserFile /usr/local/apache/passwd/wwwpasswd
Require user NewUserName1 NewUserName2 NewUserName3 yaddayaddayadda
</Directory>

To delete an Apache user, type in the following and then remove the user from the "httpd.conf" file.
htpasswd -D /usr/local/apache/passwd/wwwpasswd NewUserName

Then restart apache.
/etc/init.d/httpd restart

Optional installation of Octasic Softecho

cd /usr/src
wget
ftp://ftp.octware.net/pub/octvqe8/32-bits/latest/octvqe8-01.0x.00-pr-<arch>.tgz
wget
ftp://ftp.octware.net/pub/octvqe8/32-bits/latest/octvqe8-01.0x.00-pr-base.tgz
tar zxvf octvqe8-01.0x.00-pr-<arch>.tgz
tar zxvf octvqe8-01.0x.00-pr-base.tgz
cd octvqe8-01.0x.00-pr
cp -rf octvqe /usr/src/zaptel/kernel
cd /usr/src/zaptel/kernel/octvqe
amportal stop
make; make install
killall octvqed
wanrouter stop
rmmod zttranscode
rmmod zaptel
rmmod octvqe
depmod
modprobe octvqe

cd /usr/src/octvqe8-01.0x.00-pr
cp octwareec.h /usr/src/zaptel/kernel
cd /usr/src/zaptel/kernel

nano zconfig.h

Look for the line that starts with "#define ECHO_CAN" and edit it to read
#define ECHO_CAN_OCTWARE
(Cntl-x, y, ENTER)

nano zaptel-base.c
search for the section that starts with "/* Echo cancellation */"
There will be several similar lines defining the various echo cancellors.  Add these lines
.
#elif defined(ECHO_CAN_OCTWARE)
#include "octwareec.h"
(Cntl-x, y, ENTER)

cd /usr/src/zaptel
make clean; make; make install
modprobe zaptel

cd /usr/src/octvqe8-01.0x.00-pr
wget
ftp://ftp.octware.net/pub/register/32-bits/latest/register32
chmod 500 register32
chown root.root register32

If using a sangoma A200 with included softecho licenses run "wanrouter start"

./register32

Follow activation instructions

cd /usr/src/zaptel/kernel/octvqe
cp octvqed /usr/sbin/
cp octvqed.init /etc/rc.d/init.d/octvqed
chown root.root /etc/rc.d/init.d/octvqed
chmod 755 /etc/rc.d/init.d/octvqed
chkconfig --add octvqed
chkconfig octvqed on
cp octvqed.conf /etc

Edit octvqed.conf to configure the echo canceller.

reboot and verify the echo canceller is working
cat /proc/octvqe

INSTALL 3DM2 software for 3WARE SATA RAID card

Download and untar the 3DM2 software.
cd /usr/src/
tar zxvf 3DM2-Linux-9.3.0.7.tgz

Install 3DM 2:
./install.3dm install

Select Option 0 for web GUI
All defaults except do NOT limit connections to localhost 127.0.0.1

cd /tmp/3ware
Copy file 3dm2.redhat to /etc/rc.d/init.d/3dm2
cp 3dm2.redhat /etc/rc.d/init.d/3dm2

Type:
chkconfig --add 3dm2

Type:
chkconfig --add --level 345 3dm2

Change the operating mode by typing:
chmod +x /etc/rc.d/init.d/3dm2

Change the permissions on the 3dm2 configuration file:
chmod 600 /etc/3dm2/3dm2.conf

Start the 3DM 2 daemon by typing:
/etc/rc.d/init.d/3dm2 start

Open the web browser and go to https://localhost:888
Default user and administrator password is: 3ware

Disable write cache on the controller once all the software is installed.  This improves reliability in the event there is a power interruption while data is being written to the hard drive.
eth0 was made active on boot and eth1 was made inactive.  Other than that they are configured identically, IP address and all.  To make eth0 inactive and eth1 active do the following:

nano /etc/sysconfig/network-scripts/ifcfg-eth0
change the “active=enable” to “active=disable”

nano /etc/sysconfig/network-scripts/ifcfg-eth1
change the “active=disable” to “active=enable”              

reboot or startup by typing the following commands:
eth0 down
eth1 up

Appendix A: Time settings on Aastra phones

Time settings on the phones should be configured in the aastra.cfg file.  NOTE: System time must be set to UTC otherwise the phones will not recognize it.

time server disabled: 0 # Time server enabled.
time format: 0
date format: 0
time zone name: CA-Eastern
time zone code: EST
time zone minutes: 0
dst start month: 04
dst start day: 02
dst start hour: 02
dst end month: 10
dst end day: 29
dst end hour: 02

 

Appendix B: Webmin Install

cd /usr/src
wget
http://superb-west.dl.sourceforge.net/sourceforge/webadmin/webmin-1.300-1.noarch.rpm
rpm -Uvh webmin-1.300-1.noarch.rpm
nano /etc/webmin/miniserv.conf

port=9000

(Ctrl-X>y>ENTER)

service webmin start

to access http://192.168.1.20:9000
user:root
pw:rootpassword

Appendix C: Aastra Phones as external extensions

This assumes the Asterisk server is configured for external extensions and the extension configuration in asterisk is configured to be used as an external extension.  Both are described earlier in this guide(sip_nat.conf, nat=yes).

Reset the phone to factory defaults.  All you need to configure in the phone are phone number, callerID, authentication name, password, Proxy IP and Registrar IP.  Leave everything else at default and it should work.  I also changed registration retry timer and BLF subscription period to 120s.

Appendix D: Special note about Cisco PIX firewall

In order to make Aastra phones work outside a Cisco PIX firewall to the Asterisk server inside the firewall, we needed to remove fixup protocol sip 5060, and fixup protocol sip udp 5060 which are both enabled by default.

no fixup protocol sip 5060
no fixup protocol sip udp 5060

Appendix E: Special note about extensions over VPN

In order to make extensions work over VPN’s we had to add the VPN subnets to sip_nat.conf to make the phones on the 192.168.2.0 and 192.168.3.0 subnets work with the Asterisk Server on the 192.168.1.0 subnet.  Here is the whole sip_nat.conf file

nat=yes
externip=xxx.xxx.xxx.xxx
localnet=192.168.1.0/255.255.255.0
localnet=192.168.2.0/255.255.255.0 # VPN1 to 192.168.1.0
localnet=192.168.3.0/255.255.255.0 # VPN2 to 192.168.1.0
externrefresh=10

Appendix F: aastra.cfg and <MAC>.cfg files

# aastra.cfg
auto resync mode: 3
auto resync time: 01:30
dhcp: 1 # DHCP enabled.
time server disabled: 0 # time server is enabled
time server1: 192.168.1.20
time format: 0
date format: 0
time zone name: CA-Eastern
time zone code: EST
time zone minutes: 0
dst start month: 04
dst start day: 02
dst start hour: 02
dst end month: 10
dst end day: 29
dst end hour: 02

tftp server: 192.168.1.20

sip digit timeout: 3 # set the inter-digit timeout in seconds

# sip dial plan: "x+#|xx+*" # this is the default dial string, note
# that it must be quoted since it contains
# a '#' character

sip dial plan: "x+#|xx+*|[2-9]XX[2-9]XXXXXX|1[2-9]XX[2-9]XXXXXX|1XXXXXXXXXX"

#
#sip dial plan terminator: 1 # enable sending of the "#" symbol to
# to the proxy in the dial string
#-----------------------------------------------------------------

sip user name: 12345 # the phone number if the mac.cfg is not properly configured
sip vmail: *98 # the number to reach voicemail on
sip auth name: MACfile # account used to authenticate user
sip password: 12345 # password for authentication account
sip mode: 0 # line type:
# 0 - generic,
# 1 - BroadSoft SCA line
# 2 - Nortel line
sip proxy ip: 192.168.1.20 # IP address or FQDN of proxy
sip proxy port: 0 # port used for SIP messages on the
# proxy. Set to 0 to enable SRV
# lookups
sip registrar ip: 192.168.1.20 # IP address or FQDN of registrar
sip registrar port: 0 # as proxy port, but for the registrar
sip registration period: 120 # registration period in seconds
sip registration retry timer: 120
sip blf subscription period: 120
# Per-line SIP Settings
# =======================

 
# <MAC>.cfg
sip screen name: Cindy # the name display on the phone's screen
sip user name: 647 #the phone number
sip display name: Cindy # the caller name sent out when making a call.
sip auth name: 647 # account used to authenticate usesip password: xxx # password for authentication account
# Speed Dials

prgkey1 type: blf
prgkey1 value: 641
prgkey2 type: blf
prgkey2 value: 642
prgkey3 type: blf
prgkey3 value: 643
prgkey4 type: blf
prgkey4 value: 644
prgkey5 type: blf
prgkey5 value: 645
prgkey6 type: blf
prgkey6 value: 646
prgkey7 type: blf
prgkey7 value: 650

Appendix G: Polycom Generic Sample Files

Polycom Generic Sample Files

Place the files in the included zip file into /tftpboot directory.  Change the name of the phoneEXT.cfg file and update it in MAC.cfg.  Change the MAC.cfg file to the MAC address of the phone (in lower case).  Update the phoneEXT file with the EXT information.
Polycom_config_files.zip