From 83d98e97ac20b0e7a72341c11ad50d3e1fe61377 Mon Sep 17 00:00:00 2001 From: mattf Date: Fri, 8 Feb 2008 13:40:05 +0000 Subject: [PATCH] Several bug fixes for remote agents,CLI lead loading, vdc_db_query docs updated git-svn-id: svn://192.168.202.10@775 3d104415-ff17-0410-8863-d5cf3c621b8a --- bin/AST_VDremote_agents.pl | 17 +++--- bin/VICIDIAL_IN_new_leads_file.pl | 9 +-- docs/BASE_INSTALL.txt | 38 ++++++------ docs/PERFORMANCE_TESTING.txt | 30 +++++++++- docs/REQUIRED_APPS_INSTALL.txt | 77 +++++++++++++++---------- docs/SCRATCH_INSTALL.txt | 2 +- docs/conf_examples/iax.conf.sample | 4 +- www/agc/vdc_db_query.php | 2 +- www/vicidial/AST_server_performance.php | 55 +++++++++--------- 9 files changed, 139 insertions(+), 95 deletions(-) diff --git a/bin/AST_VDremote_agents.pl b/bin/AST_VDremote_agents.pl index 5c8c7da2..594c455d 100644 --- a/bin/AST_VDremote_agents.pl +++ b/bin/AST_VDremote_agents.pl @@ -19,7 +19,7 @@ # It is good practice to keep this program running by placing the associated # KEEPALIVE script running every minute to ensure this program is always running # -# Copyright (C) 2007 Matt Florell LICENSE: GPLv2 +# Copyright (C) 2008 Matt Florell LICENSE: GPLv2 # # CHANGELOG: # 50215-0954 - First version of script @@ -34,6 +34,7 @@ # 70214-1243 - Added queuemetrics_log_id field to queue_log logging # 70222-1606 - Changed queue_log PAUSE/UNPAUSE to PAUSEALL/UNPAUSEALL # 70417-1346 - Fixed bug that would add unneeded simulated agent lines +# 80128-0105 - Fixed calls_today bug # ### begin parsing run-time options ### @@ -240,18 +241,20 @@ while($one_day_interval > 0) &event_logger; ##### grab number of calls today in this campaign and increment - $stmt="SELECT calls_today FROM vicidial_live_agents WHERE extension LIKE \"R/%\";"; - $rslt=mysql_query($stmt, $link); - if ($DB) {print "$stmt\n";} - $vla_cc_ct = mysql_num_rows($rslt); + $stmtA="SELECT calls_today FROM vicidial_live_agents WHERE extension LIKE \"R/%\";"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $vla_cc_ct=$sthA->rows; if ($vla_cc_ct > 0) { - $row=mysql_fetch_row($rslt); - $calls_today =$row[0]; + @aryA = $sthA->fetchrow_array; + $calls_today = "$aryA[0]"; + $rec_count++; } else {$calls_today ='0';} $calls_today++; + $sthA->finish(); $stmtA = "UPDATE vicidial_live_agents set status='INCALL', last_call_time='$SQLdate',comments='REMOTE',calls_today='$calls_today' where server_ip='$server_ip' and status IN('QUEUE') and extension LIKE \"R/%\";"; $affected_rows = $dbhA->do($stmtA); diff --git a/bin/VICIDIAL_IN_new_leads_file.pl b/bin/VICIDIAL_IN_new_leads_file.pl index 68e88213..d905f0a3 100644 --- a/bin/VICIDIAL_IN_new_leads_file.pl +++ b/bin/VICIDIAL_IN_new_leads_file.pl @@ -8,7 +8,7 @@ # # It is recommended that you run this program on the local Asterisk machine # -# Copyright (C) 2007 Matt Florell LICENSE: GPLv2 +# Copyright (C) 2008 Matt Florell LICENSE: GPLv2 # # # CHANGES @@ -25,6 +25,7 @@ # 70510-1518 - Added campaign and system duplicate check and phonecode override # 70801-0912 - Added called count and status to import leads format (fields 24 and 25) # 70815-2128 - Added entry_date to import leads format (field 26) +# 80128-0105 - Fixed bugs in file loading # $secX = time(); @@ -194,11 +195,11 @@ else { print "no command line options set\n"; $args = ""; -$i=0; $forcelistid = ''; } ### end parsing run-time options ### +$i=0; $US = '_'; $phone_list = '|'; @@ -277,8 +278,8 @@ if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOC $multi_insert_counter=0; $multistmt=''; -if ($DB) -# while () +#if ($DB) + while () { # print "$a| $number\n"; diff --git a/docs/BASE_INSTALL.txt b/docs/BASE_INSTALL.txt index ce4e6d4e..5612057e 100644 --- a/docs/BASE_INSTALL.txt +++ b/docs/BASE_INSTALL.txt @@ -31,16 +31,16 @@ PHASE 1: INSTALLING ASTERISK 1. follow these command line steps: mkdir /usr/src/asterisk cd /usr/src/asterisk -wget http://ftp.digium.com/pub/asterisk/releases/asterisk-1.2.24.tar.gz -wget http://ftp.digium.com/pub/zaptel/releases/zaptel-1.2.21.tar.gz -wget http://ftp.digium.com/pub/libpri/releases/libpri-1.2.5.tar.gz -gunzip asterisk-1.2.24.tar.gz -tar xvf asterisk-1.2.24.tar -gunzip zaptel-1.2.21.tar.gz -tar xvf zaptel-1.2.21.tar -gunzip libpri-1.2.5.tar.gz -tar xvf libpri-1.2.5.tar -cd ./zaptel-1.2.21 +wget http://ftp.digium.com/pub/asterisk/releases/asterisk-1.2.26.2.tar.gz +wget http://ftp.digium.com/pub/zaptel/releases/zaptel-1.2.23.tar.gz +wget http://ftp.digium.com/pub/libpri/releases/libpri-1.2.7.tar.gz +gunzip asterisk-1.2.26.2.tar.gz +tar xvf asterisk-1.2.26.2.tar +gunzip zaptel-1.2.23.tar.gz +tar xvf zaptel-1.2.23.tar +gunzip libpri-1.2.7.tar.gz +tar xvf libpri-1.2.7.tar +cd ./zaptel-1.2.23 wget http://www.freedomphones.net/files/newt-0.51.6.tar.gz gunzip newt-0.51.6.tar.gz tar xvf newt-0.51.6.tar @@ -54,11 +54,11 @@ make clean make zttool make make install -cd ../libpri-1.2.5 +cd ../libpri-1.2.7 make clean make make install -cd ../asterisk-1.2.24 +cd ../asterisk-1.2.26.2 (1.2 tree) If you want to include Answering Machine Detection ability you will need to download app_amd.c and amd.conf and alter the apps/Makefile to compile it properly @@ -73,11 +73,11 @@ cd ../asterisk-1.2.24 wget http://www.eflo.net/files/amd2.conf mkdir /etc/asterisk mv amd2.conf /etc/asterisk/amd.conf - *OPTIONAL*(1.2.23 thru 1.2.24) apply the meetme DTMF passthru patch + *OPTIONAL*(1.2.23 thru 1.2.26.2) apply the meetme DTMF passthru patch wget http://www.eflo.net/files/meetme_DTMF_passthru-1.2.23.patch patch -p1 < ./meetme_DTMF_passthru-1.2.23.patch - File to patch: app_meetme.c - *OPTIONAL*(1.2.12.1 thru 1.2.24) apply the meetme volume control patch + *OPTIONAL*(1.2.12.1 thru 1.2.26.2) apply the meetme volume control patch *Different patches available for 1.2.7.1 through 1.2.14 wget http://www.eflo.net/files/meetme_volume_control_1.2.16.patch patch -p1 < ./meetme_volume_control_1.2.16.patch @@ -89,7 +89,7 @@ cd ../asterisk-1.2.24 patch -p1 < ./cli_chan_concise_delimiter.patch - File to patch: cli.c - *OPTIONAL*(1.2.14 thru 1.2.24) rewrite of waitforsilence + *OPTIONAL*(1.2.14 thru 1.2.26.2) rewrite of waitforsilence wget http://www.eflo.net/files/app_waitforsilence.c mv -f app_waitforsilence.c apps/app_waitforsilence.c @@ -267,7 +267,7 @@ use asterisk; ##### make sure on these queries that you change the server_ip "10.10.10.15" ##### to the server IP that you are using -insert into servers (server_id,server_description,server_ip,active,asterisk_version)values('TESTasterisk','Test install of Asterisk server', '10.10.10.15','Y','1.2.24'); +insert into servers (server_id,server_description,server_ip,active,asterisk_version)values('TESTast','Test install of Asterisk server', '10.10.10.15','Y','1.2.26.2'); insert into server_updater values('10.10.10.15',''); @@ -554,9 +554,9 @@ PHASE 5: ADDING STARTUP ENTRIES FOR ASTGUICLIENT/VICIDIAL SCRIPTS # /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 +setterm -blank +setterm -powersave off +setterm -powerdown ### start time server /usr/local/bin/ntpdate -u 18.145.0.30 diff --git a/docs/PERFORMANCE_TESTING.txt b/docs/PERFORMANCE_TESTING.txt index 9aec88fb..d2e95c40 100644 --- a/docs/PERFORMANCE_TESTING.txt +++ b/docs/PERFORMANCE_TESTING.txt @@ -97,7 +97,6 @@ TESTTRUNK = Zap/g2 TESTSIPTRUNK = SIP/VICItest:test@10.10.10.16:5060 [default] -;exten => _91999NXXXXXX,1,AGI(call_log.agi) exten => _91999NXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log) exten => _91999NXXXXXX,2,Dial(${TESTTRUNK}/${EXTEN:2},,tTo) exten => _91999NXXXXXX,3,Hangup @@ -105,3 +104,32 @@ exten => _91999NXXXXXX,3,Hangup exten => 999999999999,1,Answer exten => 999999999999,2,Dial(${TESTSIPTRUNK}/${EXTEN},,tTo) exten => 999999999999,2,Hangup + + +In the sip.conf file of the test server: +register => ASTtest2:test@10.10.10.16:5060 + +[VICItest] +disallow=all +allow=ulaw +type=friend +username=VICItest +secret=test +host=dynamic +dtmfmode=inband +defaultip=10.10.10.16 +qualify=1000 + + +In the sip.conf file of the control server: + +[VICItest] +disallow=all +allow=ulaw +type=friend +username=VICItest +secret=test +host=dynamic +dtmfmode=inband +defaultip=10.10.10.16 +qualify=1000 diff --git a/docs/REQUIRED_APPS_INSTALL.txt b/docs/REQUIRED_APPS_INSTALL.txt index 521dba3b..5d973118 100644 --- a/docs/REQUIRED_APPS_INSTALL.txt +++ b/docs/REQUIRED_APPS_INSTALL.txt @@ -12,23 +12,32 @@ cd make-3.81 make make install -cd /usr/local -wget http://mirror.trouble-free.net/mysql_mirror/Downloads/MySQL-4.0/mysql-4.0.27.tar.gz -gunzip mysql-4.0.27.tar.gz -tar xvf mysql-4.0.27.tar -cd mysql-4.0.27 +cd /usr/local/ +wget http://mirror.trouble-free.net/mysql_mirror/Downloads/MySQL-5.0/mysql-5.0.45.tar.gz +gunzip mysql-5.0.45.tar.gz +tar xvf mysql-5.0.45.tar +cd mysql-5.0.45 groupadd mysql useradd -g mysql mysql -./configure --prefix=/usr/local/mysql --enable-large-files --enable-shared=yes --with-readline +./configure --prefix=/usr/local/mysql --enable-shared=yes --with-readline --enable-thread-safe-client --enable-large-files --enable-assembler --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static --with-big-tables make make install +PATH=$PATH:$HOME/bin:/usr/local/mysql/bin/ +export PATH +cp /usr/local/mysql-5.0.45/libmysql/.libs/libmysqlclient.so /usr/lib/ +cp /usr/local/mysql-5.0.45/libmysql/.libs/libmysqlclient.so.15 /usr/lib/ +cd /usr/local/mysql-5.0.45 scripts/mysql_install_db chown -R root /usr/local/mysql chown -R mysql /usr/local/mysql/var chgrp -R mysql /usr/local/mysql -cp support-files/my-medium.cnf /etc/my.cnf +cp support-files/my-huge.cnf /etc/my.cnf /usr/local/mysql/bin/mysqld_safe --user=mysql --skip-name-resolve --skip-host-cache & ln -s /tmp/mysql.sock /var/run/mysql/mysql.sock +vi /etc/my.cnf + # add this line below 'skip-locking' + skip-name-resolve + # comment out the line 'log-bin=mysql-bin' perl -MCPAN -e shell @@ -169,7 +178,7 @@ make install cd /usr/local -wget http://apache.secsup.org/dist/httpd/httpd-2.0.61.tar.gz +wget http://mirror.candidhosting.com/pub/apache/httpd/httpd-2.0.61.tar.gz gunzip httpd-2.0.61.tar.gz tar xvf httpd-2.0.61.tar wget http://us2.php.net/distributions/php-4.4.7.tar.gz @@ -288,16 +297,16 @@ make install mkdir /usr/src/asterisk cd /usr/src/asterisk -wget http://ftp.digium.com/pub/asterisk/releases/asterisk-1.2.24.tar.gz -wget http://ftp.digium.com/pub/zaptel/releases/zaptel-1.2.21.tar.gz -wget http://ftp.digium.com/pub/libpri/releases/libpri-1.2.5.tar.gz -gunzip asterisk-1.2.24.tar.gz -tar xvf asterisk-1.2.24.tar -gunzip zaptel-1.2.21.tar.gz -tar xvf zaptel-1.2.21.tar -gunzip libpri-1.2.5.tar.gz -tar xvf libpri-1.2.5.tar -cd ./zaptel-1.2.21 +wget http://ftp.digium.com/pub/asterisk/releases/asterisk-1.2.26.2.tar.gz +wget http://ftp.digium.com/pub/zaptel/releases/zaptel-1.2.23.tar.gz +wget http://ftp.digium.com/pub/libpri/releases/libpri-1.2.7.tar.gz +gunzip asterisk-1.2.26.2.tar.gz +tar xvf asterisk-1.2.26.2.tar +gunzip zaptel-1.2.23.tar.gz +tar xvf zaptel-1.2.23.tar +gunzip libpri-1.2.7.tar.gz +tar xvf libpri-1.2.7.tar +cd ./zaptel-1.2.23 wget http://www.freedomphones.net/files/newt-0.51.6.tar.gz gunzip newt-0.51.6.tar.gz tar xvf newt-0.51.6.tar @@ -311,11 +320,11 @@ make clean make zttool make make install -cd ../libpri-1.2.5 +cd ../libpri-1.2.7 make clean make make install -cd ../asterisk-1.2.24 +cd ../asterisk-1.2.26.2 cd apps wget http://www.eflo.net/files/app_amd2.c mv app_amd2.c app_amd.c @@ -386,6 +395,10 @@ mv -f *.mp3 ../orig-mp3/ ############# INSTRUCTIONS FOR Asterik 1.4 release #################### +Downgrading back to 1.2.X from 1.4.X: +rm -f /usr/lib/asterisk/modules/* +rm -f /usr/include/asterisk/* + NOTE: If you want to use Asterisk 1.4, you will need to make sure that you set the servers table "asterisk_version" field to the proper version number and you @@ -412,24 +425,24 @@ rm -f /usr/lib/asterisk/modules/pbx_functions.so mkdir /usr/src/asterisk-1.4 cd /usr/src/asterisk-1.4 -wget http://ftp.digium.com/pub/asterisk/releases/asterisk-1.4.14.tar.gz -wget http://ftp.digium.com/pub/zaptel/releases/zaptel-1.4.6.tar.gz -wget http://ftp.digium.com/pub/libpri/releases/libpri-1.4.2.tar.gz -gunzip asterisk-1.4.14.tar.gz -tar xvf asterisk-1.4.14.tar -gunzip zaptel-1.4.6.tar.gz -tar xvf zaptel-1.4.6.tar -gunzip libpri-1.4.2.tar.gz -tar xvf libpri-1.4.2.tar -cd ./zaptel-1.4.6 +wget http://ftp.digium.com/pub/asterisk/releases/asterisk-1.4.17.tar.gz +wget http://ftp.digium.com/pub/zaptel/releases/zaptel-1.4.8.tar.gz +wget http://ftp.digium.com/pub/libpri/releases/libpri-1.4.3.tar.gz +gunzip asterisk-1.4.17.tar.gz +tar xvf asterisk-1.4.17.tar +gunzip zaptel-1.4.8.tar.gz +tar xvf zaptel-1.4.8.tar +gunzip libpri-1.4.3.tar.gz +tar xvf libpri-1.4.3.tar +cd ./zaptel-1.4.8 ./configure make make install -cd ../libpri-1.4.2 +cd ../libpri-1.4.3 make clean make make install -cd ../asterisk-1.4.14 +cd ../asterisk-1.4.17 wget http://www.eflo.net/files/enter.h wget http://www.eflo.net/files/leave.h mv -f enter.h apps/enter.h diff --git a/docs/SCRATCH_INSTALL.txt b/docs/SCRATCH_INSTALL.txt index 8e1b87af..3bbe4f34 100644 --- a/docs/SCRATCH_INSTALL.txt +++ b/docs/SCRATCH_INSTALL.txt @@ -681,7 +681,7 @@ installation on another machine) Go to http://www.php.net/ and download the php unix source code - to install this directly on the command line type: - cd /usr/local - - wget http://apache.secsup.org/dist/httpd/httpd-2.0.61.tar.gz + - wget http://mirror.candidhosting.com/pub/apache/httpd/httpd-2.0.61.tar.gz - gunzip httpd-2.0.61.tar.gz - tar xvf httpd-2.0.61.tar - wget http://us2.php.net/distributions/php-4.4.7.tar.gz diff --git a/docs/conf_examples/iax.conf.sample b/docs/conf_examples/iax.conf.sample index 8c4e36ff..16f31dc1 100644 --- a/docs/conf_examples/iax.conf.sample +++ b/docs/conf_examples/iax.conf.sample @@ -8,8 +8,8 @@ jitterbuffer=no tos=lowdelay ;register => 1112223333:PASSWORD@iax.binfone.com -register => ASTloop:test@1270.0.1:40569 -register => ASTblind:test@1270.0.1:41569 +register => ASTloop:test@127.0.0.1:40569 +register => ASTblind:test@127.0.0.1:41569 [ASTloop] type=friend diff --git a/www/agc/vdc_db_query.php b/www/agc/vdc_db_query.php index adebe896..5c165c44 100644 --- a/www/agc/vdc_db_query.php +++ b/www/agc/vdc_db_query.php @@ -1115,7 +1115,7 @@ if ($stage == "end") $closer_logged=0; if ($check_inbound > 0) { - $four_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-4,date("i"),date("s"),date("m"),date("d")-1,date("Y"))); + $four_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-4,date("i"),date("s"),date("m"),date("d"),date("Y"))); $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec' where lead_id='$lead_id' and call_date > \"$four_hours_ago\" order by start_epoch desc limit 1;"; if ($DB) {echo "$stmt\n";} diff --git a/www/vicidial/AST_server_performance.php b/www/vicidial/AST_server_performance.php index afa75bd3..a19fac9d 100644 --- a/www/vicidial/AST_server_performance.php +++ b/www/vicidial/AST_server_performance.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2008 Matt Florell LICENSE: GPLv2 # # CHANGES # @@ -9,6 +9,7 @@ # - Added required user/pass to gain access to this page # 70417-1106 - Changed time frame to be definable per time range on a single day # - Fixed vertical scaling issues +# 80118-1508 - Fixed horizontal scale marking issues # require("dbconnect.php"); @@ -16,8 +17,6 @@ require("dbconnect.php"); $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} - elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} if (isset($_GET["begin_query_time"])) {$begin_query_time=$_GET["begin_query_time"];} elseif (isset($_POST["begin_query_time"])) {$begin_query_time=$_POST["begin_query_time"];} if (isset($_GET["end_query_time"])) {$end_query_time=$_GET["end_query_time"];} @@ -54,9 +53,8 @@ $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} -if (!isset($begin_query_time)) {$begin_query_time = '09:00:00';} -if (!isset($end_query_time)) {$end_query_time = '15:30:00';} +if (!isset($begin_query_time)) {$begin_query_time = "$NOW_DATE 09:00:00";} +if (!isset($end_query_time)) {$end_query_time = "$NOW_DATE 15:30:00";} if (!isset($group)) {$group = '';} $stmt="select server_ip from servers;"; @@ -87,9 +85,8 @@ while ($i < $servers_to_print) echo "\n"; echo "VICIDIAL: Server Performance\n"; echo "
\n"; -echo "Date:   \n"; -echo "Time: \n"; -echo "to \n"; +echo "Date/Time Range: \n"; +echo "to \n"; echo "Server: