Vicidial scratch installation in Centos7 Asterisk-13/16/18

Topic: Vicidial scratch installation

    A Step by step guide for vicidial scratch installation in centos 7 with asterisk-13 or asterisk-16 Asterisk18 version and vicidial latest SVN version. Vicidial scratch installation is the easiest and best way of installing vicidial in hosted servers where you don't have the option to install ISO image of vicibox.

    Vicidial Scratch installation can also be used for Vicidial Cluster setup, same steps will be used for other Linux Distributions like Rocky,alma,ubuntu etc.

Vicidail scratch installation in centos 7

Overview: vicidial

    Vicidial is the most popular Open-Source Contact Center Solution in the world, that incorporates a predictive dialer to enable the blended handling of inbound / outbound calls alongside inbound emails and customer website chat.

    VICIbox Server is the official installation CD for the VICIDIAL Call Center Suite. It is based off of OpenSuSE server. If you are looking for Vicidial in Centos or install vicidial in hosted server then this article is for you

For reference my youtube video is included in each steps.

Major Components of Vicidial

1. Asterisk - Telephony server

2.Mariadb - Database

3.Apache - Webserver

Vicidial Scratch - Pre-Requisites

Before proceeding with vicidial scratch installation steps , we must have below pre-requisites ready

Centos 7 installed either full DVD or minimal OS installation
Console access to the server or SSH access via putty .
Root access or other user with necessary permission
Internet access in the server to download softwares.
Basic knowledge of linux commands like vi or nano editor, copy ,paste.

Video Demonstration

Phase 1: Centos update, repository installation

In phase 1 ,we will be updating the os and update the kernel to latest version, then disable the selinux

--Copy paste the below commands--
yum check-update
yum update -y
yum -y install epel-release
yum -y groupinstall 'Development Tools'
yum -y update
yum install -y kernel*
Disable the SELINUX -Copy paste the below command

--Copy paste ---
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
Set your Timezone [replace with your timezone]

    --Copy paste ---

timedatectl set-timezone America/New_York
Reboot the server once
     --Copy paste ---
reboot
Updating YUM Repos
    --Copy paste ---
yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum -y install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum -y install yum-utils
yum-config-manager --enable remi-php74
Installing Yum Repo For MariaDB
    --Copy paste ---
vi /etc/yum.repos.d/MariaDB.repo
    --Copy paste ---
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.4/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
    Save And exit the file by Pressing Crtl+c and :wq Enter

Phase 2: Vicidial - Pre-Requisites installation

Vicidial Pre-requisites software Installation


    --Copy Paste Below command---
yum install make patch gcc perl-Term-ReadLine-Gnu gcc-c++ subversion php php-devel php-gd gd-devel php-mbstring php-mcrypt php-imap php-ldap php-mysql php-odbc php-pear php-xml php-xmlrpc php-opcache curl curl-devel perl-libwww-perl ImageMagick libxml2 libxml2-devel httpd libpcap libpcap-devel libnet ncurses ncurses-devel screen mysql-devel ntp mutt glibc.i686 wget nano unzip sipsak sox libss7* libopen* openssl libsrtp libsrtp-devel unixODBC unixODBC-devel libtool-ltdl libtool-ltdl-devel htop speex speex-devel iftop -y
    --Copy paste ---
yum -y install sqlite-devel
yum install mariadb-server mariadb -y
Mysql/MariaDB Custom my.cnf Settings
    --Copy paste below commands--
cp /etc/my.cnf /etc/my.cnf.original
echo "" > /etc/my.cnf
vi /etc/my.cnf
    [--copy paste below contents ---]
[mysql.server]
user = mysql
#basedir = /var/lib
[client]
port = 3306
socket = /var/lib/mysql/mysql.sock
[mysqld]
datadir = /var/lib/mysql
bind-address = 127.0.0.1
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
     Save And exit the file by Pressing Crtl+c and :wq Enter

Enabling Mysql Logging
    --Copy Paste below commands --
mkdir /var/log/mysqld
mv /var/log/mysqld.log /var/log/mysqld/mysqld.log
touch /var/log/mysqld/slow-queries.log
chown -R mysql:mysql /var/log/mysqld
Apache/Httpd Custom Settings
    --Copy paste below lines--
vi +217 /etc/httpd/conf/httpd.conf
--replace --
CustomLog logs/access_log combined
--with --
CustomLog /dev/null common
--goto Last line by typing ctrl+c and shift+g---
--copy paste the below content--
Alias /RECORDINGS "/var/spool/asterisk/monitorDONE/"
<Directory "/var/spool/asterisk/monitorDONE/">
Options Indexes MultiViews
AllowOverride None
Require all granted
</Directory>
      Save And exit the file by Pressing Crtl+c and :wq Enter

Php Custom php.ini Settings
    --Copy paster below command--
vi /etc/php.ini
    --search and edit below settings --
error_reporting = E_ALL & ~E_NOTICE
memory_limit = 48M
short_open_tag = On
max_execution_time = 330
max_input_time = 360
post_max_size = 48M
upload_max_filesize = 42M
default_socket_timeout = 360
date.timezone = America/New_York
--Note: Remove Preceedign colon(;) from date.timezone
--Save And exit the file by Pressing Crtl+c and :wq Enter

MariaDb/httpd service start and enable at startup
    --Copy paste ---
systemctl enable httpd.service
systemctl enable mariadb.service
systemctl start httpd.service
systemctl start mariadb.service

Phase 3 : Vicidial CPAN Modules installation 

   --Copy paste ---
yum install perl-CPAN -y
yum install perl-YAML -y
yum install perl-libwww-perl -y
yum install perl-DBI -y
yum install perl-DBD-MySQL -y
yum install perl-GD -y
    --Copy paste ---
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 --force
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
Make Sure all CPANS installed by rerunning all CPAN commands
Copy paste below commands ,make sure you see up to date installed
    --Copy paste ---

cpanm File::HomeDir
cpanm File::Which
cpanm CPAN::Meta::Requirements
cpanm CPAN
cpanm YAML
cpanm MD5
cpanm Digest::MD5
cpanm Digest::SHA1
cpanm readline
cpanm Bundle::CPAN
cpanm DBI
cpanm 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

Phase 4 : Vicidial Supporting Softwares

Asterisk Perl Installation
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
SIPSAK
cd /usr/src
wget http://download.vicidial.com/required-apps/sipsak-0.9.6-1.tar.gz
tar -zxf sipsak-0.9.6-1.tar.gz
cd sipsak-0.9.6
./configure
make
make install
/usr/local/bin/sipsak --version
LAME
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
JANSSON
cd /usr/src/
wget http://www.digip.org/jansson/releases/jansson-2.5.tar.gz
tar -zxf jansson-2.5.tar.gz
#tar xvzf jasson*
cd jansson*
./configure
make clean
make
make install
ldconfig

Phase 5 : Vicidial - Asterisk|DAHDI|Libpri Installation

Downloading asterisk,dahdi,libpri


    --copy paste--
mkdir /usr/src/asterisk
cd /usr/src/asterisk
wget http://download.vicidial.com/beta-apps/dahdi-linux-complete-2.11.1.tar.gz
wget http://downloads.asterisk.org/pub/telephony/libpri/libpri-1-current.tar.gz
wget http://download.vicidial.com/required-apps/asterisk-13.29.2-vici.tar.gz

For Asterisk 16 version download from below link

http://download.vicidial.com/required-apps/asterisk-16.30.1-vici.tar.gz

For Asterisk 18 version , download from below link

 http://download.vicidial.com/required-apps/asterisk-18.21.0-vici.tar.gz

Unzip/Untar the Downloaded Files
    --copy paste--
cd /usr/src/asterisk
tar -xvzf asterisk-*
tar -xvzf dahdi-linux-complete-*
tar -xvzf libpri-*
Installing DAHDI Software
    --copy paste--
yum install dahdi*
cd /usr/src/asterisk
cd dahdi-linux-complete-*
make all
make install
make config
modprobe dahdi
modprobe dahdi_dummy
dahdi_genconf -v
dahdi_cfg -v
Installing LibPri Software
    --copy paste--
cd /usr/src/asterisk
cd libpri*
make
make install
Installing Asterisk Software
    --copy paste--
cd /usr/src/asterisk/asterisk-*
./configure --libdir=/usr/lib64 --with-gsm=internal --enable-opus --enable-srtp --with-ssl --enable-asteriskssl --with-pjproject-bundled --with-jansson-bundled
make menuselect
--- select app_meetme under applications
---select res_http_websocket, res_srtp from Resources Modules
---- save exit. Press ESC and press shift S
make
make install
make samples

Phase 6 : Vicidial Download and Installation

Downloading the Latest Vicidial source code from SVN


    --copy paste--
mkdir /usr/src/astguiclient
cd /usr/src/astguiclient
svn checkout svn://svn.eflo.net/agc_2-X/trunk
cd /usr/src/astguiclient/trunk
Vicidail Mysql Configuration -Database, table, user Creation
    --copy paste--
mysql -p
--if no password set just press enter or use mysql -uroot -p --
--copy paste--

CREATE DATABASE asterisk DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
CREATE USER 'cron'@'localhost' IDENTIFIED BY '1234';
GRANT SELECT,CREATE,ALTER,INSERT,UPDATE,DELETE,LOCK TABLES on asterisk.* TO cron@'%' IDENTIFIED BY '1234';
GRANT SELECT,CREATE,ALTER,INSERT,UPDATE,DELETE,LOCK TABLES on asterisk.* TO cron@localhost IDENTIFIED BY '1234';
GRANT RELOAD ON *.* TO cron@'%';
GRANT RELOAD ON *.* TO cron@localhost;
CREATE USER 'custom'@'localhost' IDENTIFIED BY 'custom1234';
GRANT SELECT,CREATE,ALTER,INSERT,UPDATE,DELETE,LOCK TABLES on asterisk.* TO custom@'%' IDENTIFIED BY 'custom1234';
GRANT SELECT,CREATE,ALTER,INSERT,UPDATE,DELETE,LOCK TABLES on asterisk.* TO custom@localhost IDENTIFIED BY 'custom1234';
GRANT RELOAD ON *.* TO custom@'%';
GRANT RELOAD ON *.* TO custom@localhost;
flush privileges;
SET GLOBAL connect_timeout=60;
--copy paste--
use asterisk;
\. /usr/src/astguiclient/trunk/extras/MySQL_AST_CREATE_tables.sql
\. /usr/src/astguiclient/trunk/extras/first_server_install.sql
update servers set asterisk_version='13.29.2';
quit
Vicidial Source Code installation
    --copy paste--
cd /usr/src/astguiclient/trunk
perl install.pl
--Follow the onscreen instructions--
--for web type /var/www/html--
--for asterisk version type 13.X--
--type Y to copy sample configuration---
--below is my output for reference type your IP address--

\****
Would you like to use manual configuration and installation(y/n): [y]
astguiclient configuration file or press enter for default: [/etc/astguiclient.conf]
astguiclient home path or press enter for default: [/usr/share/astguiclient]
/usr/share/astguiclient does not exist, would you like me to create it?(y/n) [y]
stguiclient logs path or press enter for default: [/var/log/astguiclient]
/var/log/astguiclient does not exist, would you like me to create it?(y/n) [y]
asterisk agi-bin path or press enter for default: [/var/lib/asterisk/agi-bin]
----next option type 
/var/www/html
server webroot path or press enter for default: [/usr/local/apache2/htdocs] /var/www/html
asterisk sounds path or press enter for default: [/var/lib/asterisk/sounds]
asterisk monitor path or press enter for default: [/var/spool/asterisk/monitor]
asterisk DONEmonitor path or press enter for default: [/var/spool/asterisk/monitorDONE]
server IP address or press enter for default: [] 192.168.1.123
DB server address or press enter for default: [localhost]
DB database name or press enter for default: [asterisk]
DB user login or press enter for default: [cron]
DB user password or press enter for default: [1234]
DB custom user login or press enter for default: [custom]
DB custom password login or press enter for default: [custom1234]
DB connection port or press enter for default: [3306]
Enter active keepalives or press enter for default: [1234568]
--Enter asterisk version---
Enter asterisk version or press enter for default: [13.X]
--enter Y to copy sampel files--
Copy sample configuration files to /etc/asterisk/ ? [n] y
\********
---Press Enter for all other options--

Copy web language translation files to webroot ? []
FTP host address or press enter for default: [10.0.0.4]
FTP user login or press enter for default: [cron]
FTP user password or press enter for default: [test]
FTP connection port or press enter for default: [21]
FTP directory or press enter for default: [RECORDINGS]
HTTP path for archive or press enter for default: [http://10.0.0.4]
REPORT host address or press enter for default: [10.0.0.4]
REPORT user login or press enter for default: [cron]
REPORT user password or press enter for default: [test]
REPORT connection port or press enter for default: [21]
REPORT directory or press enter for default: [REPORTS]
FastAGI log minimum child servers: [3]
FastAGI log maximum child servers: [16]
FastAGI log minimum spare child servers: [2]
FastAGI log maximum spare child servers: [8]
FastAGI log maximum requests per child server: [1000]
FastAGI log check-for-dead seconds: [30]
FastAGI log check-for-wait seconds: [60]
\******

Vicidial Areacode and Changing Default IP
/usr/share/astguiclient/ADMIN_area_code_populate.pl
/usr/share/astguiclient/ADMIN_update_server_ip.pl --old-server_ip=10.10.10.15
\***
Old server IP address or press enter for default: [10.10.10.15]
server IP address or press enter for default: [] 192.168.1.123
old server_ip: 10.10.10.15
new server_ip: 192.168.1.123
Are these settings correct?(y/n): [y]
\***

Phase 7 : Vicidial Scratch Install - CRON/Startup Scripts

Cronjob entries
    --Copy paste the below command--

crontab -e
    --copy paste press i and ctrl+c then :wq---

### 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 --MP3 --HTTPS
#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
### 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>&amp;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
#24 0 * * * /usr/bin/find /var/spool/asterisk/monitorDONE -maxdepth 2 -type f -mtime +7 -print | xargs rm -f
#26 1 * * * /usr/bin/find /var/spool/asterisk/monitorDONE/MP3 -maxdepth 2 -type f -mtime +65 -print | xargs rm -f
#25 1 * * * /usr/bin/find /var/spool/asterisk/monitorDONE/FTP -maxdepth 2 -type f -mtime +1 -print | xargs rm -f
24 1 * * * /usr/bin/find /var/spool/asterisk/monitorDONE/ORIG -maxdepth 2 -type f -mtime +1 -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
### Daily Reboot
#30 6 * * * /sbin/reboot
    Save And exit the file by Pressing Crtl+c and :wq Enter

Startup Scripts for vicidial and asterisk to run on boot.
    --Copy paste --
vi /etc/rc.d/rc.local
    --copy paste below after last line --

# 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 start mariadb.service
### start up the apache web server
systemctl start httpd.service
### 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
modprobe dahdi_dummy
/usr/sbin/dahdi_cfg -vvvvvvvvvvvvv
### sleep for 20 seconds before launching Asterisk
sleep 20
### start up asterisk
/usr/share/astguiclient/start_asterisk_boot.pl
Enabling rc.local and run at startup
chmod +x /etc/rc.d/rc.local
systemctl enable rc-local
systemctl start rc-local
Asterisk Default Sound files -Download
cd /usr/src
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-core-sounds-en-ulaw-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-core-sounds-en-wav-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-core-sounds-en-gsm-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-extra-sounds-en-ulaw-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-extra-sounds-en-wav-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-extra-sounds-en-gsm-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-moh-opsound-gsm-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-moh-opsound-ulaw-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-moh-opsound-wav-current.tar.gz
Unzip to asterisk sound folder
cd /var/lib/asterisk/sounds
tar -zxf /usr/src/asterisk-core-sounds-en-gsm-current.tar.gz
tar -zxf /usr/src/asterisk-core-sounds-en-ulaw-current.tar.gz
tar -zxf /usr/src/asterisk-core-sounds-en-wav-current.tar.gz
tar -zxf /usr/src/asterisk-extra-sounds-en-gsm-current.tar.gz
tar -zxf /usr/src/asterisk-extra-sounds-en-ulaw-current.tar.gz
tar -zxf /usr/src/asterisk-extra-sounds-en-wav-current.tar.gz
mkdir /var/lib/asterisk/mohmp3
mkdir /var/lib/asterisk/quiet-mp3
ln -s /var/lib/asterisk/mohmp3 /var/lib/asterisk/default
cd /var/lib/asterisk/mohmp3
tar -zxf /usr/src/asterisk-moh-opsound-gsm-current.tar.gz
tar -zxf /usr/src/asterisk-moh-opsound-ulaw-current.tar.gz
tar -zxf /usr/src/asterisk-moh-opsound-wav-current.tar.gz
rm -f CHANGES*
rm -f LICENSE*
rm -f CREDITS*
cd /var/lib/asterisk/moh
rm -f CHANGES*
rm -f LICENSE*
rm -f CREDITS*
cd /var/lib/asterisk/sounds
rm -f CHANGES*
rm -f LICENSE*
rm -f CREDITS*
    --copy paste---
cd /var/lib/asterisk/quiet-mp3
sox ../mohmp3/macroform-cold_day.wav macroform-cold_day.wav vol 0.25
sox ../mohmp3/macroform-cold_day.gsm macroform-cold_day.gsm vol 0.25
sox -t ul -r 8000 -c 1 ../mohmp3/macroform-cold_day.ulaw -t ul macroform-cold_day.ulaw vol 0.25
sox ../mohmp3/macroform-robot_dity.wav macroform-robot_dity.wav vol 0.25
sox ../mohmp3/macroform-robot_dity.gsm macroform-robot_dity.gsm vol 0.25
sox -t ul -r 8000 -c 1 ../mohmp3/macroform-robot_dity.ulaw -t ul macroform-robot_dity.ulaw vol 0.25
sox ../mohmp3/macroform-the_simplicity.wav macroform-the_simplicity.wav vol 0.25
sox ../mohmp3/macroform-the_simplicity.gsm macroform-the_simplicity.gsm vol 0.25
sox -t ul -r 8000 -c 1 ../mohmp3/macroform-the_simplicity.ulaw -t ul macroform-the_simplicity.ulaw vol 0.25
sox ../mohmp3/reno_project-system.wav reno_project-system.wav vol 0.25
sox ../mohmp3/reno_project-system.gsm reno_project-system.gsm vol 0.25
sox -t ul -r 8000 -c 1 ../mohmp3/reno_project-system.ulaw -t ul reno_project-system.ulaw vol 0.25
sox ../mohmp3/manolo_camp-morning_coffee.wav manolo_camp-morning_coffee.wav vol 0.25
sox ../mohmp3/manolo_camp-morning_coffee.gsm manolo_camp-morning_coffee.gsm vol 0.25
sox -t ul -r 8000 -c 1 ../mohmp3/manolo_camp-morning_coffee.ulaw -t ul manolo_camp-morning_coffee.ulaw vol 0.25

Phase 8: vicidial Reboot and Check Screens

Reboot the servers once you have completed phase 7, once the booted up fully check the installation status. 

reboot

Check Screens running
screen -list
you should get below output
There are screens on:
2307.ASTVDauto (Detached)
2147.astshell20140626063212 (Detached)
2105.ASTVDadapt (Detached)
2304.ASTlisten (Detached)
2301.ASTsend (Detached)
2153.asterisk (Detached)
2109.ASTconf3way (Detached)
2107.ASTfastlog (Detached)
2310.ASTVDremote (Detached)
2298.ASTupdate (Detached)
10 Sockets in /var/run/screen/S-root.
Vicidial Login

Login to vicidial and configure it.
Add users, campaigns, in-group, DID's, server, etc....
Go to: http://youripaddress/vicidial/welcome.php
The default username is: 6666 and the password is: 1234

Redirecting to welcome screen

vi /var/www/html/index.html
copy paste below lines
<META HTTP-EQUIV=REFRESH CONTENT="1; URL=/vicidial/welcome.php">
Please Hold while I redirect you!
WELCOME

ctrl+c  and :wq


Check out my vicidial webphone configuration article for webphone setup in vicidial scratch install with lets-encrypt ssl 

Diagnostics

After reboot, check your logs for any errors, make sure asterisk is up and running.
Be proactive and look for problems before you start configuring vicidial.
Run these commands to view log files:
tail -f -n 50 /var/log/asterisk/messages
tail -f -n 50 /var/log/messages
more /var/log/dmesg
tail -f -n 40 /etc/httpd/logs/error_log
tail -f -n 40 /var/log/maillog
tail -f -n 40 /var/log/cron

Conclusion:

    Hope the article is helpful for you to install vicidial from scratch in centos 7, For best practice secure your vicidial servers, either hardening or using the vicidial dynamic portal  , for professional support reach me on skype or telegram:striker24x7

51 Comments
  • AnilKumar
    AnilKumar December 9, 2020 at 4:47 PM

    I am getting below error while i am checking dahdi

    systemctl status dahdi.service
    ● dahdi.service - LSB: DAHDI kernel modules
    Loaded: loaded (/etc/rc.d/init.d/dahdi; bad; vendor preset: disabled)
    Active: failed (Result: exit-code) since Wed 2020-12-09 16:44:32 IST; 2min 26s ago
    Docs: man:systemd-sysv-generator(8)
    Process: 16873 ExecStart=/etc/rc.d/init.d/dahdi start (code=exited, status=1/FAILURE)

    Dec 09 16:44:32 Paulossolutions dahdi[16873]: /usr/share/dahdi/waitfor_xpds:...d
    Dec 09 16:44:32 Paulossolutions dahdi[16873]: /sbin/dahdi_span_assignments: ...'
    Dec 09 16:44:32 Paulossolutions dahdi[16873]: Running dahdi_cfg: Notice: Co...f
    Dec 09 16:44:32 Paulossolutions dahdi[16873]: line 0: Unable to open configu...'
    Dec 09 16:44:32 Paulossolutions dahdi[16873]: 1 error(s) detected
    Dec 09 16:44:32 Paulossolutions dahdi[16873]: [FAILED]
    Dec 09 16:44:32 Paulossolutions systemd[1]: dahdi.service: control process e...1
    Dec 09 16:44:32 Paulossolutions systemd[1]: Failed to start LSB: …

    • Ajit Kumar
      Ajit Kumar December 9, 2020 at 7:14 PM

      what is the ooutput of dahdi_cfg -v and dahdi_genconf -v

    • AnilKumar
      AnilKumar December 11, 2020 at 12:47 AM

      Hello Sir, I was reinstalled dahdi drivers, now its working.

  • martin
    martin December 12, 2020 at 3:58 PM

    hi
    i have followed your script but the agent keeps being logged out after every few seconds. And the agent phone doesnt ring on log in. Any help will be appreciated

    • Ajit Kumar
      Ajit Kumar December 14, 2020 at 6:04 PM

      make sure ip updated properly in db, check serverip in servers, phones, conference

  • martin
    martin December 12, 2020 at 6:02 PM

    am also getting
    "There is a time synchronization problem with your system, please tell your system administrator" error

    • Ajit Kumar
      Ajit Kumar December 14, 2020 at 6:05 PM

      you might missing dahdi driver, check dahdi_cfg
      proper timezone settings

  • martin
    martin December 14, 2020 at 8:20 PM

    [root@localhost ~]# dahdi_cfg -v
    DAHDI Tools Version - 2.11.1
    Notice: Configuration file is /etc/dahdi/system.conf
    line 0: Unable to open master device '/dev/dahdi/ctl'

    1 error(s) detected

    You have new mail in /var/spool/mail/root
    [root@localhost ~]# dahdi_genconf -v
    Default parameters from /etc/dahdi/genconf_parameters
    Empty configuration -- no spans
    Generating /etc/dahdi/assigned-spans.conf
    /usr/sbin/dahdi_span_assignments: Missing '/sys/bus/dahdi_devices/devices' (DAHD I driver unloaded?)
    Command failed (status=256): 'dahdi_span_assignments dumpconfig > /etc/dahdi/ass igned-spans.conf' at /usr/local/share/perl5/Dahdi/Config/Gen/Assignedspans.pm li ne 40, line 2.

    • Ajit Kumar
      Ajit Kumar December 14, 2020 at 11:25 PM

      Dahdi driver is not installed properly
      reinstall dahdi follow the below link
      https://striker24x7.blogspot.com/2013/05/steps-to-reinstall-or-upgrade-dahdi.html

  • martin
    martin December 14, 2020 at 8:20 PM

    thats the output of dahdi_cfg

  • martin
    martin December 14, 2020 at 9:19 PM

    for some reason also the time is not syncing, yet the timezone is the same. The timezone in php.ini and the timezone of timedatectl.



    [root@localhost ~]# sudo ntpdate -u pool.ntp.org
    14 Dec 18:43:40 ntpdate[2799]: adjust time server 41.220.128.73 offset 0.017745 sec
    You have new mail in /var/spool/mail/root
    [root@localhost ~]# echo "SELECT server_ip, UNIX_TIMESTAMP(last_update),UNIX_TIMESTAMP(db_time) from server_updater" | mysql -uroot asterisk && php -r "date_default_timezone_set('Africa/Kampala'); echo 'php time: '.date('U');" && echo ""
    server_ip UNIX_TIMESTAMP(last_update) UNIX_TIMESTAMP(db_time)
    192.168.1.40 1607960447 1607960447
    php time: 1607960625

  • martin
    martin December 14, 2020 at 9:40 PM

    [root@localhost asterisk]# hostnamectl
    Static hostname: localhost.localdomain
    Icon name: computer-vm
    Chassis: vm
    Machine ID: f6f9077e950bc74cba1dc524bbe9762b
    Boot ID: 5a9061df51744960939a771d68daa5ad
    Virtualization: kvm
    Operating System: CentOS Linux 7 (Core)
    CPE OS Name: cpe:/o:centos:centos:7
    Kernel: Linux 3.10.0-1160.6.1.el7.x86_64
    Architecture: x86-64

  • martin
    martin December 29, 2020 at 6:20 PM

    Hi striker, what is the solution to this error of where extensions are created with a pipe.
    in the extensions-vicidial.conf.
    exten => 202,1,Dial(SIP/202|60|)

    • Ajit Kumar
      Ajit Kumar December 31, 2020 at 10:33 AM

      with PIPE is dialplan used in old asterisk,
      it willnot support in latest asterisk
      use comman 202,1,Dial(SIP/202,60)

  • martin
    martin December 29, 2020 at 7:33 PM

    And what does this mean "No one is in your session: 8600052" its keeps popping up on agent login

    • Ajit Kumar
      Ajit Kumar December 31, 2020 at 10:34 AM

      so many reason
      1. make sure ip got update in db to reflect in vicidial
      2. timezone sync for asterisk ,db and php
      3. check the confrerences number are created in vicidial or it might have wrong ip.

  • Anonymous
    Anonymous February 13, 2021 at 11:59 AM

    i am not able to see phones in asterisk after creating phones and reloading asterisk .Can you please help me with these issue

    • Ajit Kumar
      Ajit Kumar February 13, 2021 at 6:56 PM

      sometime it will take 3 minutes to update the conf file from db.
      run the /usr/share/astguiclient/ ADMIN_keepalive_ALL.pl
      and check aterisk cli after reload command

  • Unknown
    Unknown March 9, 2021 at 10:10 PM

    Hi, am experiencing a lag of 20secs before the call is connected to the agent.
    Inbound call in particular.
    Any solution to this issue?

    • Ajit Kumar
      Ajit Kumar March 10, 2021 at 8:08 AM

      is there any latency in your network, are the agent in same lan ? or in poor internet

    • Unknown
      Unknown March 11, 2021 at 12:15 PM

      The agents are on the same physical LAN with the server. its Local setup not on internet.

    • Ajit Kumar
      Ajit Kumar March 12, 2021 at 9:59 AM

      is the server overloaded
      post the cli log for inbound call

    • Unknown
      Unknown March 15, 2021 at 10:21 PM

      i solved the above by re-installing.
      But i now have a new issue. when the call ends , the status remains as you can see the screen cast below.

      https://www.screencast.com/users/mawererejafari/folders/Default/media/1e437d05-bc8e-4e76-b77b-4f727bbd1218

      https://www.screencast.com/users/mawererejafari/folders/Default/media/e86129a1-f49a-4890-b8ff-02b5fd7be1c1

  • Anonymous
    Anonymous April 3, 2021 at 6:37 PM

    Hi Striker,
    No solution to the above the issue?
    "Incoming call status remaining even when the call is ended"

  • Raj
    Raj May 5, 2021 at 4:16 AM

    Hi Striker,
    i am getting this error
    The requested URL /vicidial/welcome.php was not found on this server.

    please suggest
    Thanks

    • Ajit Kumar
      Ajit Kumar May 6, 2021 at 11:13 AM

      hi raj
      reach me on my skype , i can assist you
      skype striker24x7

    • Anonymous
      Anonymous June 9, 2024 at 11:26 PM

      I'm having the same problem The requested URL /vicidial/welcome.php was not found on this server.

    • Anonymous
      Anonymous June 10, 2024 at 12:06 AM

      I'm also getting the same error The requested URL /vicidial/welcome.php was not found on this server.

  • Raj
    Raj May 6, 2021 at 5:32 AM

    There is a time synchronization problem with your system, please tell your system administrator
    Admin please help me to solve it.

  • Anonymous
    Anonymous June 16, 2021 at 8:11 AM

    systemctl disable firewalld
    failed to execute operation no such file or directory

    help me

    • Ajit Kumar
      Ajit Kumar June 16, 2021 at 8:52 AM

      seems firwawall is not installed....
      check systemctl status firewall

  • albino
    albino July 29, 2021 at 4:03 PM

    [root@vicibox ~]# screen -ls
    There are screens on:
    1528.asterisk (Detached)
    1523.astshell20210729150417 (Detached)
    1444.ASTfastlog (Detached)
    1441.ASTVDadapt (Detached)
    4 Sockets in /var/run/screen/S-root.

    Hellooo - still missing some sockets - seem like dahdi driver is not installed correct - I folled your link to re-install the dahdi driver still showing not letting me install the driver - Please help

    • Ajit Kumar
      Ajit Kumar July 29, 2021 at 6:03 PM

      can u show output of dahdi_cfg -v
      also have u followed the post installtion steps mentioned in the video
      https://youtu.be/xrt9yNLg9cQ

  • Unknown
    Unknown August 14, 2021 at 1:22 PM

    no change when I update admin interface option
    please guide us!

  • Support servers
    Support servers September 28, 2021 at 2:24 PM

    How to Intstall chan meetme

    • Ajit Kumar
      Ajit Kumar September 28, 2021 at 8:31 PM

      while compiling asterisk(ie make menuselect) you need to select app_meetme

  • Unknown
    Unknown December 9, 2021 at 3:51 PM

    Got stuck at dahdi installation with below errors. Please suggest further steps to resolve this.
    [root@localhost dahdi-linux-complete-3.1.0+3.1.0]# make all
    make -C linux all
    make[1]: Entering directory `/usr/src/asterisk/dahdi-linux-complete-3.1.0+3.1.0/linux'
    make -C drivers/dahdi/firmware firmware-loaders
    make[2]: Entering directory `/usr/src/asterisk/dahdi-linux-complete-3.1.0+3.1.0/linux/drivers/dahdi/firmware'
    make[2]: Leaving directory `/usr/src/asterisk/dahdi-linux-complete-3.1.0+3.1.0/linux/drivers/dahdi/firmware'
    You do not appear to have the sources for the 3.10.0 kernel installed.
    make[1]: *** [modules] Error 1
    make[1]: Leaving directory `/usr/src/asterisk/dahdi-linux-complete-3.1.0+3.1.0/linux'
    make: *** [all] Error 2
    [root@localhost dahdi-linux-complete-3.1.0+3.1.0]# rpm -qa | grep kernel*
    kernel-tools-libs-3.10.0-1160.49.1.el7.x86_64
    kernel-tools-3.10.0-1160.49.1.el7.x86_64
    kernel-tools-libs-devel-3.10.0-1160.49.1.el7.x86_64
    kernel-headers-3.10.0-1160.49.1.el7.x86_64
    ke…

    • Ajit Kumar
      Ajit Kumar December 10, 2021 at 9:42 AM

      try to update your kernel
      yum update kernel*

  • Unknown
    Unknown December 10, 2021 at 11:49 AM

    Already tried but did not help.
    [root@localhost]# yum update kernel*
    Loaded plugins: fastestmirror, ovl
    Loading mirror speeds from cached hostfile
    epel/x86_64/metalink | 22 kB 00:00:00
    * base: ewr.edge.kernel.org
    * epel: mirrors.coreix.net
    * extras: mirror.vcu.edu
    * updates: mirror.atlanticmetro.net
    base | 3.6 kB 00:00:00
    epel | 4.7 kB 00:00:00
    extras | 2.9 kB 00:00:00
    updates …

    • Ajit Kumar
      Ajit Kumar December 13, 2021 at 9:47 AM

      check the below link
      https://striker24x7.blogspot.com/2012/07/dahdi-you-do-not-appear-to-have-sources.html
      try this ..

    • Anonymous
      Anonymous November 13, 2022 at 4:22 AM

      Hello Striker24x7! Is this updated? Can we use this guide to install the most recent version of Vcidial, including the latest asterisk version? I'm new to Vicidial and would like to get one for myself; could you help me? Most of the cloud servers don't allow us to install a custom ISO file, so I can't use the Vicibox 10. I want to know how to install from scratch, but with the latest update and everything. Thank you, and please help.

  • Anonymous
    Anonymous December 31, 2022 at 1:41 AM

    followed properly and it's now installed successfully on AWS EC2

  • Amit
    Amit January 2, 2023 at 7:12 PM

    chan_sip.c:4069 retrans_pkt: Retransmission timeout reached on transmission 2019979606-19840-4@BHC.DC.J.GA for seqno 31 (Critical Response) -- See https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions
    Packet timed out after 6400ms with no response
    [Jan 2 08:33:32] WARNING[1936]: chan_sip.c:4093 retrans_pkt: Hanging up call 2019979606-19840-4@BHC.DC.J.GA - no reply to our critical packet (see https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions).

  • Anonymous
    Anonymous January 2, 2023 at 7:13 PM

    chan_sip.c:4069 retrans_pkt: Retransmission timeout reached on transmission 2019979606-19840-4@BHC.DC.J.GA for seqno 31 (Critical Response) -- See https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions
    Packet timed out after 6400ms with no response
    [Jan 2 08:33:32] WARNING[1936]: chan_sip.c:4093 retrans_pkt: Hanging up call 2019979606-19840-4@BHC.DC.J.GA - no reply to our critical packet (see https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions).

  • Anonymous
    Anonymous March 27, 2023 at 6:06 AM

    Hi Good Day
    having issue here in my web shown text file of vicidial

  • Muhammad Taha Shafat
    Muhammad Taha Shafat January 19, 2024 at 3:00 AM

    Thank you. Everything went smoothly and managed to get a server up and running in one go.
    Working smoothly, very nicely written tutorial.

  • Annu
    Annu March 2, 2024 at 2:28 AM

    wget http://mirror.centos.org/centos/7/os/x86_64/Packages/jansson-devel-2.10-1.el7.x86_64.rpm
    rpm -i jansson-devel-2.10-1.el7.x86_64.rpm had to install this.

  • Annu
    Annu March 3, 2024 at 1:12 AM

    Write file to wget if you want asterisk 16 is https://download.vicidial.com/required-apps/asterisk-16.30.1-vici.tar.gz

  • Anonymous
    Anonymous March 23, 2024 at 2:46 AM

    nothing show in sip show peers

  • Anonymous
    Anonymous May 6, 2024 at 11:17 PM

    Hello. My calls are not being recorded and i have noticed in the log this error. No application 'Monitor' for extension....I tried to load module res_monitor and it failed. any help?

  • Anonymous
    Anonymous September 30, 2024 at 12:50 PM

    Can you publish Vicidial scratch install on Ubuntu latest version, since Centos 7 is now discontinued.

Add Comment
comment url