From fe85f887470b01ed3c6fd46e7fbf3047c028bba4 Mon Sep 17 00:00:00 2001 From: mattf Date: Wed, 4 Jun 2008 08:05:43 +0000 Subject: [PATCH] add calls in queue display to vicidial.php in branch 2.0.4 reduce delays in dialing and actions sending scripts git-svn-id: svn://192.168.202.10@888 3d104415-ff17-0410-8863-d5cf3c621b8a --- agc_2-X/branches/agc_2.0.4/UPGRADE | 2 ++ .../branches/agc_2.0.4/bin/AST_VDauto_dial.pl | 4 +-- .../agc_2.0.4/bin/AST_manager_send.pl | 8 ++--- .../TO_BE_TRANSLATED_2.0.4.txt | 1 + .../agc_2.0.4/www/agc/conf_exten_check.php | 26 +++++++++++++++-- .../branches/agc_2.0.4/www/agc/vicidial.php | 29 ++++++++++++++----- agc_2-X/trunk/bin/AST_VDauto_dial.pl | 4 +-- agc_2-X/trunk/bin/AST_VDauto_dial_FILL.pl | 2 +- agc_2-X/trunk/bin/AST_manager_send.pl | 10 +++---- 9 files changed, 61 insertions(+), 25 deletions(-) diff --git a/agc_2-X/branches/agc_2.0.4/UPGRADE b/agc_2-X/branches/agc_2.0.4/UPGRADE index 8bce9fb0..e7c77cbc 100644 --- a/agc_2-X/branches/agc_2.0.4/UPGRADE +++ b/agc_2-X/branches/agc_2.0.4/UPGRADE @@ -35,6 +35,8 @@ NOTE: Upgrading from 1.1.12-3 to 2.0.1 is at the bottom 7. Several code changes for better UTF8 compatibility with the database as well as special character leads in the agent screen, lead loading +8. Added calls in queue display to vicidial.php agent screen + diff --git a/agc_2-X/branches/agc_2.0.4/bin/AST_VDauto_dial.pl b/agc_2-X/branches/agc_2.0.4/bin/AST_VDauto_dial.pl index ae4822bc..ceae559c 100644 --- a/agc_2-X/branches/agc_2.0.4/bin/AST_VDauto_dial.pl +++ b/agc_2-X/branches/agc_2.0.4/bin/AST_VDauto_dial.pl @@ -847,8 +847,8 @@ while($one_day_interval > 0) $stmtA = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,callerid,phone_code,phone_number,call_time,call_type,alt_dial) values('$DBIPaddress[$user_CIPct]','$DBIPcampaign[$user_CIPct]','SENT','$lead_id','$VqueryCID','$phone_code','$phone_number','$SQLdate','OUT','$alt_dial')"; $affected_rows = $dbhA->do($stmtA); - ### sleep for a tenth of a second to not flood the server with new calls - usleep(1*100*1000); + ### sleep for 5 hundredths of a second to not flood the server with new calls + usleep(1*50*1000); } } diff --git a/agc_2-X/branches/agc_2.0.4/bin/AST_manager_send.pl b/agc_2-X/branches/agc_2.0.4/bin/AST_manager_send.pl index 402d08fc..79c14c76 100644 --- a/agc_2-X/branches/agc_2.0.4/bin/AST_manager_send.pl +++ b/agc_2-X/branches/agc_2.0.4/bin/AST_manager_send.pl @@ -99,7 +99,7 @@ eventLogger($conf{PATHlogs}, 'process', $event_string); my $one_day_interval = 90; # 1 day loops for 3 months while ($one_day_interval > 0) { - my $endless_loop = 864000; # 10 days at .20 seconds per loop + my $endless_loop = 1728000; # 2 days at .10 seconds per loop my $affected_rows; my $NEW_actions; while ($endless_loop > 0) { @@ -224,11 +224,11 @@ while ($one_day_interval > 0) { } if ($affected_rows) { + ### sleep for 1 hundredth of a second + usleep(1*10*1000); + } else { ### sleep for 10 hundredths of a second usleep(1*100*1000); - } else { - ### sleep for 20 hundredths of a second - usleep(1*200*1000); } $endless_loop--; diff --git a/agc_2-X/branches/agc_2.0.4/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.4.txt b/agc_2-X/branches/agc_2.0.4/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.4.txt index e8b142ae..a47ef12e 100644 --- a/agc_2-X/branches/agc_2.0.4/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.4.txt +++ b/agc_2-X/branches/agc_2.0.4/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.4.txt @@ -136,6 +136,7 @@ Also in this section is the ability to give the agent a rank for each inbound gr ############################################################ CLIENT PLEASE CLICK THE LOGOUT LINK TO LOG OUT NEXT TIME|| +Calls in Queue:|| ############################################################ MANAGER Manual diff --git a/agc_2-X/branches/agc_2.0.4/www/agc/conf_exten_check.php b/agc_2-X/branches/agc_2.0.4/www/agc/conf_exten_check.php index f88500e0..474ce8a4 100644 --- a/agc_2-X/branches/agc_2.0.4/www/agc/conf_exten_check.php +++ b/agc_2-X/branches/agc_2.0.4/www/agc/conf_exten_check.php @@ -36,6 +36,7 @@ # 70319-1542 - Added agent disabled display function # 71122-0205 - Added vicidial_live_agent status output # 80424-0442 - Added non_latin lookup from system_settings +# 80519-1425 - Added calls-in-queue tally # require("dbconnect.php"); @@ -96,6 +97,10 @@ if (!isset($format)) {$format="text";} if (!isset($ACTION)) {$ACTION="refresh";} if (!isset($client)) {$client="agc";} +$Alogin='N'; +$RingCalls='N'; +$DiaLCalls='N'; + $version = '2.0.4-12'; $build = '71122-0205'; $StarTtime = date("U"); @@ -207,30 +212,45 @@ echo " if ($campagentstdisp == 'YES') { ### grab the status of this agent to display - $stmt="SELECT status,campaign_id from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; + $stmt="SELECT status,campaign_id,closer_campaigns from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $Alogin=$row[0]; $Acampaign=$row[1]; + $AccampSQL=$row[2]; + $AccampSQL = ereg_replace(' -','', $AccampSQL); + $AccampSQL = ereg_replace(' ',"','", $AccampSQL); ### grab the number of calls being placed from this server and campaign - $stmt="SELECT count(*) from vicidial_auto_calls where server_ip='$server_ip' and status NOT IN('XFER') and campaign_id='$Acampaign';"; + $stmt="SELECT count(*) from vicidial_auto_calls where status IN('LIVE') and ( (campaign_id='$Acampaign') or (campaign_id IN('$AccampSQL')) );"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $RingCalls=$row[0]; + if ($RingCalls > 0) {$RingCalls = "Calls in Queue: $RingCalls";} + else {$RingCalls = "Calls in Queue: $RingCalls";} + + ### grab the number of calls being placed from this server and campaign + $stmt="SELECT count(*) from vicidial_auto_calls where status NOT IN('XFER') and ( (campaign_id='$Acampaign') or (campaign_id IN('$AccampSQL')) );"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $DiaLCalls=$row[0]; + } else { $Alogin='N'; $RingCalls='N'; + $DiaLCalls='N'; } } else { $Alogin='N'; $RingCalls='N'; + $DiaLCalls='N'; ### update the vicidial_live_agents every second with a new random number so it is shown to be alive $stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';"; @@ -242,7 +262,7 @@ echo " if ($Acount < 1) {$Alogin='DEAD_VLA';} if ($AexternalDEAD > 0) {$Alogin='DEAD_EXTERNAL';} - echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Logged-in: ' . $Alogin . '|CampCalls: ' . $RingCalls . '|Status: ' . $Astatus . "|\n"; + echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Logged-in: ' . $Alogin . '|CampCalls: ' . $RingCalls . '|Status: ' . $Astatus . '|DiaLCalls: ' . $DiaLCalls . "|\n"; } $total_conf=0; diff --git a/agc_2-X/branches/agc_2.0.4/www/agc/vicidial.php b/agc_2-X/branches/agc_2.0.4/www/agc/vicidial.php index 2a11c7f1..9a45f3e1 100644 --- a/agc_2-X/branches/agc_2.0.4/www/agc/vicidial.php +++ b/agc_2-X/branches/agc_2.0.4/www/agc/vicidial.php @@ -176,10 +176,11 @@ # 80402-0121 - Fixes for Manual Dial hangups and transfers # 80428-0413 - UTF8 changes and testing # 80507-0932 - Fixed Script display bug (+ instead of space) +# 80519-1425 - Added calls in queue display # -$version = '2.0.4-147'; -$build = '80507-0932'; +$version = '2.0.4-148'; +$build = '80519-1425'; require("dbconnect.php"); @@ -271,8 +272,9 @@ $multi_line_comments = '1'; # set to 1 to allow multi-line comment box $user_login_first = '0'; # set to 1 to have the vicidial_user login before the phone login $view_scripts = '1'; # set to 1 to show the SCRIPTS tab $dispo_check_all_pause = '0'; # set to 1 to allow for persistent pause after dispo -$agentcallsstatus = '0'; # set to 1 to show agent status and call count - $campagentstatctmax = '0'; # Number of seconds for campaign call and agent stats +$callholdstatus = '1'; # set to 1 to show calls on hold count +$agentcallsstatus = '0'; # set to 1 to show agent status and call dialed count + $campagentstatctmax = '3'; # Number of seconds for campaign call and agent stats $show_campname_pulldown = '1'; # set to 1 to show campaign name on login pulldown $webform_sessionname = '1'; # set to 1 to include the session_name in webform URL $local_consult_xfers = '1'; # set to 1 to send consultative transfers from original server @@ -1765,6 +1767,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var AgainCalLSecondS = ''; var AgaiNCalLCID = ''; var CB_count_check = 60; + var callholdstatus = '' var agentcallsstatus = '' var campagentstatctmax = '' var campagentstatct = '0'; @@ -2208,7 +2211,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (typeof(xmlhttprequestcheckconf) == "undefined") { //alert (xmlhttprequestcheckconf == xmlhttpSendConf); custchannellive--; - if (agentcallsstatus == '1') + if ( (agentcallsstatus == '1') || (callholdstatus == '1') ) { campagentstatct++; if (campagentstatct > campagentstatctmax) @@ -2268,12 +2271,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} UnixTime = parseInt(UnixTime); UnixTimeMS = (UnixTime * 1000); t.setTime(UnixTimeMS); - if ( (agentcallsstatus == '1') || (vicidial_agent_disable != 'NOT_ACTIVE') ) + if ( (callholdstatus == '1') || (agentcallsstatus == '1') || (vicidial_agent_disable != 'NOT_ACTIVE') ) { var Alogin_array = check_time_array[2].split("Logged-in: "); var AGLogiN = Alogin_array[1]; var CamPCalLs_array = check_time_array[3].split("CampCalls: "); var CamPCalLs = CamPCalLs_array[1]; + var DiaLCalLs_array = check_time_array[5].split("DiaLCalls: "); + var DiaLCalLs = DiaLCalLs_array[1]; if (AGLogiN != 'N') { document.getElementById("AgentStatusStatus").innerHTML = AGLogiN; @@ -2282,6 +2287,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { document.getElementById("AgentStatusCalls").innerHTML = CamPCalLs; } + if (DiaLCalLs != 'N') + { + document.getElementById("AgentStatusDiaLs").innerHTML = DiaLCalLs; + } if ( (AGLogiN == 'DEAD_VLA') && ( (vicidial_agent_disable == 'LIVE_AGENT') || (vicidial_agent_disable == 'ALL') ) ) { showDiv('AgenTDisablEBoX'); @@ -5871,6 +5880,8 @@ else // if ( (agentcall_manual != '1') && (starting_dial_level > 0) ) if (agentcall_manual != '1') {hideDiv('ManuaLDiaLButtons');} + if (callholdstatus != '1') + {hideDiv('AgentStatusCalls');} if (agentcallsstatus != '1') {hideDiv('AgentStatusSpan');} if ( (auto_dial_level != 0) || (manual_dial_preview != 1) ) @@ -6398,6 +6409,8 @@ else div.scroll_script {height: px; width: px; background: #FFF5EC; overflow: scroll; font-size: 12px; font-family: sans-serif;} div.text_input {overflow: auto; font-size: 10px; font-family: sans-serif;} .body_text {font-size: 13px; font-family: sans-serif;} + .queue_text_red {font-size: 12px; font-family: sans-serif; font-weight: bold; color: red} + .queue_text {font-size: 12px; font-family: sans-serif; color: black} .preview_text {font-size: 13px; font-family: sans-serif; background: #CCFFCC} .preview_text_red {font-size: 13px; font-family: sans-serif; background: #FFCCCC} .body_small {font-size: 11px; font-family: sans-serif;} @@ -6438,7 +6451,7 @@ echo "\n"; VICIDIAL SCRIPT - VALIGN=MIDDLE ALIGN=CENTER>   LIVE     session ID: + VALIGN=MIDDLE ALIGN=CENTER>   LIVE     session ID:     Live Call @@ -6530,7 +6543,7 @@ echo "\n"; -Your Status:
Calls Dialing: +Your Status:
Calls Dialing:
diff --git a/agc_2-X/trunk/bin/AST_VDauto_dial.pl b/agc_2-X/trunk/bin/AST_VDauto_dial.pl index 3b541a15..6ddf48fa 100644 --- a/agc_2-X/trunk/bin/AST_VDauto_dial.pl +++ b/agc_2-X/trunk/bin/AST_VDauto_dial.pl @@ -851,8 +851,8 @@ while($one_day_interval > 0) $stmtA = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,callerid,phone_code,phone_number,call_time,call_type,alt_dial,queue_priority) values('$DBIPaddress[$user_CIPct]','$DBIPcampaign[$user_CIPct]','SENT','$lead_id','$VqueryCID','$phone_code','$phone_number','$SQLdate','OUT','$alt_dial','$DBIPqueue_priority[$user_CIPct]')"; $affected_rows = $dbhA->do($stmtA); - ### sleep for a tenth of a second to not flood the server with new calls - usleep(1*100*1000); + ### sleep for a five hundredths of a second to not flood the server with new calls + usleep(1*50*1000); } } diff --git a/agc_2-X/trunk/bin/AST_VDauto_dial_FILL.pl b/agc_2-X/trunk/bin/AST_VDauto_dial_FILL.pl index c66af54a..2bcb71b8 100644 --- a/agc_2-X/trunk/bin/AST_VDauto_dial_FILL.pl +++ b/agc_2-X/trunk/bin/AST_VDauto_dial_FILL.pl @@ -701,7 +701,7 @@ while($one_day_interval > 0) $stmtA = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,callerid,phone_code,phone_number,call_time,call_type,alt_dial,queue_priority) values('$DB_camp_server_server_ip[$server_CIPct]','$DBfill_campaign[$camp_CIPct]','SENT','$lead_id','$VqueryCID','$phone_code','$phone_number','$SQLdate','OUTBALANCE','$alt_dial','$DBIPqueue_priority[$camp_CIPct]')"; $affected_rows = $dbhA->do($stmtA); - ### sleep for a tenth of a second to not flood the server with new calls + ### sleep for 2.5 hundredths of a second to not flood the server with new calls usleep(1*25*1000); } diff --git a/agc_2-X/trunk/bin/AST_manager_send.pl b/agc_2-X/trunk/bin/AST_manager_send.pl index cb80cb66..b6c9a9e3 100644 --- a/agc_2-X/trunk/bin/AST_manager_send.pl +++ b/agc_2-X/trunk/bin/AST_manager_send.pl @@ -100,7 +100,7 @@ eventLogger($conf{PATHlogs}, 'process', $event_string); my $one_day_interval = 182; # 2 day loops for 12 months while ($one_day_interval > 0) { - my $endless_loop = 864000; # 2 days at .20 seconds per loop + my $endless_loop = 1728000; # 2 days at .10 seconds per loop my $affected_rows; my $NEW_actions; while ($endless_loop > 0) { @@ -226,11 +226,11 @@ while ($one_day_interval > 0) { } if ($affected_rows) { - ### sleep for 5 hundredths of a second if just send an ACTION - usleep(1*50*1000); + ### sleep for 1 hundredth of a second if just send an ACTION + usleep(1*10*1000); } else { - ### sleep for 20 hundredths of a second if no actions sent - usleep(1*200*1000); + ### sleep for 10 hundredths of a second if no actions sent + usleep(1*100*1000); } $endless_loop--;