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
This commit is contained in:
mattf
2008-06-04 08:05:43 +00:00
parent 4d6fc32df1
commit fe85f88747
9 changed files with 61 additions and 25 deletions
+2
View File
@@ -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
@@ -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);
}
}
@@ -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--;
@@ -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
@@ -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 "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>
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 = "<font class=\"queue_text_red\">Calls in Queue: $RingCalls</font>";}
else {$RingCalls = "<font class=\"queue_text\">Calls in Queue: $RingCalls</font>";}
### 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 "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>
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;
@@ -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 = '<? echo $callholdstatus ?>'
var agentcallsstatus = '<? echo $agentcallsstatus ?>'
var campagentstatctmax = '<? echo $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: <?=$SSheight ?>px; width: <?=$SDwidth ?>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 "</head>\n";
<TR VALIGN=TOP ALIGN=LEFT>
<TD ALIGN=LEFT WIDTH=115><A HREF="#" onclick="MainPanelToFront('NO');"><IMG SRC="./images/vdc_tab_vicidial.gif" ALT="VICIDIAL" WIDTH=115 HEIGHT=30 BORDER=0></A></TD>
<TD ALIGN=LEFT WIDTH=105><A HREF="#" onclick="ScriptPanelToFront();"><IMG SRC="./images/vdc_tab_script.gif" ALT="SCRIPT" WIDTH=105 HEIGHT=30 BORDER=0></A></TD>
<TD WIDTH=<?=$HSwidth ?> VALIGN=MIDDLE ALIGN=CENTER><font class="body_text"> &nbsp; <span id=status>LIVE</span> &nbsp; &nbsp; session ID: <span id=sessionIDspan></span></TD>
<TD WIDTH=<?=$HSwidth ?> VALIGN=MIDDLE ALIGN=CENTER><font class="body_text"> &nbsp; <span id=status>LIVE</span> &nbsp; &nbsp; session ID: <span id=sessionIDspan></span> &nbsp; &nbsp; <span id=AgentStatusCalls></span></TD>
<TD WIDTH=109><IMG SRC="./images/agc_live_call_OFF.gif" NAME=livecall ALT="Live Call" WIDTH=109 HEIGHT=30 BORDER=0></TD>
</TR></TABLE>
</span>
@@ -6530,7 +6543,7 @@ echo "</head>\n";
<span style="position:absolute;left:35px;top:<?=$CBheight ?>px;z-index:20;" id="AgentStatusSpan"><font class="body_text">
Your Status: <span id="AgentStatusStatus"></span> <BR>Calls Dialing: <span id="AgentStatusCalls"></span>
Your Status: <span id="AgentStatusStatus"></span> <BR>Calls Dialing: <span id="AgentStatusDiaLs"></span>
</font></span>