MultiServerWARNING: Before you start doing this install
The Vicidial Team has seen a number of problems with Redhat/Fedora/CentOS based systems running vicidial and does genreally NOT RECOMMEND using those for Vicidial.
Beside of this this is a great start to get a testing system setup!
This document covers on how to install vicidial in a multi-server environment.
This setup is is done using the following components:
Author: Deo Dax Sillero-Cordova?
http://www.linkedin.com/in/codehaxor
deodax.cordova@gmail.com
M: +639163148590
M2: +639235272430
1 Webserver
Core2Duo? 1.86 GHZ Processor 150 GB SATA HDD 1 GB RAM Operating System: CentOS 4.4 x64 Server CD
1 MySQL Database Server
Core2Duo? 1.86 GHZ Processor 150 GB SATA HDD 2 GB RAM Operating System: CentOS 4.4 x64 Server CD
1 Asterisk Server
Core2Duo? 1.86 GHZ Processor 150 GB SATA HDD 2 GB RAM Operating System: CentOS 4.4 x64 Server CD
1 FTP Server for recording archive
Core2Duo? 1.86 GHZ Processor 500 GB SATA 2 HDD 1 GB RAM Operating System: CentOS 4.4 x65 Server CD
Definition of terms : WS = Webserver assumed ip is 192.168.1.3 / 255.255.255.0 DB = Database Server assumed ip is 192.168.1.4 / 255.255.255.0 AS = Asterisk / Vicidial Server 192.168.1.5 / 255.255.255.0 FTP = FTP Record Archive 192.168.1.6 / 255.255.255.0
Summary :
A short preview of how things work, basically the agents will be logged using a softphone (SIP or IAX2) client to the AS, they will also log in to their user interface through a web browser via the WS, both AS and WS sends data to the DB for updates and agent transactions (CALLING, HANGING UP, NEW LEAD LOADED etc).
The AS will be the one responsible for calling out and bridging the calls to the logged in agent through meetme or app_conference, but this setup will focus on the usage of meetme as most common setups do, the AS is also responsible for recording calls of an agent and uploads them to the local FTP Record Archive.
What we are trying to achieve is to split the load to the servers so that you can accommodate more agents in your asterisk server (this setup is in production with 25 agents on 1:2 ratio dialing full recording)and at the same time make it more stable compared to a single server setup. In this way you can also understand well how each server works and what you need. I am not a vicidial guru but I am extending my help out to those who are new to vicidial to know how to set it up and get it going instead of being ripped off by a "consultant" (I have a friend who almost got ripped of by someone who sold him a vicidial server for 600,000 thousand pesos for 40 users), and also this is my contribution to the opensource community since I know many people are making money out of vicidial and asterisk installs without giving help back to the vicidial project.
So if I lack something please kindly add or edit it. It will be a great help to the our community.
Step 1: Setting up the webserver.
a.) Install CentOS 4.4 x86_64 and set the ip address, let us assume the ip address is 192.168.1.3 / 255.255.255.0
b.) Once the CentOS is installed it is recommended that you do an update. You can do this by typing:
root@localhost# yum -y update ; reboot
c.) Install the rpmforge (dag repo) repository, well be needing this to get some of the required rpms. Do this by typing:
root@localhost# __rpm -Uvh http://apt.sw.be/redhat/el4/en/x86_64/rpmforge/RPMS/rpmforge-release-0.3.6-1.el4.rf.x86_64.rpm
c.) Install the needed components for the webserver. You can do this by typing:
root@localhost# yum -y install httpd php php-mysql php-eaccelerator ploticus mysql
d.) Set the /etc/php.ini memory_limit to 48MB. Edit /etc/php.ini and search for memory_limit, by default it has a value of 16 or 8M now change it to 48 MB.
root@localhost# vi /etc/php.ini
;;;;;;;;;;;;;;;;;;; ; Resource Limits ; ;;;;;;;;;;;;;;;;;;; max_execution_time = 30 ; Maximum execution time of each script, in seconds max_input_time = 60 ; Maximum amount of time each script may spend parsing request data memory_limit = 8M ; Change this to 48M
e.) Now your good go, to verify your installation you can start httpd and execute the ff commands:
root@localhost# service httpd restart root@localhost# php -v PHP 4.3.9 (cgi) (built: Sep 20 2007 19:31:11) Copyright (c) 1997-2004 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies with eAccelerator v0.9.5.2, Copyright (c) 2004-2006 eAccelerator, by eAccelerator
Step 2: Installation of the FTP server
a.) Install CentOS 4.4 x64 server cd on the machine and set its ip to 192.168.1.6 / 255.255.255.0
b.) Do a yum update and reboot
root@localhost# netcfg root@localhost# yum -y update root@localhost# reboot
c.) Install vsftpd
root@localhost# yum -y install vsftpd
d.) Create a user and the respective recording and reports directory, in this case ill be using the user cron and a password of test
root@localhost# adduser cron root@localhost# passwd cron root@localhost# mkdir -p /home/cron/RECORDINGS root@localhost# mkdir -p /home/cron/REPORTS root@localhost# chown cron:cron /home/cron/ -R root@localhost# service vsftpd restart
e.) Testing by ftpying into it, if it works and your logged in with the user name and the password then our ftp server is good to go
root@localhost# ftp localhost
Step 3: Setting up your database server
a.) Install CentOS 4.4 x86_84 Server CD to the machine
b.) Do a yum update and reboot
root@localhost# yum -y update ; reboot
c.) Install mysql server components and start mysql service
root@localhost# yum -y install mysql mysql-server mysql-devel root@localhost# service mysqld restart
d.) Change the mysql root password
root@localhost# mysqladmin -password yournewpassword
e.) test the mysql connection
root@localhost# mysql -u root -p
f.) edit /etc/my.cnf and add the following that are indicated by a bold text
root@localhost# vi /etc/my.cnf
mysqld max_connections = 500 skip-name-resolve datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock # Default to using old password format for compatibility with mysql 3.x # clients (those using the mysqlclient10 compatibility package). old_passwords=1 mysql.server user=mysql basedir=/var/lib mysqld_safe err-log=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid
g.) Restart mysql and your good to go
root@localhost# service mysqld restart
Step 4: Installing Asterisk & AstguiClient? and their pre requisites (yehey were almost done)
a) Install CentOS 4.4 x86_64 Server CD on the machine and set the ip to 192.168.1.5
b) Install the dag rpm repository, do a yum update and reboot
root@localhost# rpm -Uvh http://apt.sw.be/redhat/el4/en/x86_64/rpmforge/RPMS/rpmforge-release-0.3.6-1.el4.rf.x86_64.rpm root@localhost# yum -y update ; reboot
c) Installation of required packages
root@localhost# yum -y install lame sox screen mysql mysql-devel gcc make openssl openssl-devel kernel-smp-devel
htop zlib zlib-devel bison flex
d) Installation of perl modules, just press ENTER when prompted and when you get the prompt MAKE INSTALL OPTIONS set it to UNINST=1, then select mirrors and your location. If you are getting test errors when building Bundle::CPAN you can do a force install instead of the regular install cpan command.
root@localhost# perl -MCPAN -e shell cpan1> install MD5 cpan1> install Digest::MD5 cpan1> install Digest::SHA1 cpan1> install readline cpan1> install Bundle::CPAN cpan1> reload cpan cpan1> install DBI cpan1> force install DBD::mysql (must at least have mysqlclientlibs installed) cpan1> install Net::Telnet cpan1> install Time::HiRes cpan1> install Net::Server cpan1> install Unicode::Map (needed for super list loader Excel) cpan1> install Jcode (needed for super list loader Excel) cpan1> install Spreadsheet::WriteExcel (needed for super list loader Excel) cpan1> install OLE::Storage_Lite (needed for super list loader Excel) cpan1> install Proc::ProcessTable (needed for super list loader Excel) cpan1> install IO::Scalar (needed for super list loader Excel) cpan1> install Spreadsheet::ParseExcel (needed for super list loader Excel) cpan1> quit
e) Installation of the Asterisk Perl Module (as per scratch install dont use the .09 version)
root@localhost# cd /usr/local root@localhost# wget http://asterisk.gnuinter.net/files/asterisk-perl-0.08.tar.gz root@localhost# gunzip asterisk-perl-0.08.tar.gz root@localhost# tar xvf asterisk-perl-0.08.tar root@localhost# cd asterisk-perl-0.08 root@localhost# perl Makefile.PL root@localhost# make all root@localhost# make install
d) Downloading and installing asterisk and applying patches
root@localhost# wget http://ftp.digium.com/pub/asterisk/releases/asterisk-1.2.24.tar.gz root@localhost# wget http://ftp.digium.com/pub/zaptel/releases/zaptel-1.2.21.tar.gz root@localhost# wget http://ftp.digium.com/pub/libpri/releases/libpri-1.2.5.tar.gz root@localhost# gunzip asterisk-1.2.24.tar.gz root@localhost# tar xvf asterisk-1.2.24.tar root@localhost# gunzip zaptel-1.2.21.tar.gz root@localhost# tar xvf zaptel-1.2.21.tar root@localhost# gunzip libpri-1.2.5.tar.gz root@localhost# tar xvf libpri-1.2.5.tar root@localhost# cd zaptel-1.2.21 root@localhost# make clean root@localhost# make root@localhost# make install root@localhost# cd ../libpri-1.2.5 root@localhost# make clean root@localhost# make root@localhost# make install root@localhost# cd ../asterisk-1.2.24 root@localhost# cd apps root@localhost# wget http://www.eflo.net/files/app_amd2.c root@localhost# mv app_amd2.c app_amd.c root@localhost# vi Makefile replace this line(line 32): app_mixmonitor.so app_stack.so with this line: app_mixmonitor.so app_stack.so app_amd.so root@localhost# wget http://www.eflo.net/files/amd2.conf root@localhost# mkdir /etc/asterisk root@localhost# mv amd2.conf /etc/asterisk/amd.conf root@localhost# wget http://www.eflo.net/files/meetme_DTMF_passthru-1.2.23.patch root@localhost# patch -p1 < ./meetme_DTMF_passthru-1.2.23.patch File to patch: app_meetme.c root@localhost# wget http://www.eflo.net/files/meetme_volume_control_1.2.16.patch root@localhost# patch -p1 < ./meetme_volume_control_1.2.16.patch File to patch: app_meetme.c root@localhost# cd ../ root@localhost# wget http://www.eflo.net/files/cli_chan_concise_delimiter.patch root@localhost# patch -p1 < ./cli_chan_concise_delimiter.patch File to patch: cli.c root@localhost# wget http://www.eflo.net/files/app_waitforsilence.c root@localhost# mv app_waitforsilence.c apps/app_waitforsilence.c root@localhost# wget http://www.eflo.net/files/enter.h root@localhost# wget http://www.eflo.net/files/leave.h root@localhost# mv -f enter.h apps/enter.h root@localhost# mv -f leave.h apps/leave.h root@localhost# make clean root@localhost# make root@localhost# make install