FreePBX-Installation
1. Pre-installation
In order to setup call center server first we have to confirm that our system is full filled the minimum requirements. This asterisk deployment is based on RedHat distribution aka CentOS. To full-fill the above requirement we are going to setup asterisk 11 on CentOS 6.5 (x64).
1.2 CentOS 6.5x64 installation
It is recommended to install CentOS 6.5x64 minimum version and manually install all the other package as our requirement.
At the beginning it recommended to configure the logical disk drives aka Raid.
Note that some of the server-rigs will not compatible to centos 6.5x64, most of the time it’s because the particular server’s Raid drivers might not be found in centos 6.5x64 disk. In such scenario please follow the below instruction.
First we have to download the Raid driver from relevant vendor. (If it’s HP you will find somewhat like this hpvsa-X.X.X-X.rhel6u.5x86_64.dd).
Note that if the driver has compressed with gzip(.gz) it is recommended to extract by using “tar” in a Linux platform.
Use your Fat32 formatted usb stick and copy those extracted driver (.dd) files.
Now boot your server with centos 6.5x64 and plug your USB stick during the boot time. At the installation menu, select the installation method and hit “ESC” key to receive the "boot:" prompt. In the boot prompt enter following command
and then let your system to boot (Don’t reboot the system).
And during the installation you will be prompted a window to select the Raid driver and select the relevant driver. On successful driver installation you will be able to see your Logical (Raid driver).
And install the centos 6.5x64 without customize any package.
Note that it is recommended to customize your Logical disk in order to accommodate root user to enough space.
2 Asterisks Installation
2.2 Disable SELinux
First You have to disable SELinux
Afterwards to affect the system changes restart the PC.
Now check selinux stats by using
Or you can confirm it on “/etc/sysconfig/selinux” file
2.3 Network Configuration
# vim /etc/sysconfig/network-scripts/ifcfg-<netowrk card>`Note that network card name can be found using# ifconfig
This an example network scripts for network card called “eth0” assign with the IP address “192.168.1.250”.
Make sure that your changes only limited to following parameters,
ONBOOT BOOTPROTO
IPADDR
NETMASK
GATEWAY
DNS1
DNS2
You are always welcome to use `[root@localhost ~]# setup` in order to perform following configurations.
2.4 Update the System
Then you have to update your system.
Make sure that internet connectivity of the server is alive.
Now using yum application manger lets update the server,
These Updating processes will take a while.
# yum groupinstall core
# yum groupinstall base
# yum install gcc gcc-c++ lynx bison mysql-devel mysql-server php php-mysql php-pear php-mbstring tftp-server httpd make ncurses-devel libtermcap-devel sendmail sendmail-cf caching-nameserver sox newt-devel libxml2-devel libtiff-devel audiofile-devel gtk2-devel subversion kernel-devel git subversion kernel-devel php-process crontabs cronie cronie-anacron wget vim php-xml uuid-devel libtool sqlite-devel unixODBC mysql-connector-odbc
# init 6
# wgethttp://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gz
# wget http://downloads.asterisk.org/pub/telephony/libpri/libpri-current.tar.gz
# wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-11-current.tar.gz
# git clone https://github.com/akheron/jansson.git
# wget http://www.pjsip.org/release/2.2.1/pjproject-2.2.1.tar.bz2
# tar xvfz dahdi-linux-complete-current.tar.gz
# tar xvfz libpri-current.tar.gz
# rm -f dahdi-linux-complete-current.tar.gz libpri-current.tar.gz
# cd dahdi-linux-complete-…… Folder……
# make all
# make install
# make config
# cd /usr/src/libpri-……Folder……
# make
# make install
# cd /usr/src`
# tar -xjvf pjproject-2.2.1.tar.bz2`
# cd pjproject-2.2.1`
# CFLAGS='-DPJ_HAS_IPV6=1' ./configure --prefix=/usr --enable-shared --disable-sound\ --disable-resample --disable-video --disable-opencore-amr --libdir=/usr/lib64`
# make dep`
# make`
# make install`
# cd /usr/src/jansson
# autoreconf -i
#./configure --libdir=/usr/lib64
# make
# make install
# tar xvfz asterisk-13-current.tar.gz
# rm -f asterisk-13-current.tar.gz
# cd asterisk-.....Folder....
# contrib/scripts/install_prereq install
#./configure --libdir=/usr/lib64
# contrib/scripts/get_mp3_source.sh
#make menuselect
# make
# make install
# make config
# ldconfig
# mkdir -p /var/lib/asterisk/sounds
# cd /var/lib/asterisk/sounds
# wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-extra-sounds-en-wav-current.tar.gz
# tar xfz asterisk-extra-sounds-en-wav-current.tar.gz
# rm -f asterisk-extra-sounds-en-wav-current.tar.gz
# wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-extra-sounds-en-g722-current.tar.gz
# tar xfz asterisk-extra-sounds-en-g722-current.tar.gz
# rm -f asterisk-extra-sounds-en-g722-current.tar.gz
# yum groupinstall base
2.5 Install essential dependencies
In order to deploy the system, we have to install some additional packages aka dependencies.
2.6 Disabling Default IP tables
Then you have to disable default IP tables and you may enable them again after the installation.
chkconfig --level 0123456 iptables off`
2.7 Configurations on MySQL and Apache
It is required MySQL and Apache servers to perform Both asterisk and FreePBX operations and it’s recommended if MySQL and Apache services start at the server boot time.
chkconfig --level 345 mysqld on
chkconfig --level 345 Apache on
Let’s bring up the Both Apache and MySQL server
service mysqld start
service httpd start
2.8 PearDB Installation
PearDB is a database abstraction library which allows to connect to different kinds of databases such as PostgreSQL, MySQL using a consistent API.
# pear channel-update pear.php.net
# pear channel-update pear.php.net
You may found some warnings saying “WARNING: "pear/DB" is deprecated in favor of "pear/MDB2"”, You can just ignore them.
It is preferred to reboot the system before continue further.
2.9 Setup the Asterisk user
Then it is required add user to the system with relevant permission to perform asterisk activities.
# adduser asterisk -M -c "Asterisk User"
2.10 Download Asterisk Source Files
Use following links to download asterisk sources files.
# cd /usr/srcNote that it is preferred to download the following files to “/usr/src/”.
# wgethttp://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gz
# wget http://downloads.asterisk.org/pub/telephony/libpri/libpri-current.tar.gz
# wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-11-current.tar.gz
# git clone https://github.com/akheron/jansson.git
# wget http://www.pjsip.org/release/2.2.1/pjproject-2.2.1.tar.bz2
2.11 LibPRI and DAHDI
# cd /usr/src# tar xvfz dahdi-linux-complete-current.tar.gz
# tar xvfz libpri-current.tar.gz
# rm -f dahdi-linux-complete-current.tar.gz libpri-current.tar.gz
# cd dahdi-linux-complete-…… Folder……
# make all
# make install
# make config
# cd /usr/src/libpri-……Folder……
# make
# make install
These modules are recommended to install even those modules required only if you are using physical devices.
2.12 Pjproject Setup
pjproject is a collection of utilities, libraries for building and testing SIP based applications.
# tar -xjvf pjproject-2.2.1.tar.bz2`
# cd pjproject-2.2.1`
# CFLAGS='-DPJ_HAS_IPV6=1' ./configure --prefix=/usr --enable-shared --disable-sound\ --disable-resample --disable-video --disable-opencore-amr --libdir=/usr/lib64`
# make dep`
# make`
# make install`
2.13 Jansson Setup
Jansson is a C library for encoding, decoding and manipulating JSON (JavaScript Object Notation is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. It is based on a subset of the JavaScript Programming) data.
# autoreconf -i
#./configure --libdir=/usr/lib64
# make
# make install
2.14 Asterisk Setup
# cd /usr/src# tar xvfz asterisk-13-current.tar.gz
# rm -f asterisk-13-current.tar.gz
# cd asterisk-.....Folder....
# contrib/scripts/install_prereq install
#./configure --libdir=/usr/lib64
# contrib/scripts/get_mp3_source.sh
#make menuselect
Now you must be prompted with “Asterisk Module and Build Option Selection”.
Add mp3 format support if you’re required too compatible mp3 formats on your asterisk server and then press “Save & Exit”.
Finally let’s complete the asterisk installation process.
# make install
# make config
# ldconfig
You may need to install Asterisk-Extra-Sound
# cd /var/lib/asterisk/sounds
# wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-extra-sounds-en-wav-current.tar.gz
# tar xfz asterisk-extra-sounds-en-wav-current.tar.gz
# rm -f asterisk-extra-sounds-en-wav-current.tar.gz
# wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-extra-sounds-en-g722-current.tar.gz
# tar xfz asterisk-extra-sounds-en-g722-current.tar.gz
# rm -f asterisk-extra-sounds-en-g722-current.tar.gz
3 FreePBX Installation
Note that asterisk is our actual PBX aka core switch, while FreePDB can defined as a web-based GUI and configuration file writer which will write asterisk dial planes and configuration for you.
3.1 Download FreePBX Source Files
# cd /usr/src
# wget http://mirror.freepbx.org/modules/packages/freepbx/freepbx-12.0-latest.tgz
#tar vxfz freepbx-12-latest.tgz
#chown -R asterisk. /etc/asterisk
#chown -R asterisk. /var/{lib,log,spool}/asterisk
#chown -R asterisk. /usr/lib/asterisk
#chown -R asterisk. /usr/lib64/asterisk
#mkdir /var/www/html
#chown -R asterisk. /var/www/
#sed -i 's/\(^upload_max_filesize = \).*/\120M/' /etc/php.ini
#cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf_orig
#1 asterisk/' /etc/httpd/conf/httpd.conf
#service httpd restart
#cd /usr/src/freepbx
#export ASTERISK_DB_PW=amp109
#mysqladmin -u root create asterisk
#mysqladmin -u root create asteriskcdrdb
#mysql -u root -e "GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY '${ASTERISK_DB_PW}';"
#mysql -u root -e "flush privileges;"
#./start_asterisk start
#./install_amp --installdb --username=asteriskuser --password=${ASTERISK_DB_PW}
#amportal chown
#amportal a ma installall
#amportal a reload
#amportal a ma refreshsignatures
#amportal chown
#ln -s /var/lib/asterisk/moh /var/lib/asterisk/mohmp3
#amportal restart
3.2 Setup Relevant permission on Asterisk
It is required to setup couple of ownership permissions as follows.
#chown asterisk. /var/run/asterisk#chown -R asterisk. /etc/asterisk
#chown -R asterisk. /var/{lib,log,spool}/asterisk
#chown -R asterisk. /usr/lib/asterisk
#chown -R asterisk. /usr/lib64/asterisk
#mkdir /var/www/html
#chown -R asterisk. /var/www/
3.3 Configuration on Apache Server
FreePBX use Apache web server to provide web-based GUI, Following modifications are essential on Apache server.
#cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf_orig
#1 asterisk/' /etc/httpd/conf/httpd.conf
#service httpd restart
3.4 Configuration on MySQL Server
Asterisk uses MySQL database engine to perform its database activities, These Following modifications are essential on MySQL database.
#export ASTERISK_DB_PW=amp109
#mysqladmin -u root create asterisk
#mysqladmin -u root create asteriskcdrdb
Now It’s required Grant relevant permissions on asterisk database.
#mysql -u root -e "GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY '${ASTERISK_DB_PW}';"#mysql -u root -e "GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY '${ASTERISK_DB_PW}';"
#mysql -u root -e "flush privileges;"
3.5 Finalize the FreePBX installation
#cd /usr/src/freepbx#./start_asterisk start
#./install_amp --installdb --username=asteriskuser --password=${ASTERISK_DB_PW}
#amportal chown
#amportal a ma installall
#amportal a reload
#amportal a ma refreshsignatures
#amportal chown
Let’s Start the FreePBX
#amportal restart
Note that amportal is the Linux command which is use to controls FreePBX by using Linux command prompt.
Comments
Post a Comment