remote agent DROP status fix
italian translation build update git-svn-id: svn://192.168.202.10@990 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -791,6 +791,11 @@ if ($ACTION=="RedirectXtraCXNeW")
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$exten = $row[0];
|
||||
|
||||
if ( (ereg("^8300",$extension)) and ($protocol == 'Local') )
|
||||
{
|
||||
$extension = "$extension$user";
|
||||
}
|
||||
|
||||
$stmtD="UPDATE vicidial_conferences set extension='$protocol/$extension' where server_ip='$server_ip' and conf_exten='$exten' limit 1;";
|
||||
if ($format=='debug') {echo "\n<!-- $stmtD -->";}
|
||||
$rslt=mysql_query($stmtD, $link);
|
||||
|
||||
@@ -1753,7 +1753,7 @@ if ($stage == "end")
|
||||
$CLuniqueid = $row[9];
|
||||
}
|
||||
|
||||
$CLstage = preg_replace("/XFER|-/",'',$CLstage);
|
||||
$CLstage = preg_replace("/XFER|CLOSER|-/",'',$CLstage);
|
||||
if ($CLstage < 0.25) {$CLstage=0;}
|
||||
|
||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$VDcampaign_id',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$length_in_sec',data3='1',serverid='$queuemetrics_log_id';";
|
||||
@@ -1828,6 +1828,7 @@ if ($stage == "end")
|
||||
else
|
||||
{
|
||||
$SQLterm = "term_reason='$term_reason'";
|
||||
$QL_term='';
|
||||
|
||||
if ( (ereg("NONE",$term_reason)) or (ereg("NONE",$VDterm_reason)) or (strlen($VDterm_reason) < 1) )
|
||||
{
|
||||
@@ -1849,6 +1850,7 @@ if ($stage == "end")
|
||||
else
|
||||
{
|
||||
$SQLterm = "term_reason='AGENT'";
|
||||
$QL_term = 'COMPLETEAGENT';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1857,6 +1859,26 @@ if ($stage == "end")
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
|
||||
if ( (strlen($QL_term) > 0) and ($leaving_threeway > 0) )
|
||||
{
|
||||
$stmt="SELECT count(*) from queue_log where call_id='$MDnextCID' and verb='COMPLETEAGENT' and queue='$VDcampaign_id';";
|
||||
$rslt=mysql_query($stmt, $linkB);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$VAC_cc_ct = mysql_num_rows($rslt);
|
||||
if ($VAC_cc_ct > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$agent_complete = $row[0];
|
||||
}
|
||||
if ($agent_complete < 1)
|
||||
{
|
||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MDnextCID',queue='$VDcampaign_id',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$length_in_sec',data3='1',serverid='$queuemetrics_log_id';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $linkB);
|
||||
$affected_rows = mysql_affected_rows($linkB);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -199,10 +199,11 @@
|
||||
# 81015-0405 - Fixed bug related to hangups on 3way calls
|
||||
# 81016-0703 - Changed leave 3way to allow function at any time transfer-conf is available
|
||||
# 81020-1501 - Fixed bugs in queue_log logging
|
||||
# 81023-0411 - Added compatibility for dial-in agents using AGI, bug fixes
|
||||
#
|
||||
|
||||
$version = '2.0.5-178';
|
||||
$build = '81020-1501';
|
||||
$version = '2.0.5-179';
|
||||
$build = '81023-0411';
|
||||
|
||||
require("dbconnect.php");
|
||||
|
||||
@@ -1237,6 +1238,11 @@ else
|
||||
$extension = "$dialplan_number$AT$ext_context";
|
||||
}
|
||||
$SIP_user = "$protocol/$extension";
|
||||
$SIP_user_DiaL = "$protocol/$extension";
|
||||
if ( (ereg('8300',$dialplan_number)) and (strlen($dialplan_number)<5) and ($protocol == 'Local') )
|
||||
{
|
||||
$SIP_user = "$protocol/$extension$VD_login";
|
||||
}
|
||||
|
||||
$stmt="SELECT asterisk_version from servers where server_ip='$server_ip';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
@@ -1405,11 +1411,11 @@ else
|
||||
}
|
||||
|
||||
### insert a NUOVO record to the vicidial_manager table to be processed
|
||||
$stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$SIqueryCID','Channel: $SIP_user','Context: $ext_context','Exten: $session_id','Priority: 1','Callerid: $SIqueryCID','','','','','');";
|
||||
$stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$SIqueryCID','Channel: $SIP_user_DiaL','Context: $ext_context','Exten: $session_id','Priority: 1','Callerid: $SIqueryCID','','','','','');";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
print "<!-- call placed to session_id: $session_id from phone: $SIP_user -->\n";
|
||||
print "<!-- call placed to session_id: $session_id from phone: $SIP_user $SIP_user_DiaL -->\n";
|
||||
|
||||
if ($auto_dial_level > 0)
|
||||
{
|
||||
@@ -2205,15 +2211,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
|
||||
mainxfer_send_redirect('3WAY','','',tempvarattempt);
|
||||
|
||||
if (threeway_end == '0')
|
||||
{
|
||||
document.vicidial_form.xferchannel.value = '';
|
||||
xfercall_send_hangup();
|
||||
|
||||
document.vicidial_form.callchannel.value = '';
|
||||
document.vicidial_form.callserverip.value = '';
|
||||
dialedcall_send_hangup();
|
||||
}
|
||||
// if (threeway_end == '0')
|
||||
// {
|
||||
// document.vicidial_form.xferchannel.value = '';
|
||||
// xfercall_send_hangup();
|
||||
//
|
||||
// document.vicidial_form.callchannel.value = '';
|
||||
// document.vicidial_form.callserverip.value = '';
|
||||
// dialedcall_send_hangup();
|
||||
// }
|
||||
|
||||
if( document.images ) { document.images['livecall'].src = image_livecall_OFF.src;}
|
||||
}
|
||||
@@ -2266,7 +2272,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
if (taskFromConf == 'YES')
|
||||
{basic_originate_call(manual_string,'NO','YES',dial_conf_exten,'NO',taskFromConf,threeway_cid);}
|
||||
else
|
||||
{basic_originate_call(manual_string,'NO','NO');}
|
||||
{basic_originate_call(manual_string,'NO','NO','','','','1');}
|
||||
|
||||
MD_ring_secondS=0;
|
||||
}
|
||||
@@ -3396,7 +3402,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
|
||||
if (MDDiaLOverridEform.length > 0)
|
||||
{
|
||||
basic_originate_call(session_id,'NO','YES',MDDiaLOverridEform,'YES');
|
||||
basic_originate_call(session_id,'NO','YES',MDDiaLOverridEform,'YES','','1');
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -5617,13 +5623,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
{
|
||||
document.vicidial_form.conf_dtmf.value = CalL_XC_a_Dtmf;
|
||||
document.vicidial_form.xfernumber.value = CalL_XC_a_NuMber;
|
||||
basic_originate_call(CalL_XC_a_NuMber,'NO','YES',session_id,'YES');
|
||||
basic_originate_call(CalL_XC_a_NuMber,'NO','YES',session_id,'YES','','1');
|
||||
}
|
||||
function DtMf_PreSet_b_DiaL()
|
||||
{
|
||||
document.vicidial_form.conf_dtmf.value = CalL_XC_b_Dtmf;
|
||||
document.vicidial_form.xfernumber.value = CalL_XC_b_NuMber;
|
||||
basic_originate_call(CalL_XC_b_NuMber,'NO','YES',session_id,'YES');
|
||||
basic_originate_call(CalL_XC_b_NuMber,'NO','YES',session_id,'YES','','1');
|
||||
}
|
||||
|
||||
// ################################################################################
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
# 80709-0331 - Added time stats to call statuses
|
||||
# 80722-2149 - Added Status Category stats
|
||||
# 81015-0705 - Added IVR calls count
|
||||
# 81024-0037 - Added multi-select inbound-groups
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -34,6 +35,8 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
|
||||
elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];}
|
||||
if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];}
|
||||
elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];}
|
||||
if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
|
||||
elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];}
|
||||
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
@@ -84,13 +87,37 @@ $rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$groups_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
$LISTgroups[$i]='---NONE---';
|
||||
$i++;
|
||||
$groups_to_print++;
|
||||
while ($i < $groups_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$groups[$i] =$row[0];
|
||||
$LISTgroups[$i] =$row[0];
|
||||
$i++;
|
||||
}
|
||||
|
||||
$i=0;
|
||||
$group_string='|';
|
||||
$group_ct = count($group);
|
||||
while($i < $group_ct)
|
||||
{
|
||||
$group_string .= "$group[$i]|";
|
||||
$group_SQL .= "'$group[$i]',";
|
||||
$i++;
|
||||
}
|
||||
if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) )
|
||||
{
|
||||
$group_SQL = "''";
|
||||
# $group_SQL = "group_id IN('')";
|
||||
}
|
||||
else
|
||||
{
|
||||
$group_SQL = eregi_replace(",$",'',$group_SQL);
|
||||
# $group_SQL = "group_id IN($group_SQL)";
|
||||
}
|
||||
|
||||
|
||||
$stmt="select vsc_id,vsc_name from vicidial_status_categories;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
@@ -120,33 +147,65 @@ while ($i < $statcats_to_print)
|
||||
<?
|
||||
echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
|
||||
echo "<TITLE>VICIDIAL: Estadísticas de VDAD Closer</TITLE></HEAD><BODY BGCOLOR=WHITE>\n";
|
||||
if ($DB > 0)
|
||||
{
|
||||
echo "<BR>\n";
|
||||
echo "$group_ct|$group_string|$group_SQL\n";
|
||||
echo "<BR>\n";
|
||||
echo "$shift|$query_date|$end_date\n";
|
||||
echo "<BR>\n";
|
||||
}
|
||||
|
||||
echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET>\n";
|
||||
echo "<TABLE Border=0><TR><TD VALIGN=TOP>\n";
|
||||
echo "<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">\n";
|
||||
echo "Date Range:<BR>\n";
|
||||
echo "<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">\n";
|
||||
echo " to <INPUT TYPE=TEXT NAME=end_date SIZE=10 MAXLENGTH=10 VALUE=\"$end_date\">\n";
|
||||
echo "<SELECT SIZE=1 NAME=group>\n";
|
||||
echo "</TD><TD ROWSPAN=2 VALIGN=TOP>\n";
|
||||
echo "Gruppi Inbound: \n";
|
||||
echo "</TD><TD ROWSPAN=2 VALIGN=TOP>\n";
|
||||
echo "<SELECT SIZE=5 NAME=group[] multiple>\n";
|
||||
$o=0;
|
||||
while ($groups_to_print > $o)
|
||||
{
|
||||
if ($groups[$o] == $group) {echo "<option selected value=\"$groups[$o]\">$groups[$o]</option>\n";}
|
||||
else {echo "<option value=\"$groups[$o]\">$groups[$o]</option>\n";}
|
||||
if (ereg("\|$LISTgroups[$o]\|",$group_string))
|
||||
{echo "<option selected value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";}
|
||||
else
|
||||
{echo "<option value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";}
|
||||
$o++;
|
||||
}
|
||||
echo "</SELECT>\n";
|
||||
echo "<SELECT SIZE=1 NAME=shift>\n";
|
||||
echo "</TD><TD ROWSPAN=2 VALIGN=TOP>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> <a href=\"./admin.php?ADD=3111&group_id=$group[0]\">MODIFICA</a> | <a href=\"./admin.php?ADD=999999\">REPORT</a> </FONT>\n";
|
||||
|
||||
echo "</TD></TR>\n";
|
||||
echo "<TR><TD>\n";
|
||||
|
||||
#echo "<SELECT SIZE=1 NAME=group>\n";
|
||||
# $o=0;
|
||||
# while ($groups_to_print > $o)
|
||||
# {
|
||||
# if ($groups[$o] == $group) {echo "<option selected value=\"$groups[$o]\">$groups[$o]</option>\n";}
|
||||
# else {echo "<option value=\"$groups[$o]\">$groups[$o]</option>\n";}
|
||||
# $o++;
|
||||
# }
|
||||
#echo "</SELECT>\n";
|
||||
echo "Shift: <SELECT SIZE=1 NAME=shift>\n";
|
||||
echo "<option selected value=\"$shift\">$shift</option>\n";
|
||||
echo "<option value=\"\">--</option>\n";
|
||||
echo "<option value=\"AM\">AM</option>\n";
|
||||
echo "<option value=\"PM\">PM</option>\n";
|
||||
echo "<option value=\"ALL\">ALL</option>\n";
|
||||
echo "</SELECT>\n";
|
||||
echo "<INPUT TYPE=submit NAME=INVIA VALUE=INVIA>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> <a href=\"./admin.php?ADD=3111&group_id=$group\">MODIFICA</a> | <a href=\"./admin.php?ADD=999999\">REPORT</a> </FONT>\n";
|
||||
echo " <INPUT TYPE=submit NAME=INVIA VALUE=INVIA>\n";
|
||||
echo "</TD></TR></TABLE>\n";
|
||||
echo "</FORM>\n\n";
|
||||
|
||||
echo "<PRE><FONT SIZE=2>\n\n";
|
||||
|
||||
|
||||
if (!$group)
|
||||
if ($groups_to_print < 1)
|
||||
{
|
||||
echo "\n\n";
|
||||
echo "PER FAVORE SELEZIONA UN GRUPPO INBOUND E UN INTERVALLO DI TEMPO, POI PREMI INVIA\n";
|
||||
@@ -178,18 +237,71 @@ $query_date_END = "$end_date $time_END";
|
||||
|
||||
|
||||
|
||||
echo "VICIDIAL: Estadísticas de Auto-dial en CLOSER $NOW_TIME\n";
|
||||
echo "VICIDIAL: Estadísticas de Auto-dial en CLOSER: $group_string $NOW_TIME\n";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if ($group_ct > 1)
|
||||
{
|
||||
echo "\n";
|
||||
echo "---------- MULTI-GROUP BREAKDOWN:\n";
|
||||
echo "+----------------------+---------+---------+---------+---------+\n";
|
||||
echo "| IN-GROUP | CALLS | DROPS | DROP % | IVR |\n";
|
||||
echo "+----------------------+---------+---------+---------+---------+\n";
|
||||
|
||||
$i=0;
|
||||
while($i < $group_ct)
|
||||
{
|
||||
$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='$group[$i]';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
$stmt="select count(*) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='$group[$i]' and comment_b='START';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rowx=mysql_fetch_row($rslt);
|
||||
|
||||
$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='$group[$i]' and status IN('DROP','XDROP') and (length_in_sec <= 9999 or length_in_sec is null);";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rowy=mysql_fetch_row($rslt);
|
||||
|
||||
$groupDISPLAY = sprintf("%20s", $group[$i]);
|
||||
$gTOTALcalls = sprintf("%7s", $row[0]);
|
||||
$gIVRcalls = sprintf("%7s", $rowx[0]);
|
||||
$gDROPcalls = sprintf("%7s", $rowy[0]);
|
||||
if ( ($gDROPcalls < 1) or ($gTOTALcalls < 1) )
|
||||
{$gDROPpercent = '0';}
|
||||
else
|
||||
{
|
||||
$gDROPpercent = (($gDROPcalls / $gTOTALcalls) * 100);
|
||||
$gDROPpercent = round($gDROPpercent, 2);
|
||||
}
|
||||
$gDROPpercent = sprintf("%6s", $gDROPpercent);
|
||||
|
||||
echo "| $groupDISPLAY | $gTOTALcalls | $gDROPcalls | $gDROPpercent% | $gIVRcalls |\n";
|
||||
$i++;
|
||||
}
|
||||
|
||||
echo "+----------------------+---------+---------+---------+---------+\n";
|
||||
|
||||
}
|
||||
|
||||
|
||||
echo "\n";
|
||||
echo "Intervallo Di Tempo: $query_date_BEGIN to $query_date_END\n\n";
|
||||
echo "---------- TOTALI\n";
|
||||
|
||||
$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL);";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
$stmt="select count(*) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='" . mysql_real_escape_string($group) . "' and comment_b='START';";
|
||||
$stmt="select count(*) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a IN($group_SQL) and comment_b='START';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rowx=mysql_fetch_row($rslt);
|
||||
@@ -213,7 +325,7 @@ echo "Calls taken into the IVR for this In-Gruppo: $IVRcalls\n";
|
||||
echo "\n";
|
||||
echo "---------- ABBATTUTE\n";
|
||||
|
||||
$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP' and (length_in_sec <= 999 or length_in_sec is null);";
|
||||
$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status IN('DROP','XDROP') and (length_in_sec <= 9999 or length_in_sec is null);";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
@@ -284,7 +396,7 @@ while ($p < $statuses_to_print)
|
||||
echo "\n";
|
||||
echo "---------- QUEUE STATS\n";
|
||||
|
||||
$stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and (queue_seconds > 0);";
|
||||
$stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and (queue_seconds > 0);";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
@@ -333,7 +445,7 @@ echo "+-------------------------------------------------------------------------
|
||||
echo "| 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n";
|
||||
echo "+-------------------------------------------------------------------------------------------+------------+\n";
|
||||
|
||||
$stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' group by queue_seconds;";
|
||||
$stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by queue_seconds;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$reasons_to_print = mysql_num_rows($rslt);
|
||||
@@ -396,7 +508,7 @@ echo "+----------------------+------------+\n";
|
||||
echo "| HANGUP REASON | CALLS |\n";
|
||||
echo "+----------------------+------------+\n";
|
||||
|
||||
$stmt="select count(*),term_reason from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' group by term_reason;";
|
||||
$stmt="select count(*),term_reason from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by term_reason;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$reasons_to_print = mysql_num_rows($rslt);
|
||||
@@ -438,7 +550,7 @@ echo "+--------+----------------------+----------------------+------------+-----
|
||||
|
||||
|
||||
## get counts and time totals for all statuses in this campaign
|
||||
$stmt="select count(*),status,sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' group by status;";
|
||||
$stmt="select count(*),status,sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by status;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$statuses_to_print = mysql_num_rows($rslt);
|
||||
@@ -460,7 +572,10 @@ while ($i < $statuses_to_print)
|
||||
}
|
||||
|
||||
$TOTALcalls = ($TOTALcalls + $row[0]);
|
||||
$STATUSrate = ($STATUScount / ($TOTALsec / 3600) );
|
||||
if ( ($STATUScount < 1) or ($TOTALsec < 1) )
|
||||
{$STATUSrate = 0;}
|
||||
else
|
||||
{$STATUSrate = ($STATUScount / ($TOTALsec / 3600) );}
|
||||
$STATUSrate = sprintf("%.2f", $STATUSrate);
|
||||
|
||||
$STATUShours_H = ($row[2] / 3600);
|
||||
@@ -526,7 +641,10 @@ if ($TOTALcalls < 1)
|
||||
}
|
||||
else
|
||||
{
|
||||
$TOTALrate = ($TOTALcalls / ($TOTALsec / 3600) );
|
||||
if ( ($TOTALcalls < 1) or ($TOTALsec < 1) )
|
||||
{$TOTALrate = 0;}
|
||||
else
|
||||
{$TOTALrate = ($TOTALcalls / ($TOTALsec / 3600) );}
|
||||
$TOTALrate = sprintf("%.2f", $TOTALrate);
|
||||
|
||||
$TOTALhours_H = ($TOTALsec / 3600);
|
||||
@@ -614,7 +732,7 @@ echo "+--------------------------+------------+----------+--------+\n";
|
||||
echo "| AGENT | CALLS | TEMPO M | MEDIA M |\n";
|
||||
echo "+--------------------------+------------+----------+--------+\n";
|
||||
|
||||
$stmt="select vicidial_closer_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_closer_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_closer_log.user is not null and length_in_sec is not null and length_in_sec > 0 and vicidial_closer_log.user=vicidial_users.user group by vicidial_closer_log.user;";
|
||||
$stmt="select vicidial_closer_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_closer_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and vicidial_closer_log.user is not null and length_in_sec is not null and length_in_sec > 0 and vicidial_closer_log.user=vicidial_users.user group by vicidial_closer_log.user;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$users_to_print = mysql_num_rows($rslt);
|
||||
@@ -704,14 +822,14 @@ $i=0;
|
||||
$h=0;
|
||||
while ($i <= 96)
|
||||
{
|
||||
$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id IN($group_SQL);";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$hour_count[$i] = $row[0];
|
||||
if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
|
||||
if ($hour_count[$i] > 0) {$last_full_record = $i;}
|
||||
$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
|
||||
$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' and campaign_id IN($group_SQL) and status IN('DROP','XDROP');";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
@@ -719,42 +837,42 @@ while ($i <= 96)
|
||||
$i++;
|
||||
|
||||
|
||||
$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='$group';";
|
||||
$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id IN($group_SQL);";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$hour_count[$i] = $row[0];
|
||||
if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
|
||||
if ($hour_count[$i] > 0) {$last_full_record = $i;}
|
||||
$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
|
||||
$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' and campaign_id IN($group_SQL) and status IN('DROP','XDROP');";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$drop_count[$i] = $row[0];
|
||||
$i++;
|
||||
|
||||
$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id IN($group_SQL);";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$hour_count[$i] = $row[0];
|
||||
if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
|
||||
if ($hour_count[$i] > 0) {$last_full_record = $i;}
|
||||
$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
|
||||
$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' and campaign_id IN($group_SQL) and status IN('DROP','XDROP');";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$drop_count[$i] = $row[0];
|
||||
$i++;
|
||||
|
||||
$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id IN($group_SQL);";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$hour_count[$i] = $row[0];
|
||||
if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
|
||||
if ($hour_count[$i] > 0) {$last_full_record = $i;}
|
||||
$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP';";
|
||||
$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' and campaign_id IN($group_SQL) and status IN('DROP','XDROP');";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
@@ -224,7 +224,7 @@ else
|
||||
{$bgcolor='bgcolor="#9BB9FB"';}
|
||||
echo "<TR $bgcolor>\n";
|
||||
echo "<TD ALIGN=LEFT><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$o</FONT></TD>\n";
|
||||
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1><a href=\"admin_modify_lead.php?lead_id=$row[0]\">$row[0]</a></FONT></TD>\n";
|
||||
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1><a href=\"admin_modify_lead.php?lead_id=$row[0]\" target=\"_blank\">$row[0]</a></FONT></TD>\n";
|
||||
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[3]</FONT></TD>\n";
|
||||
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[5]</FONT></TD>\n";
|
||||
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[4]</FONT></TD>\n";
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
# 70417-1346 - Fixed bug that would add unneeded simulated agent lines
|
||||
# 80128-0105 - Fixed calls_today bug
|
||||
# 81007-1746 - Added debugX output for count statements and changed to if from while
|
||||
# 81026-1246 - Added better logging of calls and fixed the DROP bug
|
||||
#
|
||||
|
||||
### begin parsing run-time options ###
|
||||
@@ -257,12 +258,55 @@ while($one_day_interval > 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);
|
||||
@QHlive_agent_id=@MT;
|
||||
@QHlead_id=@MT;
|
||||
@QHuniqueid=@MT;
|
||||
@QHuser=@MT;
|
||||
@QHcall_type=@MT;
|
||||
##### grab number of calls today in this campaign and increment
|
||||
$stmtA = "SELECT vla.live_agent_id,vla.lead_id,vla.uniqueid,vla.user,vac.call_type FROM vicidial_live_agents vla,vicidial_auto_calls vac where vla.server_ip='$server_ip' and vla.status IN('QUEUE') and vla.extension LIKE \"R/%\" and vla.uniqueid=vac.uniqueid and vla.channel=vac.channel;";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$vla_qh_ct=$sthA->rows;
|
||||
$w=0;
|
||||
while ($vla_qh_ct > $w)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$QHlive_agent_id[$w] = "$aryA[0]";
|
||||
$QHlead_id[$w] = "$aryA[1]";
|
||||
$QHuniqueid[$w] = "$aryA[2]";
|
||||
$QHuser[$w] = "$aryA[3]";
|
||||
$QHcall_type[$w] = "$aryA[4]";
|
||||
$w++;
|
||||
}
|
||||
$sthA->finish();
|
||||
|
||||
$event_string = "| QUEUEd call listing vla UPDATEd $affected_rows";
|
||||
$w=0;
|
||||
while ($vla_qh_ct > $w)
|
||||
{
|
||||
$stmtA = "UPDATE vicidial_live_agents set status='INCALL', last_call_time='$SQLdate',comments='REMOTE',calls_today='$calls_today' where live_agent_id='$QHlive_agent_id[$w]';";
|
||||
$Aaffected_rows = $dbhA->do($stmtA);
|
||||
|
||||
$stmtB = "UPDATE vicidial_list set status='XFER',user='$QHuser[$w]' where lead_id='$QHlead_id[$w]';";
|
||||
$Baffected_rows = $dbhA->do($stmtB);
|
||||
|
||||
if ($QHcall_type[$w] =~ /IN/)
|
||||
{
|
||||
$stmtC = "UPDATE vicidial_closer_log set status='XFER',user='$QHuser[$w]',comments='REMOTE' where lead_id='$QHlead_id[$w]' order by call_date desc limit 1;";
|
||||
$Caffected_rows = $dbhA->do($stmtC);
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmtC = "UPDATE vicidial_log set status='XFER',user='$QHuser[$w]',comments='REMOTE' where uniqueid='$QHuniqueid[$w]';";
|
||||
$Caffected_rows = $dbhA->do($stmtC);
|
||||
}
|
||||
|
||||
$event_string = "| QUEUEd listing UPDATEd |$Aaffected_rows|$Baffected_rows|$Caffected_rows| |$QHlive_agent_id[$w]|$QHlead_id[$w]|$QHuniqueid[$w]|$QHuser[$w]|$QHcall_type[$w]|";
|
||||
&event_logger;
|
||||
|
||||
$w++;
|
||||
}
|
||||
|
||||
#@psoutput = `/bin/ps -f --no-headers -A`;
|
||||
@psoutput = `/bin/ps -o "%p %a" --no-headers -A`;
|
||||
|
||||
|
||||
+6
-3
@@ -42,6 +42,7 @@
|
||||
# 80830-0035 - Added auto alt dialing for EXTERNAL leads for each lead
|
||||
# 80909-0843 - Added support for campaign-speccific DNC lists
|
||||
# 81021-0306 - Added Local channel logging support and while-to-if changes
|
||||
# 81026-1247 - Changed to allow for better remote agent calling
|
||||
#
|
||||
|
||||
|
||||
@@ -742,7 +743,7 @@ sub process_request {
|
||||
if ($calleridname !~ /^Y\d\d\d\d/)
|
||||
{
|
||||
########## FIND AND UPDATE vicidial_log ##########
|
||||
$stmtA = "SELECT start_epoch,status,user,term_reason FROM vicidial_log FORCE INDEX(lead_id) where lead_id = '$VD_lead_id' and uniqueid LIKE \"$Euniqueid%\" limit 1;";
|
||||
$stmtA = "SELECT start_epoch,status,user,term_reason,comments FROM vicidial_log FORCE INDEX(lead_id) where lead_id = '$VD_lead_id' and uniqueid LIKE \"$Euniqueid%\" limit 1;";
|
||||
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
@@ -754,6 +755,7 @@ sub process_request {
|
||||
$VD_status = "$aryA[1]";
|
||||
$VD_user = "$aryA[2]";
|
||||
$VD_term_reason = "$aryA[3]";
|
||||
$VD_comments = "$aryA[4]";
|
||||
$epc_countCUSTDATA++;
|
||||
}
|
||||
$sthA->finish();
|
||||
@@ -775,7 +777,7 @@ sub process_request {
|
||||
if ($Rsec < 10) {$Rsec = "0$Rsec";}
|
||||
$RSQLdate = "$Ryear-$Rmon-$Rmday $Rhour:$Rmin:$Rsec";
|
||||
|
||||
$stmtA = "SELECT start_epoch,status,closecallid,user,term_reason,length_in_sec,queue_seconds FROM vicidial_closer_log where lead_id = '$VD_lead_id' and call_date > \"$RSQLdate\" order by call_date desc limit 1;";
|
||||
$stmtA = "SELECT start_epoch,status,closecallid,user,term_reason,length_in_sec,queue_seconds,comments FROM vicidial_closer_log where lead_id = '$VD_lead_id' and call_date > \"$RSQLdate\" order by call_date desc limit 1;";
|
||||
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
@@ -792,6 +794,7 @@ sub process_request {
|
||||
$VD_term_reason = "$aryA[4]";
|
||||
$VD_length_in_sec = "$aryA[5]";
|
||||
$VD_queue_seconds = "$aryA[6]";
|
||||
$VD_comments = "$aryA[7]";
|
||||
$epc_countCUSTDATA++;
|
||||
}
|
||||
$sthA->finish();
|
||||
@@ -805,7 +808,7 @@ sub process_request {
|
||||
$VD_seconds = ($now_date_epoch - $VD_start_epoch);
|
||||
|
||||
$SQL_status='';
|
||||
if ($VD_status =~ /^NA$|^NEW$|^QUEUE$|^XFER$/)
|
||||
if ( ($VD_status =~ /^NA$|^NEW$|^QUEUE$|^XFER$/) && ($VD_comments !~ /REMOTE/) )
|
||||
{
|
||||
if ( ($VD_term_reason !~ /AGENT|CALLER|QUEUETIMEOUT/) && ( ($VD_user =~ /VDAD|VDCL/) || (length($VD_user) < 1) ) )
|
||||
{$VDLSQL_term_reason = "term_reason='ABANDON',";}
|
||||
|
||||
@@ -224,7 +224,7 @@ else
|
||||
{$bgcolor='bgcolor="#9BB9FB"';}
|
||||
echo "<TR $bgcolor>\n";
|
||||
echo "<TD ALIGN=LEFT><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$o</FONT></TD>\n";
|
||||
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1><a href=\"admin_modify_lead.php?lead_id=$row[0]\">$row[0]</a></FONT></TD>\n";
|
||||
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1><a href=\"admin_modify_lead.php?lead_id=$row[0]\" target=\"_blank\">$row[0]</a></FONT></TD>\n";
|
||||
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[3]</FONT></TD>\n";
|
||||
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[5]</FONT></TD>\n";
|
||||
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[4]</FONT></TD>\n";
|
||||
|
||||
Reference in New Issue
Block a user