O FreePBX é uma das opções para gerenciar o moderno mecanismo de telefonia IP - Asterisk. Por mais que os integradores não gostem dessa "superestrutura", certamente é o líder das instalações de PBX IP.
Desativando o SELINUX
vim /etc/sysconfig/selinux
Substitua SELINUX=enforcing
para SELINUX=disabled
Configurando Dependências
root@asteriskhelp# rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
root@asteriskhelp# yum install -y kernel-devel kernel-headers
Desativando o SELINUX
vim /etc/sysconfig/selinux
Substitua SELINUX=enforcing
para SELINUX=disabled
Configurando Dependências
root@asteriskhelp# rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
root@asteriskhelp# yum install -y kernel-devel kernel-headers
root@asteriskhelp# yum install -y e2fsprogs-devel keyutils-libs-devel krb5-devel libogg \ libselinux-devel libsepol-devel libxml2-devel libtiff-devel gmp php-pear \ php-gd php-mysql php-pdo php mbstring ncurses-devel \ mysql-connector-odbc unixODBC unixODBC-devel \ audiofile-devel libogg-devel openssl-devel zlib-devel \ perl-DateManip sox git wget net-ferramentas psmisc \ yum instalar -y gcc gcc-c ++ fazer gnutls-devel \ libxml2-devel ncurses-devel subversion doxygen \ texinfo curl-devel net-snmp-devel néon-devel \ uuid-devel libuuid-devel sqlite-devel sqlite \ speex-devel gsm-devel libtool libtool-ltdl libtool-ltdl-devel \ libsrtp libsrtp-devel xmlstarlet
Fazendo as atualizações do sistema
root@asteriskhelp# yum install update -y
Reinicie o servidor
root@asteriskhelp# reboot
Instalando o mysql (mariadb)
root@asteriskhelp# yum -y instala mariadb-server mariadb mariadb-devel
Habilitando mariadb na inicialização do sistema
root@asteriskhelp# systemctl enable mariadb.service
Iniciando o mariadb
root@asteriskhelp# systemctl start mariadb.service
Iniciando o configurador do Mysql
root@asteriskhelp# mysql_secure_installation
Set root password? [Y/n] y New password: Re-enter new password: Password updated successfully! Reloading privilege tables.. ... Success! By default, a MariaDB installation has an anonymous user, allowing anyone to log into MariaDB without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? [Y/n] y ... Success! Normally, root should only be allowed to connect from "localhost". This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? [Y/n] n ... skipping. By default, MariaDB comes with a database named "test" that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? [Y/n] y - Dropping test database... ... Success! - Removing privileges on test database... ... Success! Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? [Y/n] y ... Success! Cleaning up... All done! If you"ve completed all of the above steps, your MariaDB installation should now be secure. Thanks for using MariaDB!
Instalando o PJProject
root@asteriskhelp# cd /usr/src root@asteriskhelp# git clone https://github.com/asterisk/pjproject pjproject root@asteriskhelp# cd pjproject/ root@asteriskhelp# sudo ./configure --libdir=/usr/lib64 --prefix=/usr \ --enable-shared --disable-sound --disable-resample --disable-video root@asteriskhelp# sudo make dep root@asteriskhelp# sudo make root@asteriskhelp# sudo make install root@asteriskhelp# sudo ldconfig
Instalando o libjansson
root@asteriskhelp# cd /usr/src root@asteriskhelp# wget http://www.digip.org/jansson/releases/jansson-2.5.tar.gz root@asteriskhelp# tar xzf jansson-2.5.tar.gz root@asteriskhelp# cd jansson-2.5 root@asteriskhelp# sudo ./configure --prefix=/usr/ root@asteriskhelp# sudo make clean root@asteriskhelp# sudo make root@asteriskhelp# sudo make install root@asteriskhelp# sudo ldconfig
Lame - para codificação de áudio para o formato MP3
root@asteriskhelp# cd /usr/src root@asteriskhelp# wget http://sourceforge.net/projects/lame/files/lame/3.98.4/lame-3.98.4.tar.gz root@asteriskhelp# tar zxvf lame-*.gz root@asteriskhelp# cd lame-* root@asteriskhelp# sudo ./configure root@asteriskhelp# sudo make root@asteriskhelp# sudo make install
Instalando DAHDI
root@asteriskhelp# cd /usr/src root@asteriskhelp# wget https://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/ \ dahdi-linux-complete-current.tar.gz root@asteriskhelp# tar xzf dahdi-linux-complete-current.tar.gz root@asteriskhelp# cd dahdi-linux-complete-* root@asteriskhelp# sudo make all root@asteriskhelp# sudo make install root@asteriskhelp# sudo make config
Instalando LIBPRI
root@asteriskhelp# cd /usr/src root@asteriskhelp# wget https://downloads.asterisk.org/pub/telephony/libpri/libpri-current.tar.gz root@asteriskhelp# tar xzf libpri-*.tar.gz root@asteriskhelp# cd /usr/src/libpri-* root@asteriskhelp# sudo make root@asteriskhelp# sudo make install
Instalando Asterisk 13
root@asteriskhelp# cd /usr/src root@asteriskhelp# wget https://downloads.asterisk.org/pub/telephony/asterisk/asterisk-13-current.tar.gz root@asteriskhelp# tar xvfz asterisk-13*.tar.gz root@asteriskhelp# cd asterisk-13.* root@asteriskhelp# sudo ./contrib/scripts/install_prereq install root@asteriskhelp# sudo ./configure --libdir=/usr/lib64 root@asteriskhelp# sudo contrib/scripts/get_mp3_source.sh root@asteriskhelp# sudo make menuselect
Depois de inserir o comando make menuselect, será solicitado a selecionar os módulos a serem instalados. A maioria
os módulos necessários são selecionados automaticamente. Para suporte a mp3, inclua o módulo "format_mp3"
---> Add-ons (See README-addons.txt) --- extended --- XXX chan_mobile [*] chan_ooh323 [*] format_mp3 [*] res_config_mysql --- deprecated --- [*] app_mysql [*] app_saycountpl [*] cdr_mysql ---> Core Sound Packages [*] CORE-SOUNDS-RU-GSM ---> Extras Sound Packages [*] EXTRA-SOUNDS-EN-GSM
root@asteriskhelp# make && make install && make config && ldconfig
Instalar o asterisk a partir do usuario asterisk
No arquivo /usr/sbin/safe_asterisk nós substituímos as linhas:
ASTARGS="" para ASTARGS="-U asterisk"
Crie um usuário do Asterisk e defina as permissões do usuário.
root@asteriskhelp# useradd -m asterisk
Definir as permissões de pasta necessárias para o usuário asterisk
root@asteriskhelp# chown asterisk.asterisk /var/run/asterisk root@asteriskhelp# chown -R asterisk.asterisk /etc/asterisk root@asteriskhelp# chown -R asterisk.asterisk /var/{lib,log,spool}/asterisk root@asteriskhelp# chown -R asterisk.asterisk /usr/lib64/asterisk
Configurar o servidor web httpd (Apache)
No arquivo de configuração do servidor web /etc/httpd/conf/httpd.conf
Nós especificamos o usuário asterisk nas diretivas Usuário e Grupo:
root@asteriskhelp# user asteriskEspecifique todas as diretivas para substituir as configurações do arquivo .htaccess
root@asteriskhelp# group asterisk
No arquivo de configuração do servidor web /etc/httpd/conf/httpd.conf
Alterar o AllowOverride None para AllowOverride All
Configurando o php
No arquivo /etc/php.ini
Defina as diretivas no próximo. valores:
date.timezone = America/Sao_Paulo
upload_max_filesize = 120 milhões
Reinicie o apache
root@asteriskhelp# systemctl restart httpd root@asteriskhelp# systemctl enable httpdInstalando FreePBX
root@asteriskhelp# cd /usr/src root@asteriskhelp# wget http://mirror.freepbx.org/modules/packages/freepbx/freepbx-13.0-latest.tgz root@asteriskhelp# tar xzf freepbx-13.0-latest.tgz root@asteriskhelp# cd freepbx root@asteriskhelp# sudo ./start_asterisk startNOTA:
Alterar as configurações de conexão do banco de dados
No arquivo installlib/installcommand.class.php, um array $settings está configurado, a chave dbpass, que é um array, e neste array para a chave padrão, configure o valor da sua senha atual para o usuário root se conectar ao banco de dados:
No arquivo installlib/installcommand.class.php, um array $settings está configurado, a chave dbpass, que é um array, e neste array para a chave padrão, configure o valor da sua senha atual para o usuário root se conectar ao banco de dados:
"dbpass" => array ( "default" => "* senha para o banco de dados *", "description" => "Senha do banco de dados"
root@asteriskhelp# ./install -n
Pronto, seu PBX IP esté pronto, conecte-se ao FreePBX.
http://IP_FreePBX/admin