How to – Setup a slave DB for a scratch installed ViciDial

Slave DB

How to – Setup a slave DB for a scratch installed ViciDial

This Article will go over how to setup a slave database server for your ViciDial cluster when using a scratch installed server bunch. For this particular example I have used Alma Linux 8.5 which installs Mysql 10.3.28, if you followed my scratch instructions. This process was a pain in the arse, but after much trial and error I was able to get it done and here is how I did it:

Step 1 – Edit the MySQL config file

Add these lines to /etc/my.cnf below [mysqld] on both the master and slave database:

log_bin=/var/lib/mysql/mysql-bin
relay_log=/var/lib/mysql/mysql-relay-bin
binlog_format=mixed
binlog_direct_non_transactional_updates=1
datadir = /srv/mysql/data
log-bin=mysql-bin
server-id       = 1
slave-skip-errors = 1032,1690,1062
replicate-ignore-db=mysql
replicate-do-db=asterisk
slave_parallel_threads=40
slave-parallel-mode=optimistic
slave_parallel_max_queued=5242880

Step 2 – Create the slave user on both servers

Go into MySQL and create the slave user and do this on both servers

CREATE USER 'slave'@'localhost' IDENTIFIED BY 'slave1234';
CREATE USER 'slave'@'%' IDENTIFIED BY 'slave1234';
GRANT SELECT, CREATE, INSERT, UPDATE, DELETE, ALTER, DROP, INDEX on asterisk.* TO slave@'%' IDENTIFIED BY 'slave1234';
GRANT SELECT, CREATE, INSERT, UPDATE, DELETE, ALTER, DROP, INDEX on asterisk.* TO slave@localhost IDENTIFIED BY 'slave1234';
grant replication slave on . to slave@'%' identified by 'slave1234';
grant replication slave on . to slave@'localhost' identified by 'slave1234';
flush privileges;
image 9
Create slave user on both the master and slave DB

Step 3 – Change some setting on the slave DB

Now we need to change some of the settings for the slave DB and add a couple more lines. Change the server-id to 2 instead of 1 in /etc/my.cnf and add the read_only=1 and report-host=whatever the slave DB host is

server-id=2
# read only yes
read_only=1
# define own hostname
report-host=slavedb.yourserver.com

Step 4 – Restart the MySQL services on both servers

Run the following command on both servers:

service mysql restart

Step 5 – Create the MySQL dump to send over to the slave DB from the master

We need to create the MySQL dump and send it over to the slave using the scp command like so:

mkdir /home/mariadb_backup
mariabackup --backup --target-dir /home/mariadb_backup -u root
image 10
Create MySQL dump file

Once thats done go ahead and zip up the files and send the file over by typing the following:

cd /home/mariadb_backup
zip -r mysqldump.zip *
scp mysqldump.zip 192.168.1.10:/root/

Why we are here, lets lock the MySQL tables on the master:

mysql
FLUSH TABLES WITH READ LOCK;
exit

Step 6 – Connect to Slave DB and extract the files and load it into the slave

ssh into your slave db server and change directory to /root then create the folder and extract the files like so:

cd /root
mkdir mariadb_backup
mv mysqldump.zip mariadb_backup/
cd mariadb_backup/
unzip mysqldump.zip
systemctl stop mariadb
rm -rf /var/lib/mysql/*
image 11

Now run the following commands that are BOLD to import the MySQL dump and set its position to match that of the master.

# run prepare task before restore task (OK if [completed OK])
[root@node01 ~]# mariabackup --prepare --target-dir /root/mariadb_backup
mariabackup based on MariaDB server 10.3.28-MariaDB Linux (x86_64)
mariabackup: cd to /root/mariadb_backup/
.....
.....
2019-11-29 19:38:20 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=1630833
Last binlog file , position 0
191129 19:38:21 completed OK!

# run restore
[root@node01 ~]# mariabackup --copy-back --target-dir /root/mariadb_backup
mariabackup based on MariaDB server 10.3.28-MariaDB Linux (x86_64)
191129 19:39:21 [01] Copying ibdata1 to /var/lib/mysql/ibdata1
191129 19:39:21 [01]        ...done
.....
.....
191129 19:39:21 [01] Copying ./xtrabackup_binlog_pos_innodb to /var/lib/mysql/xtrabackup_binlog_pos_innodb
191129 19:39:21 [01]        ...done
191129 19:39:21 completed OK!

[root@node01 ~]# chown -R mysql. /var/lib/mysql
[root@node01 ~]# systemctl start mariadb
# confirm [File] and [Position] value of master log
[root@node01 ~]# cat /root/mariadb_backup/xtrabackup_binlog_info
mysql-bin.000001        642     0-101-2

# set replication
[root@node01 ~]# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 10
Server version: 10.3.28-MariaDB-log MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> change master to 
    -> master_host='10.0.0.31',             # Master Host IP address
    -> master_user='repl_user',             # replication user
    -> master_password='password',          # replication user password
    -> master_log_file='mysql-bin.000001',  # [File] value confirmed above
    -> master_log_pos=642;              # [Position] value confirmed above
Query OK, 0 rows affected (0.58 sec)

# start replication
MariaDB [(none)]> start slave; 
Query OK, 0 rows affected (0.00 sec)

# show status
MariaDB [(none)]> show slave status\G 
*************************** 1. row ***************************
                Slave_IO_State: Waiting for master to send event
                   Master_Host: 10.0.0.31
                   Master_User: repl_user
                   Master_Port: 3306
                 Connect_Retry: 60
               Master_Log_File: mysql-bin.000001
           Read_Master_Log_Pos: 642
                Relay_Log_File: mariadb-relay-bin.000002
                 Relay_Log_Pos: 555
         Relay_Master_Log_File: mysql-bin.000001
              Slave_IO_Running: Yes
             Slave_SQL_Running: Yes
               Replicate_Do_DB:
           Replicate_Ignore_DB:
            Replicate_Do_Table:
        Replicate_Ignore_Table:
       Replicate_Wild_Do_Table:
   Replicate_Wild_Ignore_Table:
                    Last_Errno: 0
                    Last_Error:
                  Skip_Counter: 0
           Exec_Master_Log_Pos: 642
               Relay_Log_Space: 866
               Until_Condition: None
                Until_Log_File:
                 Until_Log_Pos: 0
            Master_SSL_Allowed: No
            Master_SSL_CA_File:
            Master_SSL_CA_Path:
               Master_SSL_Cert:
             Master_SSL_Cipher:
                Master_SSL_Key:
         Seconds_Behind_Master: 0
 Master_SSL_Verify_Server_Cert: No
                 Last_IO_Errno: 0
                 Last_IO_Error:
                Last_SQL_Errno: 0
                Last_SQL_Error:
   Replicate_Ignore_Server_Ids:
              Master_Server_Id: 101
                Master_SSL_Crl:
            Master_SSL_Crlpath:
                    Using_Gtid: No
                   Gtid_IO_Pos:
       Replicate_Do_Domain_Ids:
   Replicate_Ignore_Domain_Ids:
                 Parallel_Mode: conservative
                     SQL_Delay: 0
           SQL_Remaining_Delay: NULL
       Slave_SQL_Running_State: Slave has read all relay log; waiting for the slave I/O thread to update it
              Slave_DDL_Groups: 0
Slave_Non_Transactional_Groups: 0
    Slave_Transactional_Groups: 0
1 row in set (0.000 sec)

Step 7 – Unlock the Master DB

Now go back into the master DB and unlock the tables:

mysql
unlock tables;

Step 8 – Set the Slave DB in ViciDIal

Now you can set the slave server info in ViciDial by going into the admin GUI and going into system settings. Set the slave DB server IP and choose which reports you want to display from it.

image 12

Well, this has been quite the nightmare to get it done and hopefully I can save some of you some time with this article. If you have any problems feel free to join our Skype Live Support Channel and someone will be willing to help.

-Chris aka carpenox

How to – Setup an archive server

archive

How to – Setup an archive server

This article is going to go over how to “scratch” install an archive server on CentOS 8, Rocky Linux or Alma Linux. You can pretty much follow it for OpenSuSe as well but there would be some small variations for installing vsftpd.

Step 1 – Install and setup vsftpd

The first thing we have to do is install and properly configure vsftpd.

yum install vsftpd
nano /etc/vsftpd/vsftpd.conf
paste the following at the very bottom:

allow_writeable_chroot=YES
userlist_deny=NO
pasv_min_port=30000
pasv_max_port=31000
userlist_enable=YES
userlist_deny=NO
userlist_file=/etc/vsftpd/user_list
allow_writeable_chroot=YES
vsftpd config
vsftpd.conf config
nano /etc/vsftpd/user_list
(add "cronarchive" to the bottom)

useradd -m -d /home/archive/ cronarchive
passwd cronarchive 
(set the pw u want)

mkdir -p /home/archive
chmod -R 777 /home/archive

Step 2 – Set your archive server in install.pl script

Below is a settings example to put during the install.pl script which can be run by running the following commands. This has to be run on all asterisk servers:

cd /usr/src/astguiclient/trunk/
perl install.pl
archive setup
archive setup during install.pl script

Step 3 – Turning on the cronjob to send the recordings over to the archive server

Changing this cronjob has to be done on all asterisk servers. You have to remove the # in front of this line by typing “crontab -e” and scrolling until you find it:

2,5,8,11,14,17,20,23,26,29,32,35,38,41,44,47,50,53,56,59 * * * * /usr/share/astguiclient/AST_CRON_audio_3_ftp.pl --MP3 --run-check
image 7
crontab -e

Step 4 – Changing the Apache alias for the recordings

Last thing we need to do is change the alias for the recordings on the archive server as shown below:

nano /etc/httpd/conf.d/record.conf

Alias /RECORDINGS/ "/home/archive/"

<Directory "/home/archive">
    Options Indexes MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
    Require all granted
        <files *.mp3>
            Forcetype application/forcedownload
        </files>
</Directory>
Apache alias
Apache alias

Well, thats all there is to it, hopefully this will help some of you with improving your cluster setups and properly setting up an archive server.

-Chris aka carpenox

How to – Create a DNC call menu for people to remove themselves

DNC Call Menu

How to – Create a DNC call menu for people to remove themselves

This article will go over the process to create a call menu or IVR that allows people to remove themselves from the calling list by pressing a key. The FTC is cracking down on VoIP carriers to make sure their clients are using this feature and it will end up getting your VoIP routes shut down if you do not have this feature on your system.

DNC Call Menu
DNC Call Menu

Step 1 – Create a new Call Menu

Go to the admin GUI for ViciDial and click on inbound, then “Add a new call menu”

add a new call menu
Add a new call menu

Step 2 – Fill out the required fields as highlighted in the picture below

For this example we have used some of the built in sounds for ViciDial and piped them together ( | ) to create the voice prompt we want as well as the post message to be played after they opt out. This example only shows 1 option to be pressed, but it can be amplified even more by setting up other options such as leaving a voicemail, asking for a callback, routing to an operator or anything else you can pretty much do with the system.

cm_dnc.agi,DNC---YES------B---

thanks-for-calling-today|privacy-to-blacklist-this-number|press-3
your|number|has-been|removed|sip-silence|goodbye
image 3
Call Menu Options

Step 3 – Attach the call menu to you inbound group that your DID’s are routed through

You can get to your ingroup also through the inbound menu option in the admin GUI. Once your in your inbound group attached to your DIDs, go down to no agent queueing option and set it to Y, then set the route to call menu as shown below:

Inbound group for DIDs
Inbound Group for DID’s

That’s all there is to it, hopefully you guys head my advice and do this now before it happens to you via your carrier, cause trust me when I tell you, its coming. If you need additional help, feel free to stop by our live support on Skype by clicking here.

-Chris aka carpenox

URGENT UPDATE REQUIRED – ViciDial Security Vulnerability

security update

URGENT UPDATE REQUIRED – ViciDial Security Vulnerability

The ViciDial Group has released a warning for any SVN version below 3583, if you are below this version, update your system immediately. You can do so by following this article for SVN update.

image
ViciDial versions below 3583 are Vulnerable!

I hope everyone takes this seriously, or your data may be hacked or minutes used on your VoIP, or worse.

Chris aka Carpenox

How to – Fix “Repository ‘openSUSE-Leap-15.2-PHP-Applications’ is invalid.”

Repository 'openSUSE-Leap-15.2-PHP-Applications' is invalid.

How to – Fix “Repository ‘openSUSE-Leap-15.2-PHP-Applications’ is invalid.”

Repository 'openSUSE-Leap-15.2-PHP-Applications' is invalid.
Repository ‘openSUSE-Leap-15.2-PHP-Applications’ is invalid.

Just a short article to fix this issue for Leap 15.2. First you need to list your repo’s and remove the one labeled PHP-Applications, for my installs its been number 8. The following commands will show you how to find which one and remove it:

  • zypper lr
image 16
zypper lr and zypper rr 8
  • zypper rr 8

Now to add the new repo:

  • zypper addrepo https://download.opensuse.org/repositories/server:php:applications/openSUSE_Leap_15.2/server:php:applications.repo

You can now zypper ref and zypper up as needed, I hope this helps

Chris aka carpenox

How to – Setup a ViciDial Cluster

ViciDial Cluster

How to – Setup a ViciDial Cluster

This article is going to go over the steps I suggest to take in order to setup a ViciDial Cluster. I do things a little different when it comes to this to prepare for worst case scenario that a server may have problems and have to be taken offline, I install all services to each server, such as apache, mysql and asterisk this way if need be, they each can take on additional roles to cover for a server having to be taken out of production. Obviously this is going to assume you have ViciDial already installed on each server with all roles ready to go. To do so you can follow any one of my articles for scratch installs or you can just use an ISO to install of which I suggest using Vicibox v9.0.3 over V10 because of the issues with the V10 firewall and dynamic portal not working correctly, even if you do apply my fix, I find V9 to be more stable.

ViciDial Cluster
ViciDial Cluster

Step 1 – Install Vicidial on each server

As I said above, I suggest installing all services on each server and just leaving the ones not needed for each box, disabled until needed. So if you are using an ISO install instead of one of my scratch instructions, for the purpose on this article, lets say ViciBox v9.0.3. The first thing you need to do after loading v9 is to upgrade the operating system from Leap 15.1 to Leap 15.2 using these instructions, because Leap 15.1 is end of life(no more updates). After that use the command, vicibox-install and choose Y(yes) for the options shown in the picture below:

ViciBox Installer
vicibox-install

Repeat this process on each server and then move on to step 2.

Step 2 – Turn off services not needed on each server role

Now we need to disable services not needed on each server to save on resources, but this way they are there if they are needed in the future.

  • DB Server: systemctl disable apache2;systemctl disable asterisk
  • Web Server: systemctl disable mysql;systemctl disable asterisk
  • Asterisk Servers: systemctl disable mysql

We want to leave apache running on the asterisk servers so we can install webrtc for webphones

Step 3 – Run the install.pl script on each server

Now we want to link them all together by running the install.pl script located in the source directory for vicidial, follow the following commands to get to and run it:

cd /usr/src/astguiclient/trunk
perl install.pl

Now follow the prompt and answer them accordingly. The pictures below will show the choices needed for each server role except make sure you set the IP for the DB server on all the rest instead of localhost.

DB Server and Web Server

image 7
DB Server

For the web server make sure you put the DB server IP instead of localhost

Asterisk Servers

image 8
Only use 5 and 7 on ONE asterisk server, not all, the rest put 123468

Make sure you only put 5 and 7 keepalives on one asterisk server, the rest you should only choose 123468.

Step 4 – Add them to the GUI for ViciDial

Now we need to add them into the GUI for Vicidial by going to Admin then servers

image 9
Go to Servers in the Admin area

Once you are here, click “Add a new server”

Once you are here, click "Add a new server"
Once you are here, click “Add a new server”

Fill out the fields accordingly and click submit

image 12
Add a new server

Now for the DB and web server turn the options to N(no) where you see highlighted below:

image 13
Active server, Active Asterisk server and Active agent server set to N

Now reboot all servers and then check your reports page to make sure all servers are set to green like shown below

ViciDial Cluster
ViciDial Cluster

That’s all there is to it, not as hard as you thought it would be, right? If you have any questions feel free to join our live support on Skype:

image 14
Skype Channel

I hope this helps!

Chris aka carpenox

Table of Contents – Knowledge Base

CyburDial

I am carpenox from the Vicidial forums and I enjoy helping our community, of which I do free of charge, however my one on one time helping people out I do have to charge for my time in order to keep this going. If my articles have helped you out and you’re making money now because of my help, please think about donating to the cause so I can keep this blog going. Here is a link to donate through PayPal.

Check out all of our social media platforms -:- https://linktr.ee/CyburDial

Join us on Discord: https://discord.gg/jt8sNvJM

Table of Contents

10 Latest Posts

Information

HIPPA Compliance
HIPPA Compliance

Book time with carpenox now

ViciDial Scratch Install Instructions

Troubleshooting ViciDial

How To’s

Security

STAYING COMPLIANT

How to – fix the Python repo for Vicidial – Repository ‘openSUSE-Leap-15.2-Devel-Languages-Python’ is invalid.

Repository 'openSUSE-Leap-15.2-Devel-Languages-Python' is invalid.

How to fix the Python repo for Vicidial – Repository ‘openSUSE-Leap-15.2-Devel-Languages-Python’ is invalid.

So I know a lot of you have asked about the python repo issue with leap 15.2 after upgrading so here is a quick fix in relation to that.

Repository 'openSUSE-Leap-15.2-Devel-Languages-Python' is invalid
Repository ‘openSUSE-Leap-15.2-Devel-Languages-Python’ is invalid

Step 1 – Remove the bad repo

Its most likely going to be listed on the 1 slot as below but make sure by typing:

  • zypper lr
image 1
zypper lr

Remove it by typing zypper rr with the number, in this case 1

  • zypper rr 1

Step 2 – Add the new repo

zypper addrepo https://download.opensuse.org/repositories/devel:languages:python:Factory/openSUSE_Leap_15.2/devel:languages:python:Factory.repo
zypper refresh

That’s all there is to it, I hope this helps

Chris aka carpenox

How to – use one dynamic portal for whitelisting and have it sync across an entire cluster

Dynamic Portal

How to – use one dynamic portal for whitelisting and have it sync across an entire cluster

This article will go over a method I have recently come up with in order to have your agents sign in through one dynamic portal and have their IP validated across all servers in the cluster.

Step 1 – Generate a SSH key

In your linux cli simply type “ssh-keygen” and just press enter for all default values with no password as shown below

ssh-keygen
ssh-keygen

Step 2 – copy the ssh key to the other servers you need it synced to

ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.80.121 (replace IP with the servers Ip’s as you do each one)

Type yes and then enter the servers root password, do these steps for each server in your cluster

image 12
ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.80.121

Step 3 – rsync the Dynamic IP firewall list to the other servers

Replace the IP’s with each one in your cluster and repeat this step for each

  • Vicibox9 users use this command: /usr/bin/rsync -a -e “ssh” /tmp/VB-DYNAMIC-tmp root@192.168.80.121:/tmp/
  • Vicibox10 users use this one: /usr/bin/rsync -a -e “ssh” /tmp/dynamiclist-add-tmp root@192.168.80.121:/tmp/
image 13
/usr/bin/rsync -a -e “ssh” /tmp/dynamiclist-add-tmp root@192.168.80.121:/tmp/

Step 4 – Now add a cronjob to have this done every minute with one line for each server as shown below

  • ###Dynportal Sync
  • * * * * * /usr/bin/rsync -a -e “ssh” /tmp/dynamiclist-add-tmp root@192.168.80.120:/tmp/
  • * * * * * /usr/bin/rsync -a -e “ssh” /tmp/dynamiclist-add-tmp root@192.168.80.121:/tmp/
image 14

That’s all there is to it, now you can have your agents login through a single dynamic portal and sync it through to all servers in your cluster.

I hope this helps

Chris aka carpenox

How to – Scratch install Vicidial on RockyLinux 8.5

RockyLinux

How to – Scratch install Vicidial on RockyLinux 8.5

image
RockyLinux 8.5

This article goes over how to install vicidial on RockyLinux 8

sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config

Set Default Editor to nano:
yum -y install nano

nano /etc/bashrc

Then add this line at the bottom:
export EDITOR="nano"

timedatectl set-timezone America/New_York


rc.local not work:

chmod +x /etc/rc.d/rc.local
systemctl enable rc-local
systemctl start rc-local
systemctl status rc-local

yum check-update
yum -y install epel-release
reboot

yum update -y
reboot

yum groupinstall "Development Tools" -y

reboot

yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
yum -y install http://rpms.remirepo.net/enterprise/remi-release-8.rpm
yum -y install yum-utils
dnf module enable php:remi-7.4


sudo dnf install -y mariadb-server

sudo dnf -y install dnf-plugins-core
sudo dnf config-manager --set-enabled powertools


yum install -y php php-mcrypt php-cli php-gd php-curl php-mysql php-ldap php-zip php-fileinfo php-opcache wget unzip make patch gcc gcc-c++ subversion php php-devel php-gd gd-devel readline-devel php-mbstring php-mcrypt php-imap php-ldap php-mysql php-odbc php-pear php-xml php-xmlrpc curl curl-devel perl-libwww-perl ImageMagick libxml2 libxml2-devel httpd libpcap libpcap-devel libnet ncurses ncurses-devel screen kernel* mutt glibc.i686 certbot python3-certbot-apache mod_ssl openssl-devel newt-devel libxml2-devel kernel-devel sqlite-devel libuuid-devel sox sendmail lame-devel htop iftop perl-File-Which php-opcache libss7 mariadb-devel libss7* libopen* 

systemctl start mariadb
mysql_secure_installation
systemctl enable mariadb

systemctl stop mariadb
cp /etc/my.cnf /etc/my.cnf.original
echo "" > /etc/my.cnf

nano /etc/my.cnf ; copy the below config to this file.

####################################################################################################

[mysql.server]
user = mysql
#basedir = /var/lib

[client]
port = 3306 
socket = /var/lib/mysql/mysql.sock

[mysqld]
datadir = /var/lib/mysql
#tmpdir = /home/mysql_tmp
socket = /var/lib/mysql/mysql.sock
user = mysql
old_passwords = 0
ft_min_word_len = 3
max_connections = 800
max_allowed_packet = 32M
skip-external-locking
sql_mode="NO_ENGINE_SUBSTITUTION"

log-error = /var/log/mysqld/mysqld.log

query-cache-type = 1
query-cache-size = 32M

long_query_time = 1
#slow_query_log = 1
#slow_query_log_file = /var/log/mysqld/slow-queries.log

tmp_table_size = 128M
table_cache = 1024

join_buffer_size = 1M
key_buffer = 512M
sort_buffer_size = 6M
read_buffer_size = 4M
read_rnd_buffer_size = 16M
myisam_sort_buffer_size = 64M

max_tmp_tables = 64

thread_cache_size = 8
thread_concurrency = 8

# If using replication, uncomment log-bin below
#log-bin = mysql-bin

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash

[isamchk]
key_buffer = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

[mysqld_safe]
#log-error = /var/log/mysqld/mysqld.log
#pid-file = /var/run/mysqld/mysqld.pid
image 1

  • mkdir /var/log/mysqld
  • touch /var/log/mysqld/slow-queries.log
  • chown -R mysql:mysql /var/log/mysqld
  • systemctl restart mariadb
Install the Perl Modules
yum install -y perl-CPAN perl-YAML perl-libwww-perl perl-DBI perl-DBD-MySQL perl-GD perl-Env perl-Term-ReadLine-Gnu perl-SelfLoader perl-open.noarch

cpan -i Tk String::CRC Tk::TableMatrix Net::Address::IP::Local Term::ReadLine::Gnu Spreadsheet::Read Net::Address::IPv4::Local RPM::Specfile Spreadsheet::XLSX Spreadsheet::ReadSXC MD5 Digest::MD5 Digest::SHA1 Bundle::CPAN Pod::Usage Getopt::Long DBI DBD::mysql Net::Telnet Time::HiRes Net::Server Mail::Sendmail Unicode::Map Jcode Spreadsheet::WriteExcel OLE::Storage_Lite Proc::ProcessTable IO::Scalar Scalar::Util Spreadsheet::ParseExcel Archive::Zip Compress::Raw::Zlib Spreadsheet::XLSX Test::Tester Spreadsheet::ReadSXC Text::CSV Test::NoWarnings Text::CSV_PP File::Temp Text::CSV_XS Spreadsheet::Read LWP::UserAgent HTML::Entities HTML::Strip HTML::FormatText HTML::TreeBuilder Switch Time::Local Mail::POP3Client Mail::IMAPClient Mail::Message IO::Socket::SSL readline

cd /usr/bin/
curl -LOk http://xrl.us/cpanm
chmod +x cpanm


cpanm -f File::HomeDir
cpanm -f File::Which
cpanm CPAN::Meta::Requirements
cpanm -f CPAN
cpanm YAML
cpanm MD5
cpanm Digest::MD5
cpanm Digest::SHA1
cpanm readline


cpanm Bundle::CPAN
cpanm DBI
cpanm -f DBD::mysql
cpanm Net::Telnet
cpanm Time::HiRes
cpanm Net::Server
cpanm Switch
cpanm Mail::Sendmail
cpanm Unicode::Map
cpanm Jcode
cpanm Spreadsheet::WriteExcel
cpanm OLE::Storage_Lite
cpanm Proc::ProcessTable
cpanm IO::Scalar
cpanm Spreadsheet::ParseExcel
cpanm Curses
cpanm Getopt::Long
cpanm Net::Domain
cpanm Term::ReadKey
cpanm Term::ANSIColor
cpanm Spreadsheet::XLSX
cpanm Spreadsheet::Read
cpanm LWP::UserAgent
cpanm HTML::Entities
cpanm HTML::Strip
cpanm HTML::FormatText
cpanm HTML::TreeBuilder
cpanm Time::Local
cpanm MIME::Decoder
cpanm Mail::POP3Client
cpanm Mail::IMAPClient
cpanm Mail::Message
cpanm IO::Socket::SSL
cpanm MIME::Base64
cpanm MIME::QuotedPrint
cpanm Crypt::Eksblowfish::Bcrypt
cpanm Crypt::RC4
cpanm Text::CSV
cpanm Text::CSV_XS

cd /usr/src
wget http://download.vicidial.com/required-apps/asterisk-perl-0.08.tar.gz
tar xzf asterisk-perl-0.08.tar.gz
cd asterisk-perl-0.08
perl Makefile.PL
make all
make install 

dnf --enablerepo=powertools install libsrtp-devel -y
yum install -y elfutils-libelf-devel libedit-devel

cd /usr/src
wget http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz
tar -zxf lame-3.99.5.tar.gz
cd lame-3.99.5
./configure
make
make install

cd /usr/src/
wget https://digip.org/jansson/releases/jansson-2.13.tar.gz
tar xvzf jansson*
cd jansson-2.13
./configure
make clean
make
make install 
ldconfig

UPDATE: 6/22/21 - Ty @Ankit for catching the wrong directiory below 

cd /usr/src/
wget https://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gz
tar xzf dahdi*
cd /usr/src/dahdi-linux-complete-3.1.0+3.1.0/
nano /usr/src/dahdi-linux-complete-3.1.0+3.1.0/linux/include/dahdi/kernel.h
remove #include: </linux/pci-aspm.h>
make
make install
make install-config
(if you get an error here about 4.18.0-305.7.1.el8_4.x86_64 missing then do "yum install *4.18.0-305.7.1.el8_4.x86_64")

yum install dahdi-tools-libs

cd tools
make clean
make
make install
make install-config

if it gives an error /usr/sbin/dahdi_cfg -vvvvvvvvvvvvv 
edit the file "system.conf.sample" in "system.conf"


cd /usr/src/
wget http://downloads.asterisk.org/pub/telephony/libpri/libpri-1.6.0.tar.gz
tar xzf libpri-1.6.0.tar.gz
cd /usr/src/libpri-1.6.0
make clean
make
make install

nano  /etc/php.ini
error_reporting  =  E_ALL & ~E_NOTICE
memory_limit = 128M
short_open_tag = On
max_execution_time = 330
max_input_time = 360
post_max_size = 100M
upload_max_filesize = 42M
default_socket_timeout = 360
date.timezone = Europe/Rome

cd /usr/src/
wget http://download.vicidial.com/required-apps/asterisk-13.29.2-vici.tar.gz
tar xzf asterisk-13.29.2-vici.tar.gz
cd /usr/src/asterisk-13.29.2/
./configure --libdir=/usr/lib64 --with-pjproject-bundled -with-jansson-bundled
make clean
make menuselect    ; ####### select "app_meetme" "res_http_websocket" and "res_srtp"
make
make install
make samples
make config


mkdir /usr/src/astguiclient
cd /usr/src/astguiclient
svn checkout svn://svn.eflo.net:3690/agc_2-X/trunk


mysql
SET GLOBAL connect_timeout=60;
CREATE DATABASE `asterisk` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
CREATE USER 'cron'@'localhost' IDENTIFIED BY '1234';
GRANT SELECT,INSERT,UPDATE,DELETE,LOCK TABLES on asterisk.* TO cron@'%' IDENTIFIED BY '1234';
CREATE USER 'custom'@'localhost' IDENTIFIED BY 'custom1234';
GRANT SELECT,INSERT,UPDATE,DELETE,LOCK TABLES on asterisk.* TO custom@'%' IDENTIFIED BY 'custom1234';
GRANT SELECT,INSERT,UPDATE,DELETE,LOCK TABLES on asterisk.* TO cron@localhost IDENTIFIED BY '1234';
GRANT SELECT,INSERT,UPDATE,DELETE,LOCK TABLES on asterisk.* TO custom@localhost IDENTIFIED BY 'custom1234';
GRANT RELOAD ON *.* TO cron@'%';
GRANT RELOAD ON *.* TO cron@localhost;
GRANT RELOAD ON *.* TO custom@'%';
GRANT RELOAD ON *.* TO custom@localhost;
flush privileges;
use asterisk;
\. /usr/src/astguiclient/trunk/extras/MySQL_AST_CREATE_tables.sql
\. /usr/src/astguiclient/trunk/extras/first_server_install.sql
ALTER TABLE phones ALTER template_id SET DEFAULT '';
quit

cd /usr/src/astguiclient/trunk

perl install.pl


*Within the install.pl script make sure you Copy Asterisk Settings=Yes + Server webroot path=/var/www/html

/usr/share/astguiclient/ADMIN_area_code_populate.pl
/usr/share/astguiclient/ADMIN_update_server_ip.pl --old-server_ip=10.10.10.15
nano /etc/rc.local

### paste this below: 

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local

# OPTIONAL enable ip_relay(for same-machine trunking and blind monitoring)
/usr/share/astguiclient/ip_relay/relay_control start 2>/dev/null 1>&2

# Disable console blanking and powersaving
/usr/bin/setterm -blank
/usr/bin/setterm -powersave off
/usr/bin/setterm -powerdown

### start up the MySQL server
systemctl restart mariadb.service

### start up the apache web server
systemctl restart apache2

### roll the Asterisk logs upon reboot
/usr/share/astguiclient/ADMIN_restart_roll_logs.pl

### clear the server-related records from the database
/usr/share/astguiclient/AST_reset_mysql_vars.pl

### load dahdi drivers
modprobe dahdi
/usr/sbin/dahdi_cfg -vvvvvvvvvvvvv

### sleep for 20 seconds before launching Asterisk
sleep 20

### start up asterisk
/usr/share/astguiclient/start_asterisk_boot.pl

type "crontab -e"

### paste below:

### recording mixing/compressing/ftping scripts
#0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57 * * * * /usr/share/astguiclient/AST_CRON_audio_1_move_mix.pl
0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57 * * * * /usr/share/astguiclient/AST_CRON_audio_1_move_mix.pl --MIX
0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57 * * * * /usr/share/astguiclient/AST_CRON_audio_1_move_VDonly.pl
1,4,7,10,13,16,19,22,25,28,31,34,37,40,43,46,49,52,55,58 * * * * /usr/share/astguiclient/AST_CRON_audio_2_compress.pl --GSM
#2,5,8,11,14,17,20,23,26,29,32,35,38,41,44,47,50,53,56,59 * * * * /usr/share/astguiclient/AST_CRON_audio_3_ftp.pl --GSM

### keepalive script for astguiclient processes
* * * * * /usr/share/astguiclient/ADMIN_keepalive_ALL.pl --cu3way

### kill Hangup script for Asterisk updaters
* * * * * /usr/share/astguiclient/AST_manager_kill_hung_congested.pl

### updater for voicemail
* * * * * /usr/share/astguiclient/AST_vm_update.pl

### updater for conference validator
* * * * * /usr/share/astguiclient/AST_conf_update.pl

### flush queue DB table every hour for entries older than 1 hour
11 * * * * /usr/share/astguiclient/AST_flush_DBqueue.pl -q

### fix the vicidial_agent_log once every hour and the full day run at night
33 * * * * /usr/share/astguiclient/AST_cleanup_agent_log.pl
50 0 * * * /usr/share/astguiclient/AST_cleanup_agent_log.pl --last-24hours
## uncomment below if using QueueMetrics
#*/5 * * * * /usr/share/astguiclient/AST_cleanup_agent_log.pl --only-qm-live-call-check

## uncomment below if using Vtiger
#1 1 * * * /usr/share/astguiclient/Vtiger_optimize_all_tables.pl --quiet

### updater for VICIDIAL hopper
* * * * * /usr/share/astguiclient/AST_VDhopper.pl -q

### adjust the GMT offset for the leads in the vicidial_list table
1 1,7 * * * /usr/share/astguiclient/ADMIN_adjust_GMTnow_on_leads.pl --debug

### reset several temporary-info tables in the database
2 1 * * * /usr/share/astguiclient/AST_reset_mysql_vars.pl

### optimize the database tables within the asterisk database
3 1 * * * /usr/share/astguiclient/AST_DB_optimize.pl

## adjust time on the server with ntp
30 * * * * /usr/sbin/ntpdate -u pool.ntp.org 2>/dev/null 1>&2

### VICIDIAL agent time log weekly and daily summary report generation
2 0 * * 0 /usr/share/astguiclient/AST_agent_week.pl
22 0 * * * /usr/share/astguiclient/AST_agent_day.pl

### VICIDIAL campaign export scripts (OPTIONAL)
#32 0 * * * /usr/share/astguiclient/AST_VDsales_export.pl
#42 0 * * * /usr/share/astguiclient/AST_sourceID_summary_export.pl

### remove old recordings more than 7 days old
#24 0 * * * /usr/bin/find /var/spool/asterisk/monitorDONE -maxdepth 2 -type f -mtime +7 -print | xargs rm -f

### roll logs monthly on high-volume dialing systems
#30 1 1 * * /usr/share/astguiclient/ADMIN_archive_log_tables.pl

### remove old vicidial logs and asterisk logs more than 2 days old
28 0 * * * /usr/bin/find /var/log/astguiclient -maxdepth 1 -type f -mtime +2 -print | xargs rm -f
29 0 * * * /usr/bin/find /var/log/asterisk -maxdepth 3 -type f -mtime +2 -print | xargs rm -f
30 0 * * * /usr/bin/find / -maxdepth 1 -name "screenlog.0*" -mtime +4 -print | xargs rm -f

### cleanup of the scheduled callback records
25 0 * * * /usr/share/astguiclient/AST_DB_dead_cb_purge.pl --purge-non-cb -q

### GMT adjust script - uncomment to enable
#45 0 * * * /usr/share/astguiclient/ADMIN_adjust_GMTnow_on_leads.pl --list-settings

### Dialer Inventory Report
1 7 * * * /usr/share/astguiclient/AST_dialer_inventory_snapshot.pl -q --override-24hours

### inbound email parser
* * * * * /usr/share/astguiclient/AST_inbound_email_parser.pl
nano /etc/httpd/conf.d/record.conf

Alias /RECORDINGS/ "/var/spool/asterisk/monitorDONE/"

<Directory "/var/spool/asterisk/monitorDONE">
    Options Indexes MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
    Require all granted 
        <files *.mp3>
            Forcetype application/forcedownload
        </files>
</Directory>

for synchronization problems:

yourserverip/vicidial/admin.php

go to Admin-> Servers-> update Asterisk Version: 13.29.2-vici

Video Version from HBTutorials