diff --git a/UPGRADE b/UPGRADE index f33f841f..08e662b4 100644 --- a/UPGRADE +++ b/UPGRADE @@ -130,6 +130,10 @@ NOTE: Upgrading from 1.1.12-3 to 2.0.1 is at the bottom 28. Date/time and phone formats that appear in the VICIDIAL agent screen are now customizable as defined in the Admin -> System Settings screen. +29. Added manual dial and inbound queue_log logging capability for better + QueueMetrics compatibility + + diff --git a/agi/agi-VDAD_ALL_inbound.agi b/agi/agi-VDAD_ALL_inbound.agi index afe85bc1..ef5bec7c 100644 --- a/agi/agi-VDAD_ALL_inbound.agi +++ b/agi/agi-VDAD_ALL_inbound.agi @@ -61,6 +61,7 @@ # 80430-1144 - added term_reason to vicidial_closer_log, QUEUETIMEOUT, AFTERHOURS # 80501-0515 - added after hours transfer in-group # 80525-1040 - added ability to convert IVR status inbound calls to LIVE in-group calls +# 80630-2232 - added queue_log logging of inbound calls # $script = 'agi-VDAD_ALL_inbound.agi'; @@ -639,6 +640,7 @@ if ( ($hm < $ct_default_start) || ($hm > $ct_default_stop) ) + ##### PLAY WELCOME MESSAGE ##### if ($welcome_message_filename !~ /---NONE---/) { @@ -701,6 +703,60 @@ if ($call_handle_method =~ /CLOSER|DIGITID$/) if ($AGILOG) {$agi_string = "-- VDXL : |$insert_lead_id|$insert_xfer_id|insert to vicidial_xfer_log"; &agi_output;} } +############################################# +##### START QUEUEMETRICS LOGGING LOOKUP ##### +$stmtA = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,queuemetrics_eq_prepend FROM system_settings;"; +$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; +$sthA->execute or die "executing: $stmtA ", $dbhA->errstr; +$sthArows=$sthA->rows; +$rec_count=0; +while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $enable_queuemetrics_logging = "$aryA[0]"; + $queuemetrics_server_ip = "$aryA[1]"; + $queuemetrics_dbname = "$aryA[2]"; + $queuemetrics_login= "$aryA[3]"; + $queuemetrics_pass = "$aryA[4]"; + $queuemetrics_log_id = "$aryA[5]"; + $queuemetrics_eq_prepend = "$aryA[6]"; + $rec_count++; + } +$sthA->finish(); +##### END QUEUEMETRICS LOGGING LOOKUP ##### +########################################### +if ($enable_queuemetrics_logging > 0) + { + $data2 = "$phone_number"; + + if ( (length($queuemetrics_eq_prepend) > 0) && ($queuemetrics_eq_prepend !~ /NONE/) ) + { + $stmtA = "SELECT $queuemetrics_eq_prepend FROM vicidial_list where lead_id='$CIDlead_id';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + while ($sthArows > $rec_count) + { + $DASH='-'; + @aryA = $sthA->fetchrow_array; + $QMprepend = "$aryA[0]"; + $rec_count++; + $data2 = "$QMprepend$DASH$phone_number"; + } + $sthA->finish(); + } + + $dbhB = DBI->connect("DBI:mysql:$queuemetrics_dbname:$queuemetrics_server_ip:3306", "$queuemetrics_login", "$queuemetrics_pass") + or die "Couldn't connect to database: " . DBI->errstr; + + if ($DBX) {print "CONNECTED TO DATABASE: $queuemetrics_server_ip|$queuemetrics_dbname\n";} + + $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='$YqueryCID',queue='$channel_group',agent='NONE',verb='ENTERQUEUE',data2='$data2',serverid='$queuemetrics_log_id';"; + $Baffected_rows = $dbhB->do($stmtB); + + $dbhB->disconnect(); + } ### check for an IVR status record in vicidial_auto_calls $Uaffected_rows=0; @@ -947,6 +1003,19 @@ if ($agent_search_method =~ /^SO|^LO/) if ($AGILOG) {$agi_string = "$affected_rows|VDAC-reinsert|$stmtA|"; &agi_output;} } + if ($enable_queuemetrics_logging > 0) + { + $dbhB = DBI->connect("DBI:mysql:$queuemetrics_dbname:$queuemetrics_server_ip:3306", "$queuemetrics_login", "$queuemetrics_pass") + or die "Couldn't connect to database: " . DBI->errstr; + + if ($DBX) {print "CONNECTED TO DATABASE: $queuemetrics_server_ip|$queuemetrics_dbname\n";} + + $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='$YqueryCID',queue='$channel_group',agent='Agent/$VDADuser',verb='CONNECT',data1='$drop_timer',serverid='$queuemetrics_log_id';"; + $Baffected_rows = $dbhB->do($stmtB); + + $dbhB->disconnect(); + } + if ($call_handle_method =~ /CLOSER|DIGITID$/) { $stmtA = "UPDATE vicidial_xfer_log set closer='$VDADuser' where lead_id = '$insert_lead_id' order by call_date desc limit 1;"; @@ -1209,6 +1278,19 @@ if ($agent_search_method =~ /^LO|^LB/) if ($AGILOG) {$agi_string = "$affected_rows|VDAC-reinsert|$stmtA|"; &agi_output;} } + if ($enable_queuemetrics_logging > 0) + { + $dbhB = DBI->connect("DBI:mysql:$queuemetrics_dbname:$queuemetrics_server_ip:3306", "$queuemetrics_login", "$queuemetrics_pass") + or die "Couldn't connect to database: " . DBI->errstr; + + if ($DBX) {print "CONNECTED TO DATABASE: $queuemetrics_server_ip|$queuemetrics_dbname\n";} + + $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='$YqueryCID',queue='$channel_group',agent='Agent/$VDADuser',verb='CONNECT',data1='$drop_timer',serverid='$queuemetrics_log_id';"; + $Baffected_rows = $dbhB->do($stmtB); + + $dbhB->disconnect(); + } + $stmtA = "UPDATE vicidial_xfer_log set closer='$VDADuser' where lead_id = '$insert_lead_id' order by call_date desc limit 1;"; my $affected_rows = $dbhA->do($stmtA); if ($AGILOG) {$agi_string = "-- VDXL vicidial_xfer_log update: |$affected_rows|$insert_lead_id|$VDADuser\n|$stmtA|"; &agi_output;} @@ -1426,6 +1508,19 @@ $now_date = "$year-$mon-$mday $hour:$min:$sec"; $SQLdate = "$year-$mon-$mday $hour:$min:$sec"; $VDADvoicemail_ext = ''; +if ($enable_queuemetrics_logging > 0) + { + $dbhB = DBI->connect("DBI:mysql:$queuemetrics_dbname:$queuemetrics_server_ip:3306", "$queuemetrics_login", "$queuemetrics_pass") + or die "Couldn't connect to database: " . DBI->errstr; + + if ($DBX) {print "CONNECTED TO DATABASE: $queuemetrics_server_ip|$queuemetrics_dbname\n";} + + $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='$YqueryCID',queue='$channel_group',agent='NONE',verb='EXITWITHTIMEOUT',data1='1',serverid='$queuemetrics_log_id';"; + $Baffected_rows = $dbhB->do($stmtB); + + $dbhB->disconnect(); + } + $DROPexten = ''; if ($drop_seconds < 1) { diff --git a/agi/agi-VDAD_ALL_outbound.agi b/agi/agi-VDAD_ALL_outbound.agi index 4d557866..129ea108 100644 --- a/agi/agi-VDAD_ALL_outbound.agi +++ b/agi/agi-VDAD_ALL_outbound.agi @@ -450,7 +450,7 @@ if ($affected_rows > 0) if ($DBX) {print "CONNECTED TO DATABASE: $queuemetrics_server_ip|$queuemetrics_dbname\n";} - $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$secX',call_id='$callerid',queue='$VDADcampaign',agent='NONE',verb='ENTERQUEUE',data2='$data2',serverid='$queuemetrics_log_id';"; + $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='$callerid',queue='$VDADcampaign',agent='NONE',verb='ENTERQUEUE',data2='$data2',serverid='$queuemetrics_log_id';"; $Baffected_rows = $dbhB->do($stmtB); $dbhB->disconnect(); @@ -929,7 +929,7 @@ if ($agent_search_method =~ /^SO|^LO/) if ($DBX) {print "CONNECTED TO DATABASE: $queuemetrics_server_ip|$queuemetrics_dbname\n";} - $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$secX',call_id='$callerid',queue='$VDADcampaign',agent='Agent/$VDADuser',verb='CONNECT',data1='$drop_timer',serverid='$queuemetrics_log_id';"; + $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='$callerid',queue='$VDADcampaign',agent='Agent/$VDADuser',verb='CONNECT',data1='$drop_timer',serverid='$queuemetrics_log_id';"; $Baffected_rows = $dbhB->do($stmtB); $dbhB->disconnect(); @@ -1083,7 +1083,7 @@ if ($rec_countWAITrem < $concurrent_transfers) if ($DBX) {print "CONNECTED TO DATABASE: $queuemetrics_server_ip|$queuemetrics_dbname\n";} - $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$secX',call_id='$callerid',queue='$VDADcampaign',agent='Agent/$VDADuser',verb='CONNECT',data1='$drop_timer',serverid='$queuemetrics_log_id';"; + $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='$callerid',queue='$VDADcampaign',agent='Agent/$VDADuser',verb='CONNECT',data1='$drop_timer',serverid='$queuemetrics_log_id';"; $Baffected_rows = $dbhB->do($stmtB); $dbhB->disconnect(); @@ -1198,7 +1198,7 @@ if ($enable_queuemetrics_logging > 0) if ($DBX) {print "CONNECTED TO DATABASE: $queuemetrics_server_ip|$queuemetrics_dbname\n";} - $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$secX',call_id='$callerid',queue='$VDADcampaign',agent='NONE',verb='EXITWITHTIMEOUT',data1='1',serverid='$queuemetrics_log_id';"; + $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='$callerid',queue='$VDADcampaign',agent='NONE',verb='EXITWITHTIMEOUT',data1='1',serverid='$queuemetrics_log_id';"; $Baffected_rows = $dbhB->do($stmtB); $dbhB->disconnect(); diff --git a/docs/BASE_INSTALL.txt b/docs/BASE_INSTALL.txt index c2e6c635..c0bcea83 100644 --- a/docs/BASE_INSTALL.txt +++ b/docs/BASE_INSTALL.txt @@ -41,7 +41,7 @@ tar xvf zaptel-1.2.25.tar gunzip libpri-1.2.7.tar.gz tar xvf libpri-1.2.7.tar cd ./zaptel-1.2.25 -wget http://www.freedomphones.net/files/newt-0.51.6.tar.gz +wget http://downloads.vicidial.com/packages/newt-0.51.6.tar.gz gunzip newt-0.51.6.tar.gz tar xvf newt-0.51.6.tar cd newt-0.51.6 @@ -136,7 +136,7 @@ them: configure it. NOTES: If you want to install zttool diagnostics you may need the newt package installed: -http://www.freedomphones.net/files/newt-0.51.6.tar.gz +http://downloads.vicidial.com/packages/newt-0.51.6.tar.gz ln -s /usr/lib/libnewt.so.0.51.6 /usr/lib/libnewt.so.0.51 then go to your zaptel folder and do 'make zttool' @@ -211,7 +211,7 @@ package(as of this writing it is 2.0.4.1) package, it's the conf.gsm file(this is the half-hour music file that we use to put people on hold). I have a free classical music file that is available free for download at the following two sites: - http://www.freedomphones.net/conf.gsm + http://downloads.vicidial.com/sounds/conf.gsm http://astguiclient.sf.net/conf.gsm Once you have downloaded it, you will need to copy it to this folder: /var/lib/asterisk/sounds/ @@ -219,7 +219,7 @@ free for download at the following two sites: 'cp /var/lib/asterisk/sounds/conf.gsm /var/lib/asterisk/sounds/park.gsm' Here are the steps spelled out: cd /var/lib/asterisk/sounds - wget http://www.freedomphones.net/conf.gsm + wget http://downloads.vicidial.com/sounds/conf.gsm cp conf.gsm park.gsm - you are done diff --git a/docs/QUEUEMETRICS.txt b/docs/QUEUEMETRICS.txt index 5d771d3c..41fc92ca 100644 --- a/docs/QUEUEMETRICS.txt +++ b/docs/QUEUEMETRICS.txt @@ -1,6 +1,6 @@ VICIDIAL and QueueMetrics -queue_log logging was added to VICIDIAL outbound calling as an option in the 2.0.3 release tree. +queue_log logging was added to VICIDIAL outbound auto calling as an option in the 2.0.3 release tree. This document goes over the features and needed changes made to VICIDIAL to enable it to insert activity records into the queue_log and other tables in MySQL that QueueMetrics uses for it's statistical analysis and reports. This document should not be taken as a HOWTO for proper installation steps to get QueueMetrics working. @@ -8,7 +8,7 @@ QueueMetrics is a closed-source, commercial product written by Loway Research in This feature was added to the package at the request of several users of VICIDIAL and was achieved with some help from the makers of QueueMetrics(although all VICIDIAL code changes were done entirely by Matt Florell). -This feature is currently only functional on outbound dialing. +This feature is functional on outbound manual dialing, auto dialing and inbound call handling as of 2008-06-30(SVN trunk 2.0.5). @@ -108,6 +108,25 @@ mysql> describe queue_log; | serverid | varchar(10) | NO | | 0 | | +-----------+------------------+------+-----+---------+-------+ +Use the following query to create a queue_log table in your asterisk database +to gather queue_log entries without doing a full QueueMetrics install: + + CREATE TABLE queue_log ( +partition VARCHAR(20) NOT NULL, +time_id INT(11) UNSIGNED NOT NULL default '0', +call_id VARCHAR(30) NOT NULL, +queue VARCHAR(30) NOT NULL, +agent VARCHAR(30) NOT NULL, +verb VARCHAR(30) NOT NULL, +data1 VARCHAR(30) NOT NULL, +data2 VARCHAR(30) NOT NULL, +data3 VARCHAR(30) NOT NULL, +data4 VARCHAR(30) NOT NULL, +serverid VARCHAR(10) NOT NULL default '0', +unique_row_count INT(10) UNSIGNED NOT NULL, +index(time_id) + ); + partition: set to "P01" for the first partition, should match up with configuration.properties presets time_id: epoch, unixtime (seconds since 1970-01-01 00:00:00) [1170345603] @@ -164,12 +183,12 @@ data3: ?? data4: ?? -serverid: number of the server the call came from [for VICIDIAL use the system_settings.queuemetrics_log_id field] +serverid: number of the server the call came from [for VICIDIAL use the database system_settings.queuemetrics_log_id field] -On the vicidial side of things, we will add the following columns to the system_settings table: +On the vicidial database side of things, we will add the following columns to the system_settings table: enable_queuemetrics_logging ENUM('0','1') default '0', queuemetrics_server_ip VARCHAR(15), queuemetrics_dbname VARCHAR(50), diff --git a/docs/REQUIRED_APPS_INSTALL.txt b/docs/REQUIRED_APPS_INSTALL.txt index 60b2e1c5..827e976e 100644 --- a/docs/REQUIRED_APPS_INSTALL.txt +++ b/docs/REQUIRED_APPS_INSTALL.txt @@ -346,7 +346,7 @@ tar xvf zaptel-1.2.25.tar gunzip libpri-1.2.7.tar.gz tar xvf libpri-1.2.7.tar cd ./zaptel-1.2.25 -wget http://www.freedomphones.net/files/newt-0.51.6.tar.gz +wget http://downloads.vicidial.com/packages/newt-0.51.6.tar.gz gunzip newt-0.51.6.tar.gz tar xvf newt-0.51.6.tar cd newt-0.51.6 diff --git a/docs/SCRATCH_INSTALL.txt b/docs/SCRATCH_INSTALL.txt index 181f8738..55e632cb 100644 --- a/docs/SCRATCH_INSTALL.txt +++ b/docs/SCRATCH_INSTALL.txt @@ -461,7 +461,7 @@ following modules first: (say YES if asked to install prerequisites) - install Spreadsheet::ParseExcel - then quit cpan, you are done 5. Go to http://asterisk.gnuinter.net/ and download the asterisk-perl module -(backup link: http://www.freedomphones.net/files/asterisk-perl-0.08.tar.gz) +(backup link: http://downloads.vicidial.com/packages/asterisk-perl-0.08.tar.gz) NOTE: Do NOT use the 0.09 version, it does not work with VICIDIAL - to install this directly on the command line type: - cd /usr/local @@ -1013,7 +1013,7 @@ them: configure it. NOTES: If you want to install zttool diagnostics you may need the newt package installed: - - wget http://www.freedomphones.net/files/newt-0.51.6.tar.gz + - wget http://downloads.vicidial.com/packages/newt-0.51.6.tar.gz - gunzip newt-0.51.6.tar.gz - tar xvf newt-0.51.6.tar - cd newt-0.51.6 @@ -1646,7 +1646,7 @@ follow the steps below: - http://www.virbiage.com/firefly/download/firefly-thirdparty.exe MIRRORS: - http://mirror.isp.net.au/ftp/pub/firefly/firefly-thirdparty.exe - - http://www.freedomphones.net/files/firefly-thirdparty.exe + - http://downloads.vicidial.com/softphones/firefly-thirdparty.exe IDEFISK: - http://www.asteriskguru.com/idefisk/ - Install the application @@ -1705,7 +1705,7 @@ package(as of this writing it is 2.0.4.1) package, it's the conf.gsm file(this is the half-hour music file that we use to put people on hold). I have a free classical music file that is available free for download at the following two sites: - http://www.freedomphones.net/conf.gsm + http://downloads.vicidial.com/sounds/conf.gsm http://astguiclient.sf.net/conf.gsm Once you have downloaded it, you will need to copy it to this folder: /var/lib/asterisk/sounds/ @@ -1713,7 +1713,7 @@ free for download at the following two sites: 'cp /var/lib/asterisk/sounds/conf.gsm /var/lib/asterisk/sounds/park.gsm' Here are the steps spelled out: cd /var/lib/asterisk/sounds - wget http://www.freedomphones.net/conf.gsm + wget http://downloads.vicidial.com/sounds/conf.gsm cp conf.gsm park.gsm - you are done diff --git a/www/agc/vdc_db_query.php b/www/agc/vdc_db_query.php index c66ae0cd..d9d6ca06 100644 --- a/www/agc/vdc_db_query.php +++ b/www/agc/vdc_db_query.php @@ -149,10 +149,11 @@ # 80424-0442 - Added non_latin lookup from system_settings # 80430-1006 - Added term_reason for vicidial_log and vicidial_closer_log # 80430-1957 - Changed to leave lead_id in vicidial_live_agents record until after dispo +# 80630-2153 - Added queue_log logging for Manual dial calls # -$version = '2.0.5-73'; -$build = '80430-1957'; +$version = '2.0.5-74'; +$build = '80630-2153'; require("dbconnect.php"); @@ -803,6 +804,53 @@ if ($ACTION == 'manDiaLnextCaLL') $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + + ############################################# + ##### START QUEUEMETRICS LOGGING LOOKUP ##### + $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $qm_conf_ct = mysql_num_rows($rslt); + $i=0; + while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $enable_queuemetrics_logging = $row[0]; + $queuemetrics_server_ip = $row[1]; + $queuemetrics_dbname = $row[2]; + $queuemetrics_login = $row[3]; + $queuemetrics_pass = $row[4]; + $queuemetrics_log_id = $row[5]; + $i++; + } + ##### END QUEUEMETRICS LOGGING LOOKUP ##### + ########################################### + if ($enable_queuemetrics_logging > 0) + { + $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); + mysql_select_db("$queuemetrics_dbname", $linkB); + + # UNPAUSEALL + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='UNPAUSEALL',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + $affected_rows = mysql_affected_rows($linkB); + + # ENTERQUEUE + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='NONE',verb='ENTERQUEUE',data2='$phone_number',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + $affected_rows = mysql_affected_rows($linkB); + + # CONNECT + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='Agent/$user',verb='CONNECT',data1='0',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + $affected_rows = mysql_affected_rows($linkB); + + mysql_close($linkB); + } + } $comments = eregi_replace("\r",'',$comments); @@ -963,6 +1011,53 @@ if ($ACTION == 'manDiaLonly') $rslt=mysql_query($stmt, $link); echo "$MqueryCID\n"; + + ############################################# + ##### START QUEUEMETRICS LOGGING LOOKUP ##### + $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $qm_conf_ct = mysql_num_rows($rslt); + $i=0; + while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $enable_queuemetrics_logging = $row[0]; + $queuemetrics_server_ip = $row[1]; + $queuemetrics_dbname = $row[2]; + $queuemetrics_login = $row[3]; + $queuemetrics_pass = $row[4]; + $queuemetrics_log_id = $row[5]; + $i++; + } + ##### END QUEUEMETRICS LOGGING LOOKUP ##### + ########################################### + if ($enable_queuemetrics_logging > 0) + { + $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); + mysql_select_db("$queuemetrics_dbname", $linkB); + + # UNPAUSEALL + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='UNPAUSEALL',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + $affected_rows = mysql_affected_rows($linkB); + + # ENTERQUEUE + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='NONE',verb='ENTERQUEUE',data2='$phone_number',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + $affected_rows = mysql_affected_rows($linkB); + + # CONNECT + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='Agent/$user',verb='CONNECT',data1='0',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + $affected_rows = mysql_affected_rows($linkB); + + mysql_close($linkB); + } + } } @@ -2438,7 +2533,7 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) ########################################### if ($enable_queuemetrics_logging > 0) { - if (ereg('READY',$stage)) {$QMstatus='UNPAUSEALL';} + if ( (ereg('READY',$stage)) or (ereg('CLOSER',$stage)) ) {$QMstatus='UNPAUSEALL';} if (ereg('PAUSE',$stage)) {$QMstatus='PAUSEALL';} $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); mysql_select_db("$queuemetrics_dbname", $linkB); diff --git a/www/agc/vicidial.php b/www/agc/vicidial.php index cbd18c9d..4f57b336 100644 --- a/www/agc/vicidial.php +++ b/www/agc/vicidial.php @@ -179,10 +179,11 @@ # 80519-1425 - Added calls in queue display # 80523-1630 - Added Tiemclock links # 80625-0047 - Added U option for gender, added date/phone display options +# 80630-2210 - Added queue_log entries for Manual Dial # -$version = '2.0.5-157'; -$build = '80625-0047'; +$version = '2.0.5-158'; +$build = '80630-2210'; require("dbconnect.php"); @@ -3868,13 +3869,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MDOnextResponse = xmlhttp.responseText; var MDOnextResponse_array=MDOnextResponse.split("\n"); - MDnextCID = MDOnextResponse_array[0]; + MDnextCID = MDOnextResponse_array[0]; if (MDnextCID == " CALL NOT PLACED") { alert("call was not placed, there was an error:\n" + MDOnextResponse); } else { + LasTCID = MDOnextResponse_array[0]; MD_channel_look=1; custchannellive=1; diff --git a/www/vicidial/AST_timeonVDADall.php b/www/vicidial/AST_timeonVDADall.php index a60a082b..d5abe8ba 100644 --- a/www/vicidial/AST_timeonVDADall.php +++ b/www/vicidial/AST_timeonVDADall.php @@ -986,7 +986,7 @@ $talking_to_print = mysql_num_rows($rslt); if ($call_time_M_int >= 5) {$G=''; $EG='';} } } - if (eregi("PAUSED",$Astatus[$i])) + if ($Lstatus=='PAUSED') { if ($call_time_M_int >= 360) {$j++; continue;} @@ -1002,7 +1002,7 @@ $talking_to_print = mysql_num_rows($rslt); # if ( (strlen($Acall_server_ip[$i])> 4) and ($Acall_server_ip[$i] != "$Aserver_ip[$i]") ) # {$G=''; $EG='';} - if ( (eregi("INCALL",$status)) or (eregi("QUEUE",$status)) or (eregi("DISPO",$status)) ) {$agent_incall++; $agent_total++;} + if ( (eregi("INCALL",$status)) or (eregi("QUEUE",$status)) ) {$agent_incall++; $agent_total++;} if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$agent_ready++; $agent_total++;} if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) { diff --git a/www/vicidial/timeclock_edit.php b/www/vicidial/timeclock_edit.php index 97d7e049..04e3c17f 100644 --- a/www/vicidial/timeclock_edit.php +++ b/www/vicidial/timeclock_edit.php @@ -15,28 +15,28 @@ 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["LOGINbegin_date"])) {$LOGINbegin_date=$_GET["LOGINbegin_date"];} - elseif (isset($_POST["LOGINbegin_date"])) {$LOGINbegin_date=$_POST["LOGINbegin_date"];} -if (isset($_GET["LOGINend_date"])) {$LOGINend_date=$_GET["LOGINend_date"];} - elseif (isset($_POST["LOGINend_date"])) {$LOGINend_date=$_POST["LOGINend_date"];} -if (isset($_GET["LOGOUTbegin_date"])) {$LOGOUTbegin_date=$_GET["LOGOUTbegin_date"];} - elseif (isset($_POST["LOGOUTbegin_date"])) {$LOGOUTbegin_date=$_POST["LOGOUTbegin_date"];} -if (isset($_GET["LOGOUTend_date"])) {$LOGOUTend_date=$_GET["LOGOUTend_date"];} - elseif (isset($_POST["LOGOUTend_date"])) {$LOGOUTend_date=$_POST["LOGOUTend_date"];} -if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} - elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["stage"])) {$stage=$_GET["stage"];} - elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} +if (isset($_GET["LOGINepoch"])) {$LOGINepoch=$_GET["LOGINepoch"];} + elseif (isset($_POST["LOGINepoch"])) {$LOGINepoch=$_POST["LOGINepoch"];} +if (isset($_GET["LOGOUTepoch"])) {$LOGOUTepoch=$_GET["LOGOUTepoch"];} + elseif (isset($_POST["LOGOUTepoch"])) {$LOGOUTepoch=$_POST["LOGOUTepoch"];} +if (isset($_GET["notes"])) {$notes=$_GET["notes"];} + elseif (isset($_POST["notes"])) {$notes=$_POST["notes"];} +if (isset($_GET["LOGINevent_id"])) {$LOGINevent_id=$_GET["LOGINevent_id"];} + elseif (isset($_POST["LOGINevent_id"])) {$LOGINevent_id=$_POST["LOGINevent_id"];} +if (isset($_GET["LOGOUTevent_id"])) {$LOGOUTevent_id=$_GET["LOGOUTevent_id"];} + elseif (isset($_POST["LOGOUTevent_id"])) {$LOGOUTevent_id=$_POST["LOGOUTevent_id"];} +if (isset($_GET["user"])) {$user=$_GET["user"];} + elseif (isset($_POST["user"])) {$user=$_POST["user"];} +if (isset($_GET["stage"])) {$stage=$_GET["stage"];} + elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} if (isset($_GET["timeclock_id"])) {$timeclock_id=$_GET["timeclock_id"];} elseif (isset($_POST["timeclock_id"])) {$timeclock_id=$_POST["timeclock_id"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["submit"])) {$submit=$_GET["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} +if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} + elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### @@ -151,6 +151,50 @@ $browser = getenv("HTTP_USER_AGENT"); if (strlen($LOGOUTevent_id)<1) {$invalid_record++;} + ### + if ($invalid_record < 1) + { + $stmt="SELECT event_epoch,event_date,login_sec,event,user,user_group,ip_address,shift_id,notes,manager_user,manager_ip,event_datestamp from vicidial_timeclock_log where timeclock_id='$LOGINevent_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $tc_logs_to_print = mysql_num_rows($rslt); + if ($tc_logs_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $LOGINevent_epoch = $row[0]; + $LOGINevent_date = $row[1]; + $LOGINlogin_sec = $row[2]; + $LOGINevent = $row[3]; + $LOGINuser = $row[4]; + $LOGINuser_group = $row[5]; + $LOGINip_address = $row[6]; + $LOGINshift_id = $row[7]; + $LOGINnotes = $row[8]; + $LOGINmanager_user = $row[9]; + $LOGINmanager_ip = $row[10]; + $LOGINevent_datestamp = $row[11]; + } + $stmt="SELECT event_epoch,event_date,login_sec,event,user,user_group,ip_address,shift_id,notes,manager_user,manager_ip,event_datestamp from vicidial_timeclock_log where timeclock_id='$LOGOUTevent_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $tc_logs_to_print = mysql_num_rows($rslt); + if ($tc_logs_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $LOGOUTevent_epoch = $row[0]; + $LOGOUTevent_date = $row[1]; + $LOGOUTlogin_sec = $row[2]; + $LOGOUTevent = $row[3]; + $LOGOUTuser = $row[4]; + $LOGOUTuser_group = $row[5]; + $LOGOUTip_address = $row[6]; + $LOGOUTshift_id = $row[7]; + $LOGOUTnotes = $row[8]; + $LOGOUTmanager_user = $row[9]; + $LOGOUTmanager_ip = $row[10]; + $LOGOUTevent_datestamp =$row[11]; + } + } } @@ -158,14 +202,85 @@ $browser = getenv("HTTP_USER_AGENT"); ?> -VICIDIAL ADMIN: Timeclock Record Edit +VICIDIAL ADMIN: Timeclock Record Edit <? +echo "\n"; echo "\n"; +echo "
- +
" ?>   VICIDIAL ADMIN: Timeclock Record Edit for  
@@ -177,6 +292,19 @@ echo "
" ?>   VICIDIAL ADMIN: Timeclock Record Edit for  
\n"; + echo "$LOGOUTepoch
\n"; + echo "$notes
\n"; + echo "$LOGINevent_id
\n"; + echo "$LOGOUTevent_id
\n"; + echo "$LOGINuser
\n"; + exit; + } + + ##### BEGIN TIMECLOCK LOGOUT OF A USER ##### if ( ( ($stage == "tc_log_user_OUT") or ($stage == "tc_log_user_IN") ) and ($modify_timeclock_log > 0) ) { @@ -344,15 +472,69 @@ echo "\n
"; if ($modify_timeclock_log > 0) { - $LOGINevent_id = $timeclock_id; - $LOGOUTevent_id = $tcid_link; + $LOGINevent_id = $timeclock_id; + $LOGOUTevent_id = $tcid_link; + + $event_hours = ($LOGINlogin_sec / 3600); + $event_hours_int = round($event_hours, 2); + $event_hours_int = intval("$event_hours_int"); + $event_minutes = ($event_hours - $event_hours_int); + $event_minutes = ($event_minutes * 60); + $event_minutes_int = round($event_minutes, 0); + if ($event_minutes_int < 10) {$event_minutes_int = "0$event_minutes_int";} + + $stmt="SELECT full_name from vicidial_users where user='$LOGINuser';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $full_name = $row[0]; echo "

\n"; - echo "
\n"; + echo "\n"; echo "\n"; echo "\n"; - echo "\n"; - echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "
\n"; + echo "        USER: $LOGINuser ($full_name)         \n"; + echo "HOURS: $event_hours_int:$event_minutes_int \n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
LOGIN TIME:
TIMECLOCK ID: $LOGINevent_id
USER GROUP: $LOGINuser_group
IP ADDRESS: $LOGINip_address
MANAGER USER: $LOGINmanager_user
MANAGER IP: $LOGINmanager_ip
NOTES: $LOGINnotes
LAST CHANGE: $LOGINevent_datestamp
\n"; + + echo "
        \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
LOGOUT TIME:
TIMECLOCK ID: $LOGOUTevent_id
USER GROUP: $LOGOUTuser_group
IP ADDRESS: $LOGOUTip_address
MANAGER USER: $LOGOUTmanager_user
MANAGER IP: $LOGOUTmanager_ip
NOTES: $LOGOUTnotes
LAST CHANGE: $LOGOUTevent_datestamp
\n"; + echo "
\n"; + echo "NEW NOTES: \n"; + echo "
\n"; + echo "
\n"; + echo "
\n"; echo "

\n"; }