Установка чистого контейнера описана не будет 

Итак начнем.

Что мы имеем

root@DebianFreePBX:/etc# uname -a
Linux DebianFreePBX 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt25-2 (2016-04-08) x86_64 GNU/Linux
root@DebianFreePBX:/etc# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 8.5 (jessie)
Release:        8.5
Codename:       jessie
root@DebianFreePBX:/etc#

Обновим систему

apt-get update && apt-get upgrade -y 

Установим зависимости процесс не быстрый

apt-get install -y build-essential linux-headers-`uname -r` openssh-server apache2 mysql-server mysql-client bison flex php5 php5-curl php5-cli php5-mysql php-pear php-db php5-gd phpmyadmin curl sox libncurses5-dev libssl-dev libmysqlclient-dev mpg123 libxml2-dev libnewt-dev sqlite3 libsqlite3-dev pkg-config automake libtool autoconf git subversion unixodbc-dev uuid uuid-dev libasound2-dev libogg-dev libvorbis-dev libcurl4-openssl-dev libical-dev libneon27-dev libsrtp0-dev libspandsp-dev libiksemel-dev libiksemel-utils libiksemel3 wget sudo cron lsb-release

В процессе установка нас попросят установить пароль от mysql-server-5.5 и подтвердить его, не оставляйте пустым

undefined

Пришло время перезагрузить наш сервер

reboot

Во второй консоли пока можно скачать все что нам нужно

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-13-current.tar.gz
wget -O jansson.tar.gz https://github.com/akheron/jansson/archive/v2.7.tar.gz
wget http://www.pjsip.org/release/2.4/pjproject-2.4.tar.bz2

Сборка и установка DAHDI

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

 Сборка и установка LIBPRI

cd /usr/src/
tar xvfz libpri-current.tar.gz
cd libpri-*
make
make install

 Сборка и установка pjproject

cd /usr/src/
tar -xjvf pjproject-2.4.tar.bz2 cd pjproject-2.4 CFLAGS='-DPJ_HAS_IPV6=1' ./configure --enable-shared --disable-sound --disable-resample --disable-video --disable-opencore-amr make dep make make install

 Сборка и установка jansson

cd /usr/src/
tar xvfz jansson.tar.gz
cd jansson-*
autoreconf -i
./configure
make
make install

 Сборка и установка Asterisk

cd /usr/src
tar xvfz asterisk-13-current.tar.gz
cd asterisk-13*
contrib/scripts/get_mp3_source.sh
contrib/scripts/install_prereq install

 Нас попросят задать код региона для России это 7undefined

 по окончании должны увидеть 

#############################################
## install completed successfully
#############################################

 Продолжаем сборку 

./configure
make menuselect

 Выбираем 

undefined

 

make
make install
make config
ldconfig

Скачиваем звуки

cd /var/lib/asterisk/sounds
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-core-sounds-en-wav-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-extra-sounds-en-wav-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-core-sounds-en-g722-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-extra-sounds-en-g722-current.tar.gz
tar xvf asterisk-core-sounds-en-wav-current.tar.gz
tar xfz asterisk-extra-sounds-en-wav-current.tar.gz
tar xfz asterisk-extra-sounds-en-g722-current.tar.gz
tar xfz asterisk-core-sounds-en-g722-current.tar.gz

Подготовка к установке FreePBX 13

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

Настраиваем Apache

sed -i 's/\(^upload_max_filesize = \).*/\120M/' /etc/php5/apache2/php.ini
cp /etc/apache2/apache2.conf /etc/apache2/apache2.conf_orig
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

Установка FreePBX 13

cd /usr/src
wget http://mirror.freepbx.org/modules/packages/freepbx/freepbx-13.0-latest.tgz
tar vxfz freepbx-13.0-latest.tgz
cd freepbx

 Правим /etc/default/asterisk точнее уберем комментарий строчки в самом верху

AST_USER="asterisk"
AST_GROUP="asterisk"

# Startup configuration for the Asterisk daemon

# Uncomment the following and set them to the user/groups that you
# want to run Asterisk as. NOTE: this requires substantial work to
# be sure that Asterisk's environment has permission to write the
# files required  for  its  operation, including logs, its comm
# socket, the asterisk database, etc.
AST_USER="asterisk"
AST_GROUP="asterisk"

 Перезапускаем asterisk 

service asterisk status
● asterisk.service - LSB: Asterisk PBX
Loaded: loaded (/etc/init.d/asterisk)
Active: active (running) since Вт 2016-07-19 11:50:55 YEKT; 1min 31s ago
Process: 31370 ExecStop=/etc/init.d/asterisk stop (code=exited, status=0/SUCCESS)
Process: 31376 ExecStart=/etc/init.d/asterisk start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/lwp.service/system.slice/asterisk.service
└─31389 /usr/sbin/asterisk -U asterisk -G asterisk

июл 19 11:50:55 DebianFreePBX asterisk[31370]: Stopping Asterisk PBX: asterisk.
июл 19 11:50:55 DebianFreePBX systemd[1]: Starting LSB: Asterisk PBX...
июл 19 11:50:55 DebianFreePBX asterisk[31376]: Starting Asterisk PBX: asterisk.
июл 19 11:50:55 DebianFreePBX systemd[1]: Started LSB: Asterisk PBX.

Если видим нечто похожие то продолжаем

./install