installazione Asterisk e FreePBX su Debian Wheezy
Questo tutorial/guida spiega come installare Asterisk 13 e FreePBX 12 su una macchina Debian Wheezy
Testato su:
Debian Wheezy v7.5
Asterisk v13.4
Freepbx v2.12
Fate l'upgrade
Login come root:
apt-get update && apt-get dist-upgrade -y
Installate le dipendenze
#> apt-get install sudo
#> apt-get install -y build-essential linux-headers-`uname -r` mysql-server mysql-client bison flex php5 php5-curl php5-cli php5-mysql php-pear php-db php5-gd 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 libical-dev libneon27-dev libsrtp0-dev libspandsp-dev libiksemel-dev libiksemel-utils libiksemel3 openssh-server apache2 postfix mailutils nano ntp chkconfig libcurl4-gnutls-dev unixodbc xinetd e2fsprogs libmyodbc
Durante l'installazione dei pacchetti vi verrà richiesto l'inserimento della password di root per mysql ed i dati di configurazione di postfix (configuratelo come internet site).#> apt-get install -y build-essential linux-headers-`uname -r` mysql-server mysql-client bison flex php5 php5-curl php5-cli php5-mysql php-pear php-db php5-gd 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 libical-dev libneon27-dev libsrtp0-dev libspandsp-dev libiksemel-dev libiksemel-utils libiksemel3 openssh-server apache2 postfix mailutils nano ntp chkconfig libcurl4-gnutls-dev unixodbc xinetd e2fsprogs libmyodbc
#> reboot
Installate pear DB
Non tenete conto della segnalazione di errore.
#> pear install db-1.7.14
Installate Asterisk, jansson, pjsip
Scaricate i pacchetti sorgente:
#> cd /usr/src
#> wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-13-current.tar.gz
#> git clone https://github.com/akheron/jansson.git
#> wget http://www.pjsip.org/release/2.3/pjproject-2.3.tar.bz2
Compialte pjproject:
#> wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-13-current.tar.gz
#> git clone https://github.com/akheron/jansson.git
#> wget http://www.pjsip.org/release/2.3/pjproject-2.3.tar.bz2
#> cd /usr/src
#> tar -xjvf pjproject-2.3.tar.bz2
#> cd /usr/src/pjproject-2.3
#> CFLAGS='-DPJ_HAS_IPV6=0' ./configure --prefix=/usr --enable-shared --disable-sound --disable-resample --disable-video --disable-opencore-amr
#> make dep
#> make
#> make install
Compialte jansson:
#> tar -xjvf pjproject-2.3.tar.bz2
#> cd /usr/src/pjproject-2.3
#> CFLAGS='-DPJ_HAS_IPV6=0' ./configure --prefix=/usr --enable-shared --disable-sound --disable-resample --disable-video --disable-opencore-amr
#> make dep
#> make
#> make install
#> cd /usr/src/jansson/
#> autoreconf -i
#> ./configure
#> make
#> make install
Compialte Asterisk:
#> autoreconf -i
#> ./configure
#> make
#> make install
#> cd /usr/src
#> tar xvfz asterisk-13-current.tar.gz
#> rm -f asterisk-13-current.tar.gz
#> cd asterisk-*
#> ./configure
#> ./contrib/scripts/get_mp3_source.sh
#> make menuselect
Abilitate dal menuselect le seguenti opzioni:#> tar xvfz asterisk-13-current.tar.gz
#> rm -f asterisk-13-current.tar.gz
#> cd asterisk-*
#> ./configure
#> ./contrib/scripts/get_mp3_source.sh
#> make menuselect
- format_mp3
- res_config_mysql
- Sound Packages incluso asterisk-extra-sounds
Salvate e uscite da menuselect e continuate la compilazione:
#> make
#> make install
#> make config
#> ldconfig
#> make install
#> make config
#> ldconfig
Scaricate e predisponete FreePBX
#> cd /usr/src
#> export VER_FREEPBX=12.0
#> git clone http://git.freepbx.org/scm/freepbx/framework.git freepbx
#> cd freepbx
#> git checkout release/${VER_FREEPBX}
#> adduser asterisk --disabled-password --gecos "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
#> chown -R asterisk. /var/www/
#> sed -i 's/\(^upload_max_filesize = \).*/\1120M/' /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
#> chown asterisk. /var/lock/apache2
#> /etc/init.d/apache2 restart
#> export VER_FREEPBX=12.0
#> git clone http://git.freepbx.org/scm/freepbx/framework.git freepbx
#> cd freepbx
#> git checkout release/${VER_FREEPBX}
#> adduser asterisk --disabled-password --gecos "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
#> chown -R asterisk. /var/www/
#> sed -i 's/\(^upload_max_filesize = \).*/\1120M/' /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
#> chown asterisk. /var/lock/apache2
#> /etc/init.d/apache2 restart
Predisponete i DB
#> cd /usr/src/freepbx
#> export ASTERISK_DB_PW='mysql-root-passwd'
#> mysqladmin -u root create asterisk -p
#> mysqladmin -u root create asteriskcdrdb -p
#> mysql -u root -p asterisk < SQL/newinstall.sql
#> mysql -u root -p asteriskcdrdb < SQL/cdr_mysql_table.sql
#> mysql -u root -p -e "GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY '${ASTERISK_DB_PW}';"
#> mysql -u root -p -e "GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY '${ASTERISK_DB_PW}';"
#> mysql -u root -e "flush privileges;" -p
#> export ASTERISK_DB_PW='mysql-root-passwd'
#> mysqladmin -u root create asterisk -p
#> mysqladmin -u root create asteriskcdrdb -p
#> mysql -u root -p asterisk < SQL/newinstall.sql
#> mysql -u root -p asteriskcdrdb < SQL/cdr_mysql_table.sql
#> mysql -u root -p -e "GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY '${ASTERISK_DB_PW}';"
#> mysql -u root -p -e "GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY '${ASTERISK_DB_PW}';"
#> mysql -u root -e "flush privileges;" -p
Installate FreePBX
#> cd /usr/src/freepbx/
#> ./start_asterisk start
#> ./start_asterisk start
#> ./install_amp
#> ./install_amp --update-links
#> amportal chown
#> amportal a ma installall
#> amportal a ma download manager
#> amportal a ma install manager
#> amportal a ma installall
#> amportal chown
#> amportal a ma refreshsignatures
#> amportal a reload
#> ln -s /var/lib/asterisk/moh /var/lib/asterisk/mohmp3
#> amportal restart
#> ./install_amp --update-links
#> amportal chown
#> amportal a ma installall
#> amportal a ma download manager
#> amportal a ma install manager
#> amportal a ma installall
#> amportal chown
#> amportal a ma refreshsignatures
#> amportal a reload
#> ln -s /var/lib/asterisk/moh /var/lib/asterisk/mohmp3
#> amportal restart
Abilitate lo start-up di Asterisk/FreePBX al boot
#> nano /etc/rc.local
aggiungete la sottostante riga prima di exit 0
#> /usr/local/sbin/amportal start
Configurate Apache
Editate /etc/apache2/sites-enabled/000-default e sostituite tutti:
#> /var/www
con:
#> /var/www/html
All'interno dello stesso file, individuate:
<Directory /var/www/html/>
modificate:
AllowOverride None
con:
AllowOverride All
Salvate e fate un restart di apache:
#> /etc/init.d/apache2 restart
Configuriamo il CDR
Editate e/o create i seguenti file con il relativo contenuto:
1. /etc/odbc.ini
[MySQL-asteriskcdrdb]
Description = MySQL connection to 'asterisk' database
Driver = MySQL
Database = asteriskcdrdb
Server = localhost
Port = 3306
Option = 3
Socket =
Description = MySQL connection to 'asterisk' database
Driver = MySQL
Database = asteriskcdrdb
Server = localhost
Port = 3306
Option = 3
Socket =
2. /etc/odbcinst.ini
[MySQL]
Description = MySQL driver
Driver = libmyodbc.so
Setup = libodbcmyS.so
Driver = libmyodbc.so
Setup = libodbcmyS.so
3. /etc/asterisk/cdr_adaptive_odbc.conf
[first]
connection=asteriskcdrdb
table=cdr
alias start => calldate
connection=asteriskcdrdb
table=cdr
alias start => calldate
Eseguite questi comandi:
chown asterisk:asterisk /etc/asterisk/cdr_adaptive_odbc.conf
chmod 775 /etc/asterisk/cdr_adaptive_odbc.conf
chmod 775 /etc/asterisk/cdr_adaptive_odbc.conf
F I N I T O
Migliora il tuo business. Partecipa ai nostri Corsi! |
||
I nostri corsi OnLine ed in Aula sono studiati per garantire il miglior apprendimento e sono finalizzati a "creare professionisti nel settore". Questi i prossimi corsi in calendario: |
Corsi 2019
Corso | Data | Tipo |
---|