Your ads will be inserted here by
Easy Plugin for AdSense.
Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.
This script might need some tweaking as per your environment. This script help’s you install Asterisk and freepbx on centos/redhat boxes with necessary dependency.
Bottom of the page will be updated which shall give you potential problem and solution.
#!/bin/bash
# Get ready
function getReady() {
yum -y update
yum groupinstall core
yum groupinstall base
yum install gcc gcc-c++ 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
pear install db
}
# Download Files
# You may want to check and replace download source with latest version.
function downloadRequired() {
cd /usr/local/src/
wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/libpri/libpri-1.4-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-11-current.tar.gz
wget https://iksemel.googlecode.com/files/iksemel-1.4.tar.gz
}
# Install iksemel
function compileIksemel() {
cd /usr/local/src/
tar xf iksemel-1.4.tar.gz
cd /usr/local/src/iksemel-1.4/
./configure && make && make install
}
# Install LIBPRI
function compileLibpri() {
cd /usr/local/src/
tar xf libpri-1.4-current.tar.gz
cd /usr/local/src/libpri-1.4.14/
./configure && contrib/scripts/get_mp3_source.sh
make menuselect && make && make install && make config
}
Your ads will be inserted here by
Easy Plugin for AdSense.
Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.
# Compile and install Asterisk
function compileAsterisk() {
cd /usr/local/src/
tar xvfz asterisk-11-current.tar.gz
cd /usr/local/src/asterisk-11.1.0
./configure
contrib/scripts/get_mp3_source.sh
make menuselect
#### You Will have to select mysql_cdr options on the very first make menuselect screen, Select all 5 option to enable asteriskcdr function.
make
make install
make config
}
# Extra Sounds
function extraSounds() {
cd /var/lib/asterisk/sounds
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-extra-sounds-en-gsm-current.tar.gz
tar xfz asterisk-extra-sounds-en-gsm-current.tar.gz
rm -f asterisk-extra-sounds-en-gsm-current.tar.gz
}
# Download and extract FreePBX
function extractFreepbx() {
export VER_FREEPBX=2.11
cd /usr/local/src/
svn co http://www.freepbx.org/v2/svn/freepbx/branches/${VER_FREEPBX} freepbx
cd freepbx
}
function getApacheReady() {
adduser asterisk -M -c "Asterisk User"
chown asterisk. /var/run/asterisk
chown -R asterisk. /etc/asterisk
chown -R asterisk. /var/{lib,log,spool}/asterisk
chown -R asterisk. /usr/lib/asterisk
mkdir /var/www/html
chown -R asterisk. /var/www/
sed -i 's/(^upload_max_filesize = ).*/120M/' /etc/php.ini
sed -i 's/^(User|Group).*/1 asterisk/' /etc/httpd/conf/httpd.conf
service httpd restart
}
function createDb() {
export ASTERISK_DB_PW=a2c0In
mysqladmin -u root create asterisk
mysqladmin -u root create asteriskcdrdb
mysql -u root asterisk < SQL/newinstall.sql
mysql -u root asteriskcdrdb < SQL/cdr_mysql_table.sql
mysql -u root -e "GRANT ALL PRIVILEGES ON asterisk.* TO asterisk@localhost IDENTIFIED BY '${ASTERISK_DB_PW}';"
mysql -u root -e "GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asterisk@localhost IDENTIFIED BY '${ASTERISK_DB_PW}';"
mysql -u root -e "flush privileges;"
}
compileIksemel
compileLibpri
compileAsterisk
extractFreepbx
getApacheReady
createDb
##### Finalize ###################
./start_asterisk start
./install_amp
amportal a ma installall
amportal a reload
##################################