Skip to content

Instantly share code, notes, and snippets.

@identor
Last active February 19, 2024 04:26
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save identor/393fc3279032e75236e2 to your computer and use it in GitHub Desktop.
Save identor/393fc3279032e75236e2 to your computer and use it in GitHub Desktop.
Guide: Vici Dial Installation

Vici Dial Installation Guide

This guide shows a simple Vici Dial installtion on a debian6_x64 droplet in Digital Ocean.

Create the Droplet

General Guidelines:

  • Create the Droplet by selecting Create Droplet in the Droplet's UI.
  • Select the 64 bit image of debian 6.

Dependency installation

We need to install all dependencies before proceeding to install the astguiclient.

Install dependencies available from apt-get

Once you are logged in to the droplet's console, you will now be able to install the dependencies. Issue the following Commands:

apt-get update
apt-get upgrade
apt-get install apache2 build-essential libmysqlclient15-dev libncurses5-dev libploticus0-dev libsox-fmt-all mpg123 mysql-client mysql-server mytop ntp php5 php5-cli php5-dev php5-mysql phpmyadmin ploticus screen sipsak sox subversion subversion-tools unzip libcurl3 curl vim phpsysinfo iftop htop nmon tmux linux-headers-$(uname -r) -y

A prompt while installing the dependencies might popup just fill in what is needed as follows, if any passwords would be asked for please use the standard passwords for those applications or provide the password for those in our password tracker.

Install CPAN modules needed by perl

Note: While installing the cpan modules, you will be prompted. This process might take around 30 minutes.

perl -MCPAN -e 'my $c = "CPAN::HandleConfig"; $c->load(doit => 1, autoconfig => 1); $c->edit(prerequisites_policy => "follow"); $c->edit(build_requires_install_policy => "yes"); $c->commit'
cpan MD5 Digest::MD5 Digest::SHA1 readline 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 MIME::POP3Client Mail::IMAPClient Mail::Message IO::Socket::SSL

Download source for other dependencies

Since not all of the things that we will be using will be available in debian's apt repository, we will need to obtain their source code to compile and install them. Since they are now previously available from one of our servers issue these commands to copy those files. The password will be present at our password tracker.

mkdir -p /usr/src
scp root@125.212.38.171:/usr/src/*.tar.gz /usr/src/.
mkdir -p /usr/src/asterisk
scp root@125.212.38.171:/usr/src/asterisk/*.tar.gz /usr/src/asterisk/.

Copy apache and default mysql configuration files

We need a default starting point for the installation all settings for Vicidial and apache shall be contained in the files copied.

scp root@125.212.38.171:/etc/apache2/sites-available/default /etc/apache2/sites-available/default
scp root@125.212.38.171:asterisk.sql .

Install Astgui Dependencies

In this section we will now be installing astgui dependencies sequentially.

Install Perl Asterisk Extension

We will now install the Asterisk Module, We will be using version 0.08 since 0.09 will not work with Vicidial. Issue the following commands:

cd /usr/src
tar -xf asterisk-perl-0.08.tar.gz
cd asterisk-perl-0.08/
perl Makefile.PL && make all && make install

Install lame

Same as the last step, just type or copy them in the command line. Issue the following commands:

cd /usr/src
tar -xf lame-398-2.tar.gz
cd lame-398-2/
./configure && make && make install

Install asterisk

To install asterisk we will be needing to instal it's dependencies.

Install Dhadi

cd /usr/src/asterisk
tar -xf dahdi-linux-complete-current.tar.gz
cd dahdi-linux-complete-2.9.1.1+2.9.1/
make all && make install && make config

Install libpri

To install libpri issue the following commands:

cd /usr/src/asterisk
tar -xf libpri-1.4-current.tar.gz
cd libpri-1.4.14/
make clean && make && make install

Install Asterisk Core

The asterisk version which we will be using is 1.4 as astgui's install guide recommends. After the installation of Dhadi and libpri we may now be able to install the asterisk core. To install it issue the following commands:

cd /usr/src/asterisk
tar -xf asterisk-1.4.39.1-vici.tar.gz
cd asterisk-1.4.39.1-vici/
./configure && make clean && make && make install && make samples

We then enable asterisk to start automatically on boot by copying the boot file from asterisk into the asterisk init.d folder.

cp /usr/src/asterisk/asterisk-1.4.39.1-vici/contrib/init.d/rc.debian.asterisk /etc/init.d/asterisk
update-rc.d asterisk defaults

Install sounds needed by Vicidial

We will be extracting the sound files that we have previously downloaded to our scp server. Enter the following commands as follows.

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

Create symbolic links for the mohmp3 files, and ready the quiet-mp3 dir for sox'ing sound files.

mkdir -p /var/lib/asterisk/mohmp3
mkdir -p /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

Remove unnecessary files.

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*

sox the sound files.

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

Untar (extract) the astguiclient source files.

cd /usr/src
tar -xf astguiclient.tar.gz

Ready the database for the astguiclient installation

Firstly you would need to login to the mysql console use this command mysql -p. When prompted for a password enter the mysql password for root user. This was created during the initial installation. If no password is specified during the installation simply enter mysql. While in the mysql console enter the following commands to create the DB tables:

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';
GRANT SELECT,INSERT,UPDATE,DELETE,LOCK TABLES on asterisk.* TO cron@localhost IDENTIFIED BY '1234';
GRANT RELOAD ON *.* TO cron@'%';
GRANT RELOAD ON *.* TO cron@localhost;
flush privileges;
SET GLOBAL connect_timeout=60;
use asterisk;
\. /usr/src/astguiclient/trunk/extras/MySQL_AST_CREATE_tables.sql
\. /usr/src/astguiclient/trunk/extras/first_server_install.sql
\. /usr/src/astguiclient/trunk/extras/sip-iax_phones.sql
quit

This process will also import the sample data provided by the astguiclient source.

Install astguiclient (Vicidial)

We are now ready to install astguiclient. Enter the following commands to install astguiclient:

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

When it prompts you to enter something, Check if they are one of the entries below and change the accordingly (apache uses /var/www as its main web folder). Also note that we have not configured ftp in this guide so for all the settings pertaining to ftp just press enter to use the default values.

server webroot path or press enter for default[/srv/htdocs]: /var/www 
Copy sample configuration files to /etc/asterisk/ ? [n] y

Populate the area codes using this command:

/usr/share/astguiclient/ADMIN_area_code_populate.pl

Update rc.local

Edit /etc/rc.local to contain the following code (enter vi /etc/rc.local/ to edit with vi, nano /etc/rc.local to edit with nano, ed /etc/rc.local to edit with ed... choose an editor to your liking):

#!/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
/etc/init.d/mysqld start

### start up the apache web server
/etc/init.d/apache2 start

### 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

Update crontab entries

To edit crontab with your favourite editor execute env EDITOR=vi crontab -e, add the following lines to your crontab:

### 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

Update your server ip.

/usr/share/astguiclient/ADMIN_update_server_ip.pl --old-server_ip=10.10.10.15

Reboot your server

reboot
@aadityabhatta
Copy link

I got following error with this command

apt-get install apache2 build-essential libmysqlclient15-dev libncurses5-dev libploticus0-dev libsox-fmt-all mpg123 mysql-client mysql-server mytop ntp php5 php5-cli php5-dev php5-mysql phpmyadmin ploticus screen sipsak sox subversion subversion-tools unzip libcurl3 curl vim phpsysinfo iftop htop nmon tmux linux-headers-$(uname -r) -y

IS there any other workaround.

This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package php5-cli is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package php5-mysql is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package mytop is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  mariadb-client-10.1

E: Unable to locate package libmysqlclient15-dev
E: Package 'mytop' has no installation candidate
E: Package 'php5' has no installation candidate
E: Package 'php5-cli' has no installation candidate
E: Unable to locate package php5-dev
E: Package 'php5-mysql' has no installation candidate
E: Unable to locate package phpsysinfo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment