Ubuntu18.04 install Asterisk16.10 + FreePBX15.0

Ubuntu18.04 install Asterisk16.10 + FreePBX15.0

1. First you need to update the apt source of ubuntu

cp /etc/apt/sources.list /etc/apt/sources.list.bak
echo >/etc/apt/sources.list
vim /etc/apt/sources.list
# Then paste the following content into sources.list file
deb http://mirrors.aliyun.com/ubuntu/ xenial main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security universe

You also need to add the ppa source, because you need to install php5.6 when you install the dependencies in the second step. If you don't add it, you will be prompted to find the package when apt-get install.

apt-get install -y language-pack-en-base
LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
add-apt-repository ppa:ondrej/php

Perform update mirror list.

apt update

2. Install dependent packages###

apt-get install -y build-essential linux-headers-`uname -r` openssh-server apache2 mysql-server mysql-client bison flex php5.6 php5.6-curl php5.6-cli php5.6-xml php5.6-mysql php-pear php5.6-gd libapache2-mod-php5.6 curl sox libncurses5-dev libssl-dev libmysqlclient-dev mpg123 libxml2-dev libnewt-dev sqlite3 libsqlite3-dev pkg-config automake libtool autoconf git unixodbc-dev uuid uuid-dev libasound2-dev libogg-dev libvorbis-dev libicu-dev libcurl4-openssl-dev libical-dev libneon27-dev libsrtp0-dev libspandsp-dev sudo subversion libtool-bin python-dev

During the installation of mysql, a window prompting for setting a password will pop up several times, here we can directly press Enter, and set a blank password by default to avoid problems during subsequent installation of Asterisk
When installing php5.6, php-pear, libssl-dev, libxml2-dev, libicu-dev, libneon27-dev, the download speed will be slower

After the installation is complete, switch php to php5.6.

sudo a2dismod php7.1
sudo a2enmod php5.6
sudo service apache2 restart
sudo update-alternatives --set php /usr/bin/php5.6

3. Install nodejs

curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs

4. Install and configure Asterisk

Download source package

cd /usr/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-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-16-current.tar.gz

Compile and install dahdi

tar -zxvf dahdi-linux-complete-current.tar.gz
cd dahdi-linux-complete*
make all
make install
make config
tar -zxvf tar -zxvf libpri-current.tar.gz
cd libpri*
make
make install

Compile and install Asterisk

tar -zxvf asterisk-16-current.tar.gz 
cd asterisk*
contrib/scripts/get_mp3_source.sh
contrib/scripts/install_prereq install
# Here is a pop-up window that requires the user to fill in the country’s phone code, China is 86./configure  --with-pjproject-bundled --with-jansson-bundled
make menuselect
# A pop-up window will appear here, asking you which modules you need to enable, press enter to enable the corresponding module, the default is OK
make
make install
make config
ldconfig
update-rc.d -f asterisk remove

5. Install and configure FreePBX

Create Asterisk user and set basic file permissions

useradd -m asterisk
chown asterisk./var/run/asterisk
chown -R asterisk./etc/asterisk
chown -R asterisk./var/{lib,log,spool}/asterisk
chown -R asterisk./usr/lib/asterisk
rm -rf /var/www/html

Modify the apache2 configuration file

sed -i 's/\(^upload_max_filesize = \).*/\120M/'/etc/php/5.6/apache2/php.ini
cp /etc/apache2/apache2.conf /etc/apache2/apache2.conf.bak
sed -i 's/^\(User\|Group\).*/\1 asterisk/'/etc/apache2/apache2.conf
sed -i 's/AllowOverride None/AllowOverride All/'/etc/apache2/apache2.conf
service apache2 restart

Configure ODBC

# edit/etc/odbcinst.ini and add the following.
[ MySQL]
Description = ODBC for MySQL
Driver =/usr/lib/x86_64-linux-gnu/odbc/libmyodbc.so
Setup =/usr/lib/x86_64-linux-gnu/odbc/libodbcmyS.so
FileUsage =1

# Edit or create/etc/odbc.ini and add the following parts.
[ MySQL-asteriskcdrdb]
Description=MySQL connection to 'asteriskcdrdb' database
driver=MySQL
server=localhost
database=asteriskcdrdb
Port=3306
Socket=/var/run/mysqld/mysqld.sock
option=3

Officially compile and install FreePBX

cd /usr/src
wget http://mirror.freepbx.org/modules/packages/freepbx/freepbx-15.0-latest.tgz
tar vxfz freepbx-15.0-latest.tgz
cd freepbx
touch /etc/asterisk/ari.conf
. /start_asterisk start
. /install -n

Restart apache

a2enmod rewrite
service apache2 restart

6. Finally, enter the ip address of the freepbx server in the browser to see the background interface

Recommended Posts

Ubuntu18.04 install Asterisk16.10 + FreePBX15.0
ubuntu18.04 install python2
ubuntu18.04 install docker
ubuntu12.04 install python3
Ubuntu install guide
ubuntu install nodejs
ubuntu install leanote
ubuntu install Jenkins
docker install ubuntu
ubuntu install elasticsearch
ubuntu16.0.1 install pagoda
ubuntu18.04 install python
ubuntu 18.04 install teamviewer
ubuntu install sendmail
Install apache+PHP under Ubuntu
install vscode on ubuntu18
Install node.js under Ubuntu
Install mysql-pytho in Ubuntu
ubuntu install zsh terminal
Install Redis on Ubuntu
Install R4 on ubuntu20
Install nvtop on Ubuntu 18.04
Install postgresql-10 on Ubuntu 18.04
Install python3.6 under Ubuntu 16.04
Install docker on Ubuntu
Ubuntu18.04 install opencv 3.2.0 solution
Install mysql under Ubuntu 16.04
Install Caffe under Ubuntu 14.04
Install Docker on ubuntu18.04
Install nodejs10 on Ubuntu16
ubuntu install harbor warehouse
Ubuntu16.04 install Mongodb tutorial
Install Django on ubuntu
Install Pytorch+CUDA on Ubuntu 16.04
2018-09-11 Install arduino under Ubuntu
Install Python3 on Ubuntu 14.04
Ubuntu19 install MySQL pit
ubuntu16.04 install node.js, npm
Install rJava on Ubuntu18
Install JDK10+ on Ubuntu
pcduino ubuntu install os
Install python in Ubuntu
Install JDK in Ubuntu19.10
Install Python3 on Ubuntu 16.04
Install ROS under ROS Ubuntu 18.04[2]
Install MySQL under Ubuntu
Install KDE on Ubuntu16.04.2
ubuntu install nginx server
Install Yarm-PM2 under Ubuntu
Install Docker on Ubuntu18
Install Python3.7 on Ubuntu
Install flashplayer on Ubuntu
ubuntu: install camera driver
ubuntu14.04 install jdk1.8 tutorial
Docker practice (1): install Docker on Ubuntu 16.04
Install VMware Tools in Ubuntu 18.04
ubuntu16.04 install caffe cpu version
Install ubuntu on virtual machine
Windows 10 install Linux subsystem Ubuntu
Install OpenSSL 1.0.2 on Ubuntu Server 14.04
Install QQ robot on Ubuntu 16.04