Hosted Vicidial server starts from $39 Contact Us Buy Now!

Vicidial Scratch install with webrtc Letsencrypt noip Centos 7

Estimated read time: 16 min

| TOPIC: Vicidial Scratch install with webrtc,noip,letsencrypt in Centos 7


vicidial scratch webrtc

| Overview
How to install vicidial with webrtc support and dynamicDNS
This article all about step by step guide to do vicidial scratch install in centos 7 with webrtc(Viciphone) support, noip free domain  and letsencrypt free ssl certificates.

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.

VICIphone is an Open Source Project. VICIphone was built with WebRTC Technology. WebRTC provides browsers and mobile applications with Real-Time Communications (RTC) capabilities. This enables your users to use VICIphone without having to install or configure anything. Asterisk 13 and later can handle WebRTC connections

| Pre-Requisites

Before proceeding with 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.


 Step 1: OS update & Disabling selinux
yum check-update
yum update -y
yum -y install epel-release
yum groupinstall 'Development Tools'
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
reboot
 Step 2: Dependencies & Database installation
yum install ImageMagick curl curl-devel doxygen gcc gcc-c++ gd-devel git glibc.i686 gnutls-devel gsm-devel httpd jansson-devel kernel* kernel-devel libnet libopen* libpcap libpcap-devel libsrtp-devel libsrtp* libss7* libuuid-devel libxml2 libxml2-devel make mod_ssl mutt mysql-devel nano ncurses ncurses-devel neon-devel net-snmp-devel ntp opus* opus-devel patch perl-libwww-perl php php-devel php-gd php-imap php-ldap php-mbstring php-mcrypt php-mysql php-odbc php-pear php-xml php-xmlrpc screen sipsak sox speex-devel sqlite sqlite-devel subversion texinfo unzip uuid-devel wget
yum install mariadb-server mariadb -y
Step 3: Mariadb Custom settings
cp /etc/my.cnf /etc/my.cnf.original
echo "" > /etc/my.cnf
vi /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

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
 Step 4: Http and mariadb Services enable and start at during boot
systemctl enable httpd.service
systemctl enable mariadb.service
systemctl start httpd.service
systemctl start mariadb.service
| Step 5: Setting right Timezone 
make sure to copy your exact timezone of your country
cp /usr/share/zoneinfo/Asia/Kolkata /etc/localtime
press y to overwrite.
| Step 6: CPAN modules installation
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
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
| Step 6.1: Rerun CPAN to make sure it installed

I would like to rerun the cpan modules again to make all the modules are installed, if you find any modules not installed try to run with cpanm -f module name to force install that particular module.
You should get module upto date and installed.
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
| Step 7 : Additional dependencies software installation

| Step 7.1 : Asterisk Perl
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
| Step 7.2 : 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
| Step 7.3 : 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
| Step 7.3 : Jasson
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
| Step 7.4 : Eaccelerator
cd /usr/src
wget https://github.com/eaccelerator/eaccelerator/zipball/master -O eaccelerator.zip
unzip eaccelerator.zip
cd eaccelerator-*
export PHP_PREFIX="/usr"
$PHP_PREFIX/bin/phpize
./configure --enable-eaccelerator=shared --with-php-config=$PHP_PREFIX/bin/php-config
make
make install
| Step 8 : PHP fine tunning

use your favorite editor to edit the file php.ini
search and replace the below entries in php.ini file
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 = Asia/Kolkata
; note remove ";" from date.timezone to enable it
Now edit the same file php.ini , search for word Dynamic
and copy paste the below entry below the lien ;Dynamic Extensions
;Dynamic Extensions
zend_extension="/usr/lib64/php/modules/eaccelerator.so"
eaccelerator.shm_size="48"
eaccelerator.cache_dir="/tmp/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"
Check the eaccelerator enabled in php
mkdir /tmp/eaccelerator
chmod 0777 /tmp/eaccelerator
php -v
| Step 9 : http conf file fine tune and enabling vicidial recording link
vi /etc/httpd/conf/httpd.conf
To disable logging, change:
CustomLog logs/access_log combined
to this:
CustomLog /dev/null common
Go to the last line and copy paste below entries
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>
| Step 10 : Asterisk,Dahdi,Libpri Installation

Asterisk is Opensource Communication/pbX software, vicidail utilizes the asterisk for the communication purpose.

| Step 10.1 : Downloading asterisk,dahdi,libpri
mkdir /usr/src/asterisk
cd /usr/src/asterisk
wget http://downloads.asterisk.org/pub/telephony/libpri/libpri-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gz
wget http://download.vicidial.com/required-apps/asterisk-13.29.2-vici.tar.gz
| Step 10.2 : unzip the Files
tar -xvzf asterisk-*
tar -xvzf dahdi-linux-complete-*
tar -xvzf libpri-*
| Step 10.3 : DAHDI installation
cd /usr/src/asterisk/dahdi-linux-complete-*
make all
make install
make install-config
dahdi_genconf -v
dahdi_cfg -v
| Step 10.4 : LIBPRI installation
cd /usr/src/asterisk/libpri-*
make clean
make
make install
| Step 10.5 : Asterisk Installation with WEBRTC support
cd /usr/src/asterisk/asterisk*
./contrib/scripts/install_prereq install && ./bootstrap.sh
./configure --libdir=/usr/lib64 --with-gsm=internal --with-opus=/usr/lib64/ --with-speex=/usr/lib64/ --with-srtp=/usr/lib64/ --with-ogg=/usr/lib64/ --with-ssl --enable-asteriskssl --with-pjproject-bundled --with-sqlite3=/usr/lib64/ --with-jansson-bundled
make menuselect <MAKE SURE APP_MEETME IS SELECTED IN APPLICATIONS!!!!!!!!!!!!!!!!!!!!!!!!!!>
make
make install
make samples
Note: in menuselect select app_meetme as show below

vicidial asterisk application

vicidial asterisk app_meetme


| Step 11 : Vicidial Download ,install 

| Step 11.1: Vicidial download from SVN
mkdir /usr/src/astguiclient
cd /usr/src/astguiclient
svn checkout svn://svn.eflo.net/agc_2-X/trunk
cd /usr/src/astguiclient/trunk
| Step 11.2: Creating database and Tables for vicidial  
mysql -p
<if you set a password enter it
<or leave it blank and press enter>

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,ALTER,CREATE 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,ALTER,CREATE 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
quit
| Step 11.3: Vicidial installation
cd /usr/src/astguiclient/
cd trunk
perl install.pl

just press enter for defaults ,until server webroot path
note: for web directory enter /var/www/html as show below
also enter the asterisk version and type Y to copy configurations
refer below pictures
vicidial webroot

vicidial install step

| Step 11.4: updating Phone codes, and Default IP in database
/usr/share/astguiclient/ADMIN_area_code_populate.pl
/usr/share/astguiclient/ADMIN_update_server_ip.pl --old-server_ip=10.10.10.15
;;note enter your server ip when it prompts new serverip as show below
vicidial install

| Step 12 :  Cronjob entries

type crontab -e  command to enter the crontab
and copy paste the below entries
#copy paste the below entries

### 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
#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>&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 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
| Step 13 :  Startup script entry

vi /etc/rc.d/rc.local
copy paste below entry after the 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
| Step 13.1 :  Enable the rc.local to run on startup
chmod +x /etc/rc.d/rc.local
systemctl enable rc-local
systemctl start rc-local
| Step 14 : Reboot to update the configurations
reboot
| Step 15 : Post installation configuration

  • access your dialer via browser http://serverip/vicidial/admin.php
  • login with username 6666 and password 1234
  • The initial setup will force to change password, Timezone,GTM offset
  • once done logout
  • relogin with 6666 and new password.
  1. modify the user 6666 and set 1 for all the admin interface options
  2. Modify the ADMIN>SERVERS>Asterisk Version : 13.X
  3. ADMIN>SERVERS>Local GMT: select to GMT
  4. press submit two times, to rebuild conf files.
  5. Modify-ADMIN>SYSTEMSETTINGS>ActiveVoicemailServer: serverip
  6. ADMIN>SYSTEM SETTINGS> Default Local GMT: select to GMT
| Step 16 : Final installation confirmation

run screen -list  to make sure all the background vicidial scripts are running
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.
| Step 17 : WEBRTC Configuration

For the webrtc support in vicidial ,you must meet below pre-requisites
  • asterisk 13 and above version 
  • vicidial server should be accessed via FQDN (domain name)
  • Vicidial server should be accessed via SSL ie: https://domain/
  • Trusted SSL certifcate and key from vendor like letencrypt,norton etc.
note: if you are one like me to use all free, i use  no-ip for a free domain and letsencrypt for free ssl certificates.

Refer this link if you want to use with self signed certificate.

Follow the below steps to configure webrtc with no-ip domain, Letencrypt SSL certificate and Viciphone webrtc webphone.

| Step 18 :  Create a Free Domain from no-ip

NoIP: No-IP which is a dynamic DNS provider for paid and free services.
NoIP offering free dynamic DNS and URL redirection. Users were able to create a free sub-domain under a few domains owned by No-IP

If you have your own domain ,you can skip this step.
  • goto https://www.noip.com?fpr=drshy
  • Signup a new account
  • Create your own domain from there existing top level domain
  • for eg: striker24x7.ddns.net

noip domain

  • Next Modify your domain and enter your server public ip
noip

  • Now you have your own domain and pointed to your server
  • Try to access your server via domain http://xyz.ddns.net/

| Step 19 :  Free SSL Certificate from Letsencrypt

LetsEncrypt is a Certificate Authority (CA) that provides free certificates for Transport Layer Security (TLS) encryption, thereby enabling encrypted HTTPS on web servers. It simplifies the process of creation, validation, signing, installation, and renewal of certificates by providing a software client that automates most of the steps—Certbot.

To generate the letsencrypt SSL certificate follow below steps.

| Step 19.1 :  Install Certbot and Dependicies
yum install certbot python2-certbot-apache mod_ssl
| Step 19.2 :  certbot command to generate SSL certificate
certbot certonly --w /var/www/html -d striker24x7.ddns.net --register-unsafely-without-email

<note: replace striker24x7.ddns.net with your domain>
<enter 3 for webroot location.
How would you like to authenticate with the ACME CA?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: Apache Web Server plugin (apache)
2: Spin up a temporary webserver (standalone)
3: Place files in webroot directory (webroot)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-3] then [enter] (press 'c' to cancel): 3
  • Once the process is sucessfull ,you will get the sucessful message and the certificates and key will be save in below mentioned folder
  • note: enter you domain after /live folder
cd /etc/letsencrypt/live/striker24x7.ddns.net/
ls
cert.pem chain.pem fullchain.pem privkey.pem README
| Step 20 : update ssl certificate in ssl.conf

You need to point your new ssl certificate and key path in the ssl.conf so that your server will be accessed via new Letsencrypt  certificates.
edit vi /etc/httd/conf.d/ssl.conf
search the below lines and update with your certificate as show below
SSLCertificateFile
SSLCertificateKeyFile
SSLCertificateChainFile 
SSLCertificateFile /etc/letsencrypt/live/striker24x7.ddns.net/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/striker24x7.ddns.net/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/striker24x7.ddns.net/fullchain.pem

restart httpd service to update the changes
systemctl restart httpd
| Step 21 : Check your SSL 

check your ssl using the website https://www.sslshopper.com/ssl-checker.html

Also access you dialer in  a browser and make sure it is accessible via https and without any ssl error.
if Yes you are good to go next steps.

| Step 22 : Redirect All HTTP request to HTTPS request

we need to force the dialer access only via https , in order to avoid agents login to dialer via http which leads to failure of webrtc support.
edit httpd.conf
vi /etc/httpd/conf/httpd.conf
add the below entry after the last line
replace striker24x7.ddns.net with your domain.
<VirtualHost *:80>
ServerName striker24x7.ddns.net
DocumentRoot /var/www/html
ErrorLog /var/www/error.log
CustomLog /var/www/requests.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =striker24x7.ddns.net
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

restart the httpd service
systemctl restart httpd
Now access your dialer with http://domain/  it should auto redirect to https://domain.


| Step 23 : updating Vicidial Recordings link with https

By default the vicidial recordings links are update with http extension in DB,
in order to update the recording link to https extension you need edit your cronjob which you done in step 12 .
just add --HTTPS label in  AST_CRON_audio_2_compress.pl followed my --MP3 as shown below
/usr/share/astguiclient/AST_CRON_audio_2_compress.pl --MP3 --HTTPS
| Step 24 : Asterisk Settings to enable webrtc

in order to asterisk support webrtc you need to edit below files
1. /etc/asterisk/http.conf
2. /etc/asterisk/modules.conf
3. /etc/asterisk/rtp.conf
4./etc/asterisk/sip.conf

vi /etc/asterisk/http.conf
and or enable below settings
enabled=yes
bindaddr=0.0.0.0
bindport=8088
tlsenable=yes
tlsbindaddr=0.0.0.0:8089
tlscertfile=/etc/letsencrypt/live/striker24x7.ddns.net/cert.pem
tlsprivatekey=/etc/letsencrypt/live/striker24x7.ddns.net/privkey.pem
NOTE: replace striker24x7.ddns.net with your domain name

vi /etc/asterisk/modules.conf

add the below entry after the last line ,save the file and reboot to take effect the changes.
load => res_http_websocket.so
Reboot the server once, so the asterisk startup with http_websocket loaded,
to confirm websocket is loaded , run the below command 
asterisk -rx 'http show status'
make sure it says “HTTPS Server Enabled and Bound to 0.0.0.0:8089”
[root@centos~]# asterisk -rx "http show status"
HTTP Server Status:
Prefix:
Server: Asterisk/13.29.2
Server Enabled and Bound to 0.0.0.0:8088

HTTPS Server Enabled and Bound to 0.0.0.0:8089

Enabled URI's:
/httpstatus => Asterisk HTTP General Status
/phoneprov/... => Asterisk HTTP Phone Provisioning Tool
/static/... => Asterisk HTTP Static Delivery
/ari/... => Asterisk RESTful API
/ws => Asterisk HTTP WebSocket

Enabled Redirects:
None.
vi /etc/asterisk/rtp.conf
rtpstart=10000
rtpend=20000
icesupport=yes
stunaddr=stun.counterpath.com:3478
vi /etc/asterisk/res_stun_monitor.conf
stunaddr=stun.counterpath.com:3478
stunrefresh = 30
go to asterisk cli ,reload once and check stun updates similar like below
centos-s-4vcpu-8gb-intel-nyc1-01*CLI> stun show status
Hostname Port Period Retries Status ExternAddr ExternPort
stun.counterpath.com 3478 30 3 OK xx.xxx.xx.xx 32997
centos-s-4vcpu-8gb-intel-nyc1-01*CLI>

vi /etc/asterisk/sip.conf

update below entry
realm=your-domain or publicip
externaddr=your-publicip
| Step 25 : Downloading the Viciphone 

you can download the official viciphone or enhanced version from below links, i prefer the enhanced version.

official link : https://viciphone.com  
githublink : https://github.com/vicimikec/ViciPhone.git

enhanced link : https://github.com/ccabrerar/ViciPhone.git

  • download the file to a temp directory
cd /var/tmp
git clone https://github.com/ccabrerar/ViciPhone.git

  • copy the file to vicidial agc folder and provide permission
cd /var/tmp
cp -r ViciPhone /var/www/html/agc/viciphone
chmod -R 755 /var/www/html/agc/viciphone
| Step 26 : Vicidial Settings to Support Webrtc

  • Set webphone as default phone .
ADMIN > SYSTEM SETTINGS > Default Webphone: 1

  • Enter the webphone url
ADMIN > SYSTEM SETTINGS > Webphone URL:  
Webphone URL: viciphone/viciphone.php


vicidial webphone url

  • Set the websocket URL
ADMIN > SERVERS > Modify > Web Socket URL: 
wss://striker24x7.ddns.net:8089/ws

vicidial websocket url


| Step 27 : Vicidial webrtc TEMPLATE

Now we need to create webrtc sip template which we will assign to each phone created in vicidial.

Go to Admin -> Templates
copy paste the below settings, make to point to your ssl certificate path
type=friend
host=dynamic
encryption=yes
avpf=yes
icesupport=yes
directmedia=no
transport=wss
force_avp=yes
dtlsenable=yes
dtlsverify=no
dtlscertfile=/etc/letsencrypt/live/striker24x7.ddns.net/cert.pem
dtlsprivatekey=/etc/letsencrypt/live/striker24x7.ddns.net/privkey.pem
dtlssetup=actpass
rtcp_mux=yes
vicidial webrtc template

| Step 28 : Vicidial Phones as Webphone

Goto ADMIN > PHONES 
either add new phone or modify your existing phone and enable the below settings

Set As Webphone:  Y
Webphone Dialpad:Y
Webphone Auto-Answer: Y
Webphone Dialbox: Y
Webphone Mute: Y
Webphone Volume:Y

at Last line under TEMPLATE ID select the webrtc template created in step 27

vicidial phones






vicidial webrtc template 



| Step 29 : Final workaround : delay the webphone login call

By default as soon you login as agent, the vicidial will initiate the first login call and play the message "you are the only person in conference"
You might miss this sound or call because of browser loading speed and time the webphone registring time.

To avoid this we will delay the call by 10 sec.
Follow the steps 
cd /var/www/html/agc
cp
options-example.php options.php
Now edit the options.php file and set 10 for $webphone_call_seconds  
cd /var/www/html/agc
vi +64 /var/www/html/agc/options.php

search for below line and enter 10
$webphone_call_seconds = '10';
| Step 30 : Oops we have Completed, time to test.

use your Favourite browser to access your dialer, 
i prefer firefox as my favourite .

URL: https://FQDN/agc/admin.php

you should be now able to login as agent with webphone/webrtc as shown below


Note : while logging in , the browser will ask permission to use MIC , Press ALLOW

vicidial webphone


Finally you can see your agent panel with Webphone.

vicidial agent webphone


| Step 31 : Tips 

NOIP
  • you need regularly update your noip domain either manualy in there website or you can use the noip update client to automate the same
Letsencrypt
  • Let’s Encrypt certificates are valid for 90 days, but it’s recommended that you renew the certificates every 60 , you can renew by running the command "certbot renew --dry-run"
  • either run manually or automate via cronjob 
  0 2 30 * * /usr/bin/certbot renew --dry-run > /dev/null 2>&1


| Also Check Below Links


Support : 
skype: striker24x7
gmail : striker24x7@gmail.com

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.