sudo dnf -y update
sudo sed -i 's/\(^SELINUX=\).*/\SELINUX=disabled/' /etc/sysconfig/selinux &&
sudo sed -i 's/\(^SELINUX=\).*/\SELINUX=disabled/' /etc/selinux/config &&
sudo reboot
# sestatus
SELinux status: disabled
firewall-cmd --zone=public --add-port=80/tcp --permanent &&
firewall-cmd --zone=public --add-port=443/tcp --permanent &&
firewall-cmd --zone=public --add-port=5060/udp --permanent &&
firewall-cmd --zone=public --add-port=5061/tcp --permanent &&
firewall-cmd --zone=public --add-port=5160/udp --permanent &&
firewall-cmd --zone=public --add-port=5161/tcp --permanent &&
firewall-cmd --zone=public --add-port=8001/tcp --permanent &&
firewall-cmd --zone=public --add-port=8003/tcp --permanent &&
firewall-cmd --zone=public --add-port=8088-8089/tcp --permanent &&
firewall-cmd --reload
sudo yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
sudo dnf config-manager --set-enabled crb
sudo yum group -y install "Development Tools"
sudo dnf -y install git wget emacs-nox subversion net-tools kernel-devel sqlite-devel psmisc ncurses-devel newt-devel libxml2-devel libtiff-devel gtk2-devel libtool libuuid-devel crontabs cronie-anacron libedit libedit-devel gnutls-devel sox sox-devel unixODBC unixODBC-devel libtool-ltdl libtool-ltdl-devel
sudo dnf -y install mariadb mariadb-server &&
sudo systemctl enable --now mariadb
sudo su
cd ~
mysql_secure_installation
Switch to unix_socket authentication [Y/n] n
Change the root password? [Y/n] n
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y
sudo dnf -y install unixODBC unixODBC-devel libtool-ltdl libtool-ltdl-devel
sudo dnf -y install mariadb-connector-odbc
;--------------------------------------------------------------------------------;
; Do NOT edit this file as it is auto-generated by FreePBX. ;
;--------------------------------------------------------------------------------;
; For information on adding additional paramaters to this file, please visit the ;
; FreePBX.org wiki page, or ask on IRC. This file was created by the new FreePBX ;
; BMO - Big Module Object. Any similarity in naming with BMO from Adventure Time ;
; is totally deliberate. ;
;--------------------------------------------------------------------------------;
[asteriskcdrdb]
enabled=>yes
dsn=>MySQL-asteriskcdrdb
pre-connect=>yes
max_connections=>5
username=>freepbxuser
password=>63juy7827821r783097t4h4587202154
database=>asteriskcdrdb
# Driver from the mysql-connector-odbc package in Fedora >=29
# Setup from the unixODBC package
[MySQL]
Description = ODBC for MySQL 8
# mysql-connector-odbc package provides shared libraries with "w" or "a" suffix.
# 'w' stands for 'wide' or 'unicode' character set, 'a' stands for 'ANSI'
# Symlinks used in the configuration below lead to the 'w' variant by default
Driver = /usr/lib/libmyodbc8.so
Driver64 = /usr/lib64/libmyodbc8.so
FileUsage = 1
/etc/odbcinst.ini
[MariaDB]
Description=ODBC for MariaDB
Driver=/usr/lib64/libmaodbc.so
FileUsage=1
UsageCount=3
/etc/odbc.ini
[MySQL-asteriskcdrdb]
Description=MariaDB connection to 'asteriskcdrdb' database
Driver=MariaDB
server=localhost
database=asteriskcdrdb
Port=3306
Socket=/var/lib/mysql/mysql.sock
Option=3
Charset=utf8
UsageCount=1
sudo mkdir -p /opt/app/usr/src &&
cd /opt/app/usr/src
cd /opt/app/usr/src &&
wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-18-current.tar.gz &&
tar zxvf asterisk-18-current.tar.gz &&
cd asterisk-18.*/
sudo ./contrib/scripts/install_prereq install &&
sudo ./contrib/scripts/get_mp3_source.sh
./configure --prefix=/usr --libdir=/usr/lib64 --with-jansson-bundled --with-pjproject-bundled --with-ssl=ssl
make menuselect
Add-ons (See README-addons.txt)
+--> Select format_mp3
Applications
+--> Select app_macro
Bridging Modules
Channel Event Logging
Channel Drivers
Codec Translators
+---> Select all External Codecs
Format Interpreters
Dialplan Functions
PBX Modules
Resource Modules
Test Modules
Compiler Flags
Utilities
AGI Samples
Core Sound Packages
+--> Select WAV, ULAW, ALAW, GSM, G729, G722
Music On Hold File Packages
+--> Select WAV, ULAW, ALAW, GSM, G729, G722
MENUSELECT_EXTRA_SOUNDS
+--> Select WAV, ULAW, ALAW, GSM, G729, G722
make &&
make install
mv /etc/init.d /tmp &&
dnf -y install chkconfig &&
cp /tmp/init.d/* /etc/init.d
make basic-pbx &&
make config &&
ldconfig
sudo groupadd asterisk &&
sudo useradd -r -d /opt/app/home/asterisk -g asterisk asterisk &&
sudo usermod -aG audio,dialout asterisk &&
sudo chown -R asterisk.asterisk /etc/asterisk /var/{lib,log,spool}/asterisk /usr/lib64/asterisk &&
mkhomedir_helper asterisk
echo AST_USER="asterisk" >> /etc/sysconfig/asterisk &&
echo AST_GROUP="asterisk" >> /etc/sysconfig/asterisk &&
echo "runuser = asterisk" >> /etc/asterisk/asterisk.conf &&
echo "rungroup = asterisk" >> /etc/asterisk/asterisk.conf
sudo dnf module list nodejs
sudo su &&
export N_PREFIX=/usr/local/n &&
curl -L https://bit.ly/n-install | bash
/usr/local/n/bin/n install 10.24.1
ln -s /usr/local/n/bin/node /usr/bin/node
ln -s /usr/local/n/bin/npm /usr/bin/npm
# node -v
v10.24.1
# npm -v
6.14.12
ln -s /usr/local/n/bin/node /usr/bin/node
ln -s /usr/local/n/bin/npm /usr/bin/npm
#Install httpd
sudo dnf -y install httpd
#remove default index.html page
sudo rm -f /var/www/html/index.html &&
#Start httpd and enable it to be starting automatically on system boot
sudo systemctl enable --now httpd &&
#If running an active firewall, ensure to open httpd
sudo firewall-cmd --add-service={http,https} --permanent &&
sudo firewall-cmd --reload
dnf -y install mod_ssl
SSLCertificateFile /etc/pki/tls/certs/domain.crt
SSLCertificateKeyFile /etc/pki/tls/private/domain.key
update-ca-trust
tee /etc/httpd/conf.d/https_redirect.conf << EOF
# Redirect all requests to port 80 to port 443 SSL via mod_rewrite
# Make sure the module is loaded and switched on
<IfModule !mod_rewrite.c>
LoadModule rewrite_module /usr/lib/httpd/modules/mod_rewrite.so
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine on
# The line below sets the rewrite condition for mod_rewrite.so.
# That is, if the server port does not equal 443, then this condition is true
ReWriteCond %{SERVER_PORT} !^443$
# redirect rule
RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L]
</IfModule>
EOF
systemctl restart httpd.service
sudo dnf -y install yum-utils &&
sudo dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm &&
sudo dnf -y install https://rpms.remirepo.net/enterprise/remi-release-9.rpm
sudo dnf module -y reset php &&
sudo dnf module -y install php:remi-7.4
# dnf module list php
Last metadata expiration check: 0:26:07 ago on Mon 03 Apr 2023 06:03:19 AM CDT.
Rocky Linux 9 - AppStream
Name Stream Profiles Summary
php 8.1 common [d], devel, minimal PHP scripting language
Remi's Modular repository for Enterprise Linux 9 - x86_64
Name Stream Profiles Summary
php remi-7.4 [e] common [d] [i], devel, minimal PHP scripting language
php remi-8.0 common [d], devel, minimal PHP scripting language
php remi-8.1 common [d], devel, minimal PHP scripting language
php remi-8.2 common [d], devel, minimal PHP scripting language
sudo dnf install -y php php-pear php-cgi php-common php-curl php-mbstring php-gd php-mysqlnd php-gettext php-bcmath php-zip php-xml php-json php-process php-snmp php-ldap php-pdo php-opcache php-intl php-soap &&
sudo pear install Console_Getopt
sudo sed -i 's/\(^upload_max_filesize = \).*/\120M/' /etc/php.ini
systemctl enable php-fpm &&
systemctl start php-fpm
sudo sed -i 's/\(^memory_limit = \).*/\1128M/' /etc/php.ini &&
sudo sed -i 's/^\(User\|Group\).*/\1 asterisk/' /etc/httpd/conf/httpd.conf &&
sudo sed -i 's/AllowOverride None/AllowOverride All/' /etc/httpd/conf/httpd.conf &&
sudo sed -i 's/\(^user = \).*/\1asterisk/' /etc/php-fpm.d/www.conf &&
sudo sed -i 's/\(^group = \).*/\1asterisk/' /etc/php-fpm.d/www.conf &&
sudo sed -i 's/\(^listen.acl_users = \).*/\1apache,nginx,asterisk/' /etc/php-fpm.d/www.conf
cd /opt/app/usr/src &&
wget http://mirror.freepbx.org/modules/packages/freepbx/7.4/freepbx-16.0-latest.tgz &&
tar zxvf freepbx-16.0-latest.tgz &&
cd freepbx
cd /opt/app/usr/src/asterisk-18.* &&
make basic-pbx &&
make config &&
ldconfig &&
cd /opt/app/usr/src/freepbx &&
./start_asterisk restart &&
ps aux | grep asterisk &&
rm -f /etc/asterisk/asterisk.conf &&
./install -n
fwconsole ma disablerepo commercial &&
fwconsole ma enablerepo extended &&
fwconsole ma installall &&
fwconsole ma delete firewall &&
fwconsole chown &&
fwconsole reload &&
fwconsole restart
sudo systemctl restart httpd php-fpm
sudo tee /etc/systemd/system/freepbx.service << EOF
[Unit]
Description=FreePBX VoIP Server
After=mariadb.service
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/sbin/fwconsole start -q
ExecStop=/usr/sbin/fwconsole stop -q
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload &&
sudo systemctl enable freepbx &&
sudo systemctl start freepbx
# asterisk -rx "cdr show status"
Call Detail Record (CDR) settings
----------------------------------
Logging: Enabled
Mode: Simple
Log calls by default: Yes
Log unanswered calls: No
Log congestion: No
Ignore bridging changes: No
Ignore dial state changes: No
* Registered Backends
-------------------
Adaptive ODBC
# asterisk -rx "odbc show"
ODBC DSN Settings
-----------------
Name: asteriskcdrdb
DSN: MySQL-asteriskcdrdb
Number of active connections: 1 (out of 5)
Logging: Disabled
wget https://github.com/cisco/libsrtp/archive/refs/tags/v2.5.0.tar.gz
./configure --enable-openssl
make shared_library
make install