ipt_cc
- cat ippbx-instalation-script-V5.2
- #!/bin/sh
- echo “Tested on Ubuntu 14.04 LTS and asterisk 11.22.0 by rubel@office.bdcom.com”
- sleep 10
- ################################
- # GLOVAL VARIABLE DECLARATION #
- ################################
- ASTVERSION=“asterisk-11.22.0.tar.gz”
- ASTERISK=“http://119.40.81.15/IPTSP/rep0/Telephony_Engine/$ASTVERSION”
- ASTFOLDER=“asterisk-11.22.0”
- IPPBXVERSION=“V5.2”
- IPPBX=“http://119.40.81.15/IPTSP/rep0/IPPBX-$IPPBXVERSION.tar.gz”
- ######################################
- #IP-PBX installation pre-requsite app#
- ######################################
- echo “Updating and Upgrading Ubuntu”
- sleep 5
- apt update
- apt -y upgrade
- echo “Updating and Upgrading Ubuntu Complete”
- sleep 5
- echo “Installing Ubuntu Build-in-Package / pre-requisite package for Asterisk Installation”
- sleep 5
- apt -y install vim
- apt -y install acl
- apt install htop
- apt -y install linux-headers- `uname -r`
- apt -y install build-essential
- apt -y install libssl-dev
- apt -y install ncurses-dev
- apt -y install libnewt-dev
- apt -y install bison
- apt -y install libxml2-dev
- apt -y install libsqlite3-dev
- apt -y install sqlite3
- apt -y install wget
- apt -y install subversion
- apt -y install aptitude
- apt -y install sysv-rc-conf
- apt -y install iptraf
- apt -y install tcptrack
- apt -y install ethtool
- apt -y install sox
- echo “IPTABLES/NTP server INSTALL”
- sleep 5
- apt -y install iptables
- apt -y install ntp
- apt -y install zip
- echo “Database Installation ”
- sleep 5
- echo “mysql-server mysql-server/root_password password 0pen!@#$” | debconf-set-selections
- echo “mysql-server mysql-server/root_password_again password 0pen!@#$” | debconf-set-selections
- apt -y install mysql-server
- apt -y install libmysqlclient-dev
- apt -y install apache2
- apt -y install php5
- apt -y install php5-mysql
- echo “PHPMYADMIN Instalation”
- sleep 5
- echo “phpmyadmin phpmyadmin/reconfigure-webserver multiselect apache2” | debconf-set-selections
- echo “phpmyadmin phpmyadmin/dbconfig-install boolean true” | debconf-set-selections
- echo “phpmyadmin phpmyadmin/mysql/admin-user string root” | debconf-set-selections
- echo “phpmyadmin phpmyadmin/mysql/admin-pass password 0pen!@#$” | debconf-set-selections
- echo “phpmyadmin phpmyadmin/mysql/app-pass password 0pen!@#$” |debconf-set-selections
- echo “phpmyadmin phpmyadmin/app-password-confirm password 0pen!@#$” | debconf-set-selections
- apt -y install phpmyadmin
- echo “Phpmyadmin instalation complete”
- sleep 10
- echo “Enabling Apache Rewrite permission”
- sleep 5
- a2enmod rewrite
- echo “ODBC CONNECTION”
- sleep 5
- apt install odbcinst
- apt -y install unixODBC-dev
- apt -y install libmyodbc
- apt -y install unixODBC
- apt -y install lame
- ############################
- #Prerequsit INSTALATION End#
- ############################
- #######################
- #Asterisk Installation#
- #######################
- echo “Downloading Asterisk Core Engine Version Certified Asterisk 11.22.0”
- sleep 5
- cd /usr/src
- wget $ASTERISK
- tar -zxvf $ASTVERSION
- echo “Asterisk Prerequisite Installation”
- sleep 5
- cd /usr/src/asterisk-11.22.0/contrib/scripts/
- ./install_prereq install
- echo “Configuring & Installing asterisk-11.22.0 Certified Asterisk”
- sleep 5
- cd /usr/src/asterisk-11.22.0
- ./configure
- make menuselect.makeopts
- menuselect/menuselect –enable res_config_mysql –enable app_mysql –enable cdr_mysql –enable app_saycountpl –enable app_setcallerid –enable agi-test.agi –enable eagi-test –enable eagi-sphinx-test –enable jukebox.agi –enable CORE-SOUNDS-EN-ULAW –enable CORE-SOUNDS-EN-ALAW menuselect.makeopts
- make
- make install
- make samples
- make config
- echo “Asterisk Installation Complete of asterisk-11.22.0 Certified Asterisk”
- sleep 5
- echo “Creating Directory and setting RW permission for directories”
- sleep 5
- mkdir /home/raw-files
- mkdir /bdcom
- chmod 777 -R /bdcom
- chmod 777 /etc/asterisk
- echo “Moving Raw Asterisk Files for Backup”
- sleep 5
- mv -vf /etc/asterisk/* /home/raw-files/
- echo “Downloading Core Configuration Files”
- sleep 5
- chmod 777 -R /usr/src
- cd /usr/src
- wget $IPPBX
- tar -zxvf IPPBX-$IPPBXVERSION.tar.gz
- echo “Copying Core Asterisk Files to etc-asterisk”
- sleep 5
- cd /usr/src/IPPBX-$IPPBXVERSION/
- cp -rfv /usr/src/IPPBX-$IPPBXVERSION/asterisk/* /etc/asterisk/
- echo “Copying Users Files to -bdcom”
- sleep 5
- cp -rfv /usr/src/IPPBX-$IPPBXVERSION/bdcom/* /bdcom/
- echo “Copying AGI files to var-lib-asterisk-agi-bin”
- sleep 5
- cp -fv /usr/src/IPPBX-$IPPBXVERSION/agi-bin/* /var/lib/asterisk/agi-bin/
- chmod 755 -R /var/lib/asterisk/agi-bin/
- echo “Copying DATABASE Files”
- sleep 5
- chmod 777 -R /var/www/html/
- mv /var/www/html/index.html /var/www/html/index.html.back
- cp -rvf /usr/src/IPPBX-$IPPBXVERSION/www/* /var/www/
- cp -vf /usr/src/IPPBX-$IPPBXVERSION/www/html/.htaccess /var/www/html/
- chmod 755 -R /var/www/
- chown -R system:www-data /var/www/
- #echo “newly added for Apache”
- #mv -f /etc/apache2/sites-available/default /etc/apache2/sites-available/default.backup
- #cp /usr/src/kotha-new-version-4.0/default /etc/apache2/sites-available/
- #echo “Creating backup odbc file ”
- #sleep 5
- #mv -f /etc/odbc.ini /etc/odbc.ini.back
- #mv -f /etc/odbcinst.ini /etc/odbcinst.ini.back
- echo “Crontab Configaration”
- sleep 5
- mv -f /etc/crontab /etc/crontab.back
- cp -f /usr/src/IPPBX-$IPPBXVERSION/crontab /etc/
- sleep 5
- chmod 644 /etc/crontab
- #echo “Copying odbc files”
- #sleep 5
- #cp -f /usr/src/IPPBX-$IPPBXVERSION/odbc.ini /etc/odbc.ini
- #cp -f /usr/src/IPPBX-$IPPBXVERSION/odbcinst.ini /etc/odbcinst.ini
- #echo “Configuring Asterisk run Time”
- #sleep 5
- #cp -f /usr/src/IPPBX-V5.0/asterisk /etc/init.d/asterisk
- #chmod 777 /etc/init.d/asterisk
- #cd /etc/init.d
- #update-rc.d asterisk defaults
- echo “Creating Soft Links”
- sleep 5
- cd /var/lib/asterisk/sounds/en/
- chmod 777 -R /var/lib/asterisk/sounds/en/
- #ln -s /var/www/sounds/ sounds
- ln -s /var/www/html/assets/uploads/sounds/ sounds
- mkdir /data/recordings
- chmod 755 -R /data/recordings
- ln -s /data/recordings /var/www/html/recordings
- chmod 777 -R /var/www/html/assets/uploads/
- cd /var/www/html/assets/uploads
- chmod -R 777 ivr ivr_item
- cd /var/lib/asterisk/sounds/en
- #ln -s /var/www/html/assets/uploads/sounds/ivr ivr
- #ln -s /var/www/html/assets/uploads/sounds/ivr_item/ ivr_item
- ln -s /bdcom/music music
- echo “Creating Database”
- sleep 5
- mysql -u root -p'0pen!@#$' -e “CREATE DATABASE asterisk”
- mysql -u root -p'0pen!@#$' asterisk </usr/src/IPPBX-$IPPBXVERSION/asterisk-database-V5.2.sql
- echo “Starting All communications Services”
- sleep 5
- service asterisk restart
- service apache2 restart
- service cron restart
- echo “KOTHA V 5.2 IP-PBX INSTALATION IS NOW COMPLETE, For any issue contact rubel@office.bdcom.com”
- sleep 10
- exit 0
ipt_cc.txt · Last modified: 2023/03/06 11:31 by 127.0.0.1