FreePBX Production Install Guide (CentOS v4.x, Asterisk v1.2.x, FreePBX v2.x.x)

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 3WARE 8006-2LP 2 port PCI SATA Hardware RAID
Qty 1 Samgoma Remora A200D PCI Card 0 FXS / 8 FXO Ports + Echo Cancellation Low Profile
Qty 7 Aastra 9133i SIP business phone
Qty 1 Aastra 480iCT SIP executive phone with cordless handset

 

 

Conventions

Comments are Arial Italic
Linux command line entries are in courier

CentOS Installation

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
Make eth0 and eth1 identical except eth0 is active on boot and eth1 is NOT!
Ensure that all package groups and modules are DE-selected for install 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 install gcc gcc-c++ libxml2-devel libtiff-devel mysql-server php-gd php-mysql kernel-devel bison ncurses-devel audiofile-devel subversion libogg-devel openssl-devel tftp-server php-mbstring php-pear libtermcap-devel nano ntp wget

Disable Firewall and SELinux, this may need to be done before yum update/install if the firewall is blocking it.

service iptables save
service ip6tables save
service iptables stop
service ip6tables stop
chkconfig iptables off
chkconfig ip6tables off

 nano /etc/selinux/config

Change "SELINUX=enforcing" to "SELINUX=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.3.x.tar.gz
tar zxvf freepbx-2.3.x.tar.gz

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

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

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

mkdir /usr/src/sounds
cd /usr/src/sounds
wget
http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-core-sounds-en-ulaw-1.2.x.tar.gz
tar zxvf asterisk-core-sounds-en-ulaw-1.2.x.tar.gz

wget http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-extra-sounds-en-ulaw-1.2.x.tar.gz
tar zxvf asterisk-extra-sounds-en-ulaw-1.2.x.tar.gz

Compile/install Zaptel and Asterisk

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

cd /usr/src/asterisk-1.2.x
make clean
./configure; make menuselect
At menu press "x"

make; make install
mkdir /var/run/asterisk
mkdir /var/lib/asterisk/sounds
mkdir /var/lib/asterisk/sounds/custom
cp -rv /usr/src/sounds/* /var/lib/asterisk/sounds

edit zaptel.conf for “fxsks=1-8” for 8 fxo channels (fxs channels for fxo ports and visa versa)
nano /etc/zaptel.conf

loadzone = us
defaultzone = us
fxsks = 1-8

(Ctrl-X>y>ENTER)

Those are the ONLY lines required in zaptel.conf.  Everything else should be commented out (“;”) or deleted.
Create a zapata.conf file in /etc/asterisk with the following for 8 fxo ports

nano /etc/asterisk/zapata.conf

;# Flash Operator Panel will parse this file for zap trunk buttons
;# AMPLABEL will be used for the display labels on the buttons
;# %c Zap Channel number
;# %n Line number
;# %N Line number, but restart counter
;# Example:
;# ;AMPLABEL:Channel %c - Button %n
;# For Zap/* buttons use the following
;# (where x=number of buttons to dislpay)
;# ;AMPWILDCARDLABEL(x):MyLabel

[channels]
language=en
;include zap extensions defined in AMP
#include zapata_additional.conf
AMPLABEL:Channel %c - Button %n
context = from-pstn
switchtype = national
usecallerid = yes
callerid=asreceived
echocancel = yes
echocancelwhenbridged = yes
        

;add the is option if you are problems with DTMF detection
relaxdtmf = yes 

rxgain = 12.0
txgain = -3.0

;The following is for fxo ports only
signalling = fxs_ks
group = 0
channel => 1-8

(Ctrl-X>y>ENTER)

Those are the ONLY lines required in zapata.conf.  Everything else should be commented out (“;”) or deleted.
If you have, for example, 2 FXS ports and 2 FXO ports then change "context=from-pstn" to "context=default" and add the following to zapata.conf after the gain.

context=from-zaptel
group=0
signalling = fxs_ks
channel => 1-2

context=from-internal
group=1
signalling = fxo_ks
channel => 3-4
callerid=asreceived

/usr/sbin/wancfg zaptel

If autoconfig does not work just go through menus

Create new wanpipe1.conf file
Detect card
Enable TDM Voice, Hardware Echo, SPAN 1
Save

Sangoma Wanpipe Installation

cd /usr/src

#Create a virtual link to zaptel directory for Sangoma
ln -s zaptel-1.2.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

HOTPLUG can conflict with startup of TDMV drivers.
 
 Solution:
 Insert wanpipe interface name into the hotplug interface list, and restart hotplug. 
 
   nano +45 /etc/hotplug/net.agent
 
Insert wanpipe interface name into the ignore list:
Look for:  
        add|register)
        case $INTERFACE in
            (dsl*|ppp*|....................|tun*|tap*|wifi*)

And add w* to the list
            (dsl*|ppp*|....................|tun*|tap*|wifi*|w*)

         Where w* relates to all wanpipe interfaces starting with letter "w".
(Ctrl-X>y>ENTER)
There is also a list of interfaces to be ignored when unregistering, and the w* interfaces must be added to this list also.

 
nano +99 /etc/hotplug/net.agent
Look for:   
    remove|unregister)
        case $INTERFACE in
             (dsl*|ppp*|....................|tun*|tap*|wifi*)

and add w*
(Ctrl-X>y>ENTER)

 
restart hotplug agent to apply changes: 
 /sbin/hotplug restart
run
 
/usr/sbin/wancfg zaptel
If autoconfig does not work just go through menus
 
Create new wanpipe1.conf file
Detect card
Enable TDM Voice, Hardware Echo, SPAN 1
 
Save

Install/compile new driver as per above fresh install procedure.  Zaptel drivers have already been compiled for you by Sangoma Wanpipe so you can skip the next section.

Create uses 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

You also want to change AllowOverride None to AllowOverride All
sed -i “s/AllowOverride None/AllowOverride All/” /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.2.x
cp Makefile Makefile.orig
sed -i 's/SOURCE/SOURCE -DMYSQL_LOGUNIQUEID/' Makefile

./configure; make menuselect

At menu press "x"

make clean; 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

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 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.

nano /etc/php.ini
change the “max filesize” from 2M to 20M to allow larger mp3 music on hold 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.

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

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

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
cd /usr/src/zaptel/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 octwareec1x.h /usr/src/zaptel
cd /usr/src/zaptel

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 "octwareec1x.h" /* replace the 'x' with the version number */
(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/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

REBOOT Script for Aastra phones

nano /etc/asterisk/sip_notify.conf
[aastra-check-cfg]
Event=>check-sync
Content-Length=>0

(Ctrl-X>y>ENTER)

Then from the asterisk console you can type "sip notify aastra-check-cfg 123", where 123 is the sip phone
Copy Aastra phone config files into /tftpboot directory.  There are 2.  One is aastra.cfg and one is “MACADDRESSOFPHONE”.cfg

For remote 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)

REBOOT Script for Aastra phones

nano /etc/asterisk/sip_notify.conf
[aastra-check-cfg]
Event=>check-sync
Content-Length=>0

(Ctrl-X>y>ENTER)

Then from the asterisk console you can type "sip notify aastra-check-cfg 123", where 123 is the sip phone 

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

Appendix B: 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