Vicidial Rocky
Vicidial Rocky
Vicidial Rocky
1.3 burn downloaded iso file into a USB flash using balena etcher
1.4 insert the USB flash into your server and turn it on. Go to BIOS or UEFI and select
boot from USB, once booted, go ahead with the installation
You will pop into installation screen which you need to choose your preferred language
Once you select your language hit continue, then you will get into configuring other
parts of installation
Click on installation source and select the hard disk you want to install the OS on
Here you can choose if you need to go with automatic or custom partitioning, choose
custom
Here select LVM and click on Rocky Linux 9.0* to expand
I would give 8GiB to my Swap, 1.5 GiB to my /boot, 500 MiB to /boot/efi and leave the
rest for root / And configure it as below
Once done, click on “Done”. Here you need to click on Preserve all and Reclaim space
Next set root password and click done
Optionally you can configure network to assign static IP address, by clicking on Network
and hostname, Then click on configure
Note : you can configure this later in the OS
Go to ipv4 Setting tab, change method to manual
Then go to address and and click add and write done your static ip. Netmask and
gateway and DNS server. Once done click on save
You can leave the rest of the configuration, as we will configure them in the next
chapter. Once done you should see something like this
If you see no errors, just click on begin installation, once done, reboot the server and
remove the USB flash.
Chapter 2: Server update and basic configuration
1.1 server update
Use the following command to update the server
# yum update -y
And under [remi] and [remi-test] change enabled=0 to enabled=1 [remi-test] [remi-test]
# Repository: https://rpms.remirepo.net/
# Blog: https://blog.remirepo.net/
# Forum: https://forum.remirepo.net/
[remi]
name=Remi's RPM repository for Enterprise Linux 9 - $basearch
#baseurl=http://rpms.remirepo.net/enterprise/9/remi/$basearch/
#mirrorlist=https://rpms.remirepo.net/enterprise/9/remi/$basearch/httpsmirror
mirrorlist=http://cdn.remirepo.net/enterprise/9/remi/$basearch/mirror
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi.el9
[remi-test]
name=Remi's test RPM repository for Enterprise Linux 9 - $basearch
#baseurl=http://rpms.remirepo.net/enterprise/9/test/$basearch/
#mirrorlist=https://rpms.remirepo.net/enterprise/9/test/$basearch/mirror
mirrorlist=http://cdn.remirepo.net/enterprise/9/test/$basearch/mirror
# WARNING: If you enable this repository, you must also enable "remi"
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi.el9
Host: can be any name, we will use this name to ssh to the server.
HostName: this is the server public ip address
Now use this command to upload the key to your server
Port: server ssh port which is 22 by default, but we will change it to something other
than 22 later in this tutorial for security reasons.
User: server username
Generate ssh key and config file and upload ssh-key to the server
In order to have easy access to the server. I recommend you to upload ssh-keys into
your server, so you don't have to input your password each time you connect to the
server.
Use the following command on your client (the computer you are using to connect to the
server)
# ssh-keygen
Here you will be asked to answer some question, just hit enter, and the result should be
like this:
Note: hostname is the name we specified in the SSH config file earlier
You will be asked to input your password, once you do it, the ssh key will be uploaded to
your server. Upon a successful upload you should see something like this:
1.3. Disable selinux
SELinux stops certain modules within Asterisk from running. This is why you always
need to disable SELinux before you start installing Asterisk
Execute the following command to disable selinux.
# sed -i 's/\(^SELINUX=\).*/\SELINUX=disabled/' /etc/selinux/config
Once you identify which time zone is accurate to your location, run the following
command:
# timedatectl set-timezone America/New_York
# timedatectl set-ntp on
# cd /usr/bin/
# curl -LOk http://xrl.us/cpanm
# chmod +x cpanm
# cpanm -f File::Which
# cpanm CPAN::Meta::Requirements
# cpanm -f CPAN
# cpanm MD5
# cpanm Bundle::CPAN
# cpanm Net::Telnet
# cpanm Unicode::Map
# cpanm Spreadsheet::WriteExcel
# cpanm OLE::Storage_Lite
# cpanm Proc::ProcessTable
# cpanm Spreadsheet::ParseExcel
# cpanm Curses
# cpanm Spreadsheet::XLSX
# cpanm Spreadsheet::Read
# cpanm LWP::UserAgent
# cpanm HTML::Strip
# cpanm HTML::FormatText
# 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
Now time to install apache, to install it on centos server, run this command
# yum install httpd httpd-devel -y
# rm -f /var/www/html/index.html
Once apache is installed, we need to make some changes, to apply changes open httpd
config file by
# vim /etc/httpd/conf/httpd.conf
Note: replace yy.yy.yy.yy with your public ip address and list of ips which are allowed to
access recordings on this server
4.6. install Mariadb
# yum install mariadb-server mariadb-devel -y
First it asks you to type it your current password, just hit enter as you don't have any
current password and answer questions as follow
Switch to unix_socket authentication [Y/n] y
Change the root password? [Y/n] Y
New password: type in your new root password
Re-enter new password: type in your new root password for the second time
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
And finally you should see this message.
[mysqldump]
quick
max_allowed_packet = 16M
default_character_set = utf8
[mysql]
no_auto_rehash
[isamchk]
key_buffer_size = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M
[myisamchk]
key_buffer_size = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive_timeout
!includedir /etc/my.cnf.d
Now lets restart mariadb and check the status
# wget https://github.com/major/MySQLTuner-perl/tarball/master
# tar xf master
# cd major-MySQLTuner-perl-993bc18/
# ./mysqltuner.pl
Chapter 5. install asterisk dahdi wanpipe libpri
Before installing, we need to create asterisk directory and cd to it by:
# mkdir /usr/src/asterisk
# cd /usr/src/asterisk
Upon a successful dahdi installation, you should see 0 errors like this
Once you run make menuselect command, you should see a configuration window, go
ahead and select the following :
Under Add-ons select chan_mobile chan_ooh323 and format_mp3 as shown below
Under application select app_meetme
2. On Core Sound Packages, select the formats of Audio packets like below
# make
# make install
# make samples
# make config
# ldconfig
# make install-logrotate (to enable log rotate script)
# cd /tmp/
# wget https://github.com/cisco/libsrtp/archive/refs/tags/v2.4.2.zip
# unzip v2.4.2.zip
# cd libsrtp-2.4.2/
# ./configure --prefix=/usr
# make shared_library
# make install
6.2. Create mysql database and its user, import vicidial sql
Login to mysql by
# mysql -p
Now put in your mysql password and create vicidial database and username by:
> CREATE DATABASE `asterisk` DEFAULT CHARACTER SET utf8 COLLATE
utf8_unicode_ci;
Enter the Asterisk version that you are installing VICIDIAL for
(value should be only one of the options below:)
1.2
1.4
1.8
11.X
13.X
16.X
Enter asterisk version or press enter for default: [13.X] 16.X
Note: don't forget you change your_server_ip with the public IP of your server.
Vicidial installation is done. Now reboot the serve
Chapter 7. - install and configure named
7.1. Assign public ip address
Note: this step is not needed if your server is already on a public network
To assign public ip address to your server in rocky 9, run
# nmtui
Click on Edit a connection and choose your NIC, and you will see this
Choose your NIC and hit enter, you will see this:Move to IPv4 section and click on
Automatic
Or restart network by
# systemctl restart NetworkManager
Once done connect to your server using your public IP
Now create two zones, one for domain and one for hostname
# vim /var/named/example.com.db
$TTL 600
@ 86400 IN
SOA ns1.confzy.com. bbb.confzy.com. (
2021010407 ; serial, todays date+todays
3600 ; refresh, seconds
7200 ; retry, seconds
1209600 ; expire, seconds
86400 ) ; minimum, seconds
@ 86400 IN NS ns1.confzy.com.
@ 86400 IN NS ns2.confzy.com.
@ IN A 194.9.80.250
localhost.bbb.confzy.com. IN A 127.0.0.1
@ IN MX 0 bbb.confzy.com.
bbb 600 IN CNAME bbb.confzy.com.
To finish the bind set up, there is more to do. Open this file
# vim /etc/named.conf
And insert these 2 lines
zone "example.com" {type master; file "/var/named/example.com.db";};
zone "host.example.com" {type master; file "/var/named/example.com.db";};
Note: you should replace example.com with your own FQDN and your_server_ip with
your server public ip address.
Now start and enable the bind9 service by
Upon the last command you should named service is active and running.
Test DNS
To make sure your domain now resolves to your server ip. Run this command
# nslookup example.com
DocumentRoot /var/www/html
ErrorLog /var/www/html/logs/error.log
CustomLog /var/www/html/logs/access.log combined
</VirtualHost>
Now restart and enable apache to apply changes using these commands:
# systemctl restart httpd
# systemctl status httpd
After successful installation, try to install ssl on your domain suing this
# certbot --apache --noninteractive --agree-tos -d example.com -m
youremail@example.com
Note: replace example.com with your own domain and youremail@example.com with
your own email address.
Upon a successful ssl certificate creation, you should see something like this:
## ssl renew
45 3 * * 6 /usr/local/letsencrypt/certbot-auto renew && systemctl reload httpd
### 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
### 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
--list-settings
### 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, and delete originals after 1 day
#24 0 * * * /usr/bin/find /var/spool/asterisk/monitorDONE -maxdepth 2 -type f -mtime
+7 -print | xargs rm -f
24 1 * * * /usr/bin/find /var/spool/asterisk/monitorDONE/ORIG -maxdepth 2 -type f
-mtime +1 -print | xargs rm -f
### daily backup database and web folder and upload to FTP server
1 2 * * * /usr/share/astguiclient/ADMIN_backup.pl --db-without-logs --without-conf
--ftp-transfer 2>/dev/null 1>&2
### Update agent records with the IP of the phone they are logging in on
#*/5 * * * * /usr/share/astguiclient/AST_phone_update.pl --agent-lookup
### roll call_log and vicidial_log_extended daily on very high-volume dialing systems
#20 1 * * * /usr/share/astguiclient/ADMIN_archive_log_tables.pl --daily
touch /var/lock/subsys/local
8.3. Enable rc.local service at startup
In order to enable this, you need to make some changes in rc.local service
# rm -rf /lib/systemd/system/rc-local.service
# vim /lib/systemd/system/rc-local.service
[Service]
Type=forking
ExecStart=/etc/rc.d/rc.local start
TimeoutSec=0
StandardOutput=tty
RemainAfterExit=yes
SysVStartPriority=99
[Install]
WantedBy=multi-user.target
starting firewalld, will close all access to the server, so we need to open ports which are
used by ssh, asterisk, http, named and some other services. Execute this commands to
open needed ports and services.
In firewalld you can open a service by both its port and service name.
# firewall-cmd --zone=public --add-port=”ssh port”/tcp --permanent
# firewall-cmd --zone=public --add-port=10000-20000/udp --permanent
# firewall-cmd --zone=public --add-port=10000-20000/tcp --permanent
# firewall-cmd --zone=public --add-port={5060,53,123}/udp --permanent
# firewall-cmd –zone=public
--add-port={5443,5269,5280,5222,5061,8089,8088,5038,443,80,53}/tcp --permanent
Note: please replace “ssh port” with your own ssh port
Now restart firewalld to apply changes and check its status
# Keys
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
AuthorizedKeysFile .ssh/authorized_keys
# GSSAPI options
GSSAPIAuthentication yes
GSSAPICleanupCredentials no
# Logging
SyslogFacility AUTHPRIV
LogLevel INFO
# Authentication:
PermitRootLogin without-password
MaxAuthTries 2
MaxSessions 2
PermitEmptyPasswords no
PasswordAuthentication no
ChallengeResponseAuthentication no
PermitTunnel no
#Forwarding
X11Forwarding no
AllowAgentForwarding no
AllowTcpForwarding no
UsePAM yes
PrintMotd no
Include /etc/crypto-policies/back-ends/opensshserver.config
Include /etc/ssh/sshd_config.d/*.conf
And finally run to restart sshd service and make sure its up and running
# systemctl restart sshd
# systemctl status sshd
[sshd]
enabled = true
port =22, “your_ssh_port”
filter = sshd
logpath = /var/log/auth.log
findtime = 960
maxretry = 4
bantime = 86400
[asterisk]
enabled = true
port = 8089,8088,5060,5061
filter = asterisk
#action = %(banaction)s[name=%(__name__)s-tcp, port="%(port)s", protocol="tcp",
chain="%(chain)s", actname=%(banaction)s-tcp]
# %(banaction)s[name=%(__name__)s-udp, port="%(port)s", protocol="udp",
chain="%(chain)s", actname=%(banaction)s-udp]
# %(mta)s-whois[name=%(__name__)s, dest="%(destemail)s"]
action = %(action_)s
logpath = /var/log/asterisk/messages
findtime = 10800
maxretry = 3
bantime = 604800
Note: please replace Your_ssh_port with the ssh port you have defined for your ssh
server and in ignoreip= write down list of ips that you never want your server to ban
# touch /var/log/asterisk/messages
# ss
# systemctl enable fail2ban
# systemctl status fail2ban
Open /etc/sysctl.conf by
# vim /etc/sysctl.conf
And insert this at the end of file, use sysctl -p to apply changes ands
Now user sysctl -p to apply changes
# sysctl -p
# reboot
Once the server is up. Use screen -ls command and you should see a 9 to 11 sockets.
# screen -ls
Chapter 10. - Vicidial Basic configuration
Before you continue change the vicidial ip to the public ip by
To change vicidial ip run the following command
/usr/share/astguiclient/ADMIN_update_server_ip.pl --old-server_ip=10.10.10.15
To create a campaign, on the left menu, click on campaigns, Add a new campaign
Give it a name, description, choose the user group you just created and select the
campaign time.and hit submit
Chapter 11. - webrtc
11.1. Enable webrtc
Lets change the cron password in manager.conf
# vim /etc/asterisk/manager.conf
Look for secret=1234 in this file and change it the cron user password, you created
earlier
[cron]
secret = your_cron_password
read = system,call,log,verbose,command,agent,user,originate
write = system,call,log,verbose,command,agent,user,originate
[updatecron]
secret = your_cron_password
read = command,reporting
write = command,reporting
eventfilter=Event: CoreShowChannel
[listencron]
secret = your_cron_password
read = system,call,log,verbose,command,agent,user,dtmf
write = command
……
[sendcron]
secret = your_cron_password
read = command
write = system,call,log,verbose,command,agent,user,originate
[sipcron]
secret = your_cron_password
read = call
write = command
To enable asterisk webrtc cd to asterisk directory and Then backup http.conf and create
a new one by
# mv /etc/asterisk/http.conf /etc/asterisk/http.conf.bak
# vim /etc/asterisk/http.conf
# mkdir /etc/asterisk/keys
# cp /etc/letsencrypt/live/example.com/* /etc/asterisk/keys/
# chmod 600 /etc/asterisk/keys/*
Note: don't forget to replace example.com with your domain name.
[global]
type = global
contact_expiration_check_interval = 30
debug = no
default_from_user = Asterisk
default_outbound_endpoint = default_outbound_endpoint
default_realm = Asterisk
default_voicemail_extension = 8500
disable_multi_domain = false
endpoint_identifier_order = ip,username,anonymous
ignore_uri_user_options = false
keep_alive_interval = 90
max_forwards = 70
max_initial_qualify_time =0
mwi_disable_initial_unsolicited = false
mwi_tps_queue_high = 500
mwi_tps_queue_low = -1
norefersub = yes
;regcontext = myregs
send_contact_status_on_update_registration = yes
taskprocessor_overload_trigger = global
unidentified_request_count =5
unidentified_request_period =5
unidentified_request_prune_interval = 30
use_callerid_contact = no
user_agent = Asterisk
[transport-udp]
type = transport
protocol = udp
bind = 0.0.0.0:5061
;external_media_address =
;external_signaling_address =
local_net = Your_server_ip
;local_net = 10.0.0.0/255.0.0.0
;local_net = 172.16.0.0/12
;local_net = 169.254.0.0/255.255.0.0
;tos = cs3
[transport-wss]
type = transport
protocol = wss
bind = 0.0.0.0:8089
;external_media_address = Your_server_ip
;external_signaling_address = Your_server_ip
local_net = Your_server_ip
allow_reload = yes
#include pjsip-vicidial.conf
#include pjsip_wizard-vicidial.conf
Note: Don't forget to change your_server_ip with the ip address of your server.
aor/max_contacts = 1
aor/maximum_expiration = 3600
aor/minimum_expiration = 60
aor/default_expiration = 120
aor/qualify_frequency = 15
endpoint/context=default
endpoint/disallow=all
endpoint/allow=ulaw
endpoint/allow=alaw
endpoint/allow=vp8
endpoint/allow=vp9
endpoint/dtmf_mode = rfc4733
endpoint/trust_id_inbound = no
endpoint/send_rpid = yes
endpoint/inband_progress = no
endpoint/tos_audio = ef
endpoint/language = en
endpoint/rtp_symmetric = yes
endpoint/rewrite_contact = yes
endpoint/rtp_timeout = 60
endpoint/use_ptime = yes
endpoint/moh_suggest = default
endpoint/direct_media = no
endpoint/transport=transport-wss
endpoint/webrtc=yes
Now login to your vicidial GUI and head to Admin > System Settings , then move to
Webphone URL , and set it to CyburPhone/cyburphone.php and hit submit.
Now login to your vicidial GUI and head to Admin > Servers, , then move to Web Socket
URL , and set it to wss://example.com:8089/ws and hit submit.
Disable some asterisk warnings (this is in case you get some warnings in asterisk
status)
Use the following commands to disable asterisk warnings
#s
# sed -i 's";radiuscfg => /usr/local/etc/radiusclient-ng/radiusclient.conf"radiuscfg =>
/etc/radcli/radiusclient.conf"g' /etc/asterisk/cdr.conf
# sed -i 's";radiuscfg => /usr/local/etc/radiusclient-ng/radiusclient.conf"radiuscfg =>
/etc/radcli/radiusclient.conf"g' /etc/asterisk/cel.conf