Cài đặt tổng đài Freeswitch FusionPBX

CentOS v7
Freeswitch v1.6
FusionPBX v4.4
MariaDB v5.5
Apache v2.4
PHP v7.1

Tắt Selinux

  1. sestatus
  2. sed -i 's/\(^SELINUX=\).*/\SELINUX=disabled/' /etc/selinux/config

Reboot server

  1. yum -y update && yum -y install epel-release
  2. yum -y install git gcc-c++ autoconf automake libtool wget python ncurses-devel zlib-devel libjpeg-devel openssl-devel e2fsprogs-devel sqlite-devel libcurl-devel pcre-devel speex-devel ldns-devel libedit-devel libmemcached-devel nano httpd unixODBC mysql-connector-odbc memcached ghostscript libtiff-devel libtiff-tools at mariadb mariadb-server tftp-server

Time Zone

  1. timedatectl set-timezone Asia/Ho_Chi_Minh
  2. ​timedatectl status

PHP

  1. rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
  2. yum install epel-release yum-utils -y
  3. yum --enablerepo=remi-php71 install php-xml php-soap php-xmlrpc php-mbstring php-json php-gd php-mcrypt 
  4. yum-config-manager --enable remi-php71
  5. yum -y install php php-common php-pdo php-soap php-xml php-xmlrpc php-mysqlnd php-cli php-imap php-mcrypt php-gd php-odbc php-opcache php-json

Memmcached

  1. nano /etc/sysconfig/memcached

  1. PORT="11211"
  2. USER="memcached"
  3. MAXCONN="1024"
  4. CACHESIZE="64"
  5. OPTIONS="-l 127.0.0.1"

Lấy Personal Token tại đây https://developer.signalwire.com/freeswitch/FreeSWITCH-Explained/Installation/HOWTO-Create-a-SignalWire-Personal-Access-Token_67240087/

Cài Freeswitch 

  1. echo "signalwire" > /etc/yum/vars/signalwireusername
  2. echo "TOKEN" > /etc/yum/vars/signalwiretoken
  3. yum install -y https://$(< /etc/yum/vars/signalwireusername):$(< /etc/yum/vars/signalwiretoken)@freeswitch.signalwire.com/repo/yum/centos-release/freeswitch-release-repo-0-1.noarch.rpm epel-release
  4. yum install -y freeswitch-config-vanilla freeswitch-sounds* freeswitch-lang* freeswitch-lua freeswitch-xml-cdr

Database

  1. systemctl start mariadb
  2. password=somepassword
  3. mysql -e "CREATE DATABASE freeswitch;"
  4. mysql -e "CREATE DATABASE fusionpbx;"
  5. mysql -e "GRANT ALL PRIVILEGES ON freeswitch.* TO fusionpbx@localhost IDENTIFIED BY '$password';"
  6. mysql -e "GRANT ALL PRIVILEGES ON fusionpbx.* TO fusionpbx@localhost IDENTIFIED BY '$password';"
  7. mysql -e "flush privileges;"

ODBC

  1. nano /etc/odbc.ini

  1. [freeswitch]
  2. Driver = MySQL
  3. SERVER = 127.0.0.1
  4. PORT = 3306
  5. DATABASE = freeswitch
  6. OPTION = 67108864
  7. Socket = /var/lib/mysql/mysql.sock
  8. threading=0
  9. MaxLongVarcharSize=65536
  10. [fusionpbx]
  11. Driver = MySQL
  12. SERVER = 127.0.0.1
  13. PORT = 3306
  14. DATABASE = fusionpbx
  15. OPTION = 67108864
  16. Socket = /var/lib/mysql/mysql.sock
  17. threading=0

Test odbc driver

  1. odbcinst -s -q

Kiểm tra odbc kết nối

  1. isql -v freeswitch fusionpbx somepassword
  2. quit

Fusionpbx

  1. cd /var/www/html
  2. git clone -b 4.4 https://github.com/powerpbx/fusionpbx.git .
  3. mv /etc/freeswitch /etc/freeswitch.orig
  4. mkdir /etc/freeswitch
  5. cp -R /var/www/html/resources/templates/conf/* /etc/freeswitch
  6. mkdir -p /usr/share/freeswitch/sounds/music/default
  7. mv /usr/share/freeswitch/sounds/music/*000/ /usr/share/freeswitch/sounds/music/default/

Apache

  1. usermod -a -G apache freeswitch
  2. sed -i "s/User apache/User freeswitch/" /etc/httpd/conf/httpd.conf
  3. sed -i "s/Group apache/Group daemon/" /etc/httpd/conf/httpd.conf
  4. sed -i ':a;N;$!ba;s/AllowOverride None/AllowOverride All/2' /etc/httpd/conf/httpd.conf

Ownership

  1. chown -R freeswitch.daemon /etc/freeswitch /var/lib/freeswitch /var/log/freeswitch /usr/share/freeswitch /var/www/html
  2.  
  3. find /etc/freeswitch -type d -exec chmod 770 {} \;
  4. find /var/lib/freeswitch -type d -exec chmod 770 {} \;
  5. find /var/log/freeswitch -type d -exec chmod 770 {} \;
  6. find /usr/share/freeswitch -type d -exec chmod 770 {} \;
  7. find /var/www/html -type d -exec chmod 770 {} \;
  8.  
  9. find /etc/freeswitch -type f -exec chmod 664 {} \;
  10. find /var/lib/freeswitch -type f -exec chmod 664 {} \;
  11. find /var/log/freeswitch -type f -exec chmod 664 {} \;
  12. find /usr/share/freeswitch -type f -exec chmod 664 {} \;
  13. find /var/www/html -type f -exec chmod 664 {} \;

Taọ file cấu hình hệ thống cho freeswitch

  1. nano /etc/systemd/system/freeswitch.service

  1. [Unit]
  2. Description=FreeSWITCH
  3. Wants=network-online.target
  4. After=syslog.target network-online.target
  5. After=mariadb.service httpd.service
  6. [Service]
  7. Type=forking
  8. User=freeswitch
  9. ExecStartPre=/usr/bin/mkdir -m 0750 -p /run/freeswitch
  10. ExecStartPre=/usr/bin/chown freeswitch:daemon /run/freeswitch
  11. WorkingDirectory=/run/freeswitch
  12. PIDFile=/run/freeswitch/freeswitch.pid
  13. EnvironmentFile=-/etc/sysconfig/freeswitch
  14. ExecStart=/usr/bin/freeswitch -ncwait -nonat $FREESWITCH_PARAMS
  15. ExecReload=/usr/bin/kill -HUP $MAINPID
  16. [Install]
  17. WantedBy=multi-user.target

Enable services

  1. systemctl daemon-reload
  2. systemctl enable mariadb
  3. systemctl enable httpd
  4. systemctl enable freeswitch
  5. systemctl enable memcached
  6. systemctl restart httpd
  7. systemctl restart freeswitch
  8. systemctl restart memcached

Firewall

  1. firewall-cmd --permanent --zone=public --add-service={http,https}
  2. firewall-cmd --permanent --zone=public --add-port={5060,5061,5080,5081}/tcp
  3. firewall-cmd --permanent --zone=public --add-port={5060,5061,5080,5081}/udp
  4. firewall-cmd --permanent --zone=public --add-port=16384-32768/udp
  5. firewall-cmd --reload
  6. firewall-cmd --list-all

Mở trình duyệt web và nhập địa chỉ IP của server để mở giao diện cài đặt
Chọn ngôn ngữ để sử dụng.


Tiến hành cài đặt các thông số:
Username
Password
Database Name: fusionpbx
Database Username: fusionpbx
Database Password: password
Không Check “Create the database”

CentOS 7 and RHEL 7 | FreeSWITCH Documentation (signalwire.com)

Freeswitch install — FusionPBX Docs documentation

Hướng dẫn cài đặt FusionPBX v4.4 Freeswitch v1.6 CentOS v7 MariaDB Apache – Vietcalls Blog

Cài đặt FusionPBX v4.4 trên CentOS 7 – TEL4VN – Đào tạo tổng đài

 

 

 

Leave a Reply

You must be logged in to post a comment.