added many new report features to realtime and closer/ivr reports including inbound-only realtime report
git-svn-id: svn://192.168.202.10@1000 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -38,8 +38,16 @@
|
||||
# 80424-0442 - Added non_latin lookup from system_settings
|
||||
# 80519-1425 - Added calls-in-queue tally
|
||||
# 80703-1106 - Added API functionality for Hangup and Dispo
|
||||
# 81104-0229 - Added mysql error logging capability
|
||||
# 81104-1409 - Added multi-retry for some vicidial_live_agents table MySQL queries
|
||||
#
|
||||
|
||||
$version = '2.0.4-15';
|
||||
$build = '81104-1409';
|
||||
$mel=1; # Mysql Error Log enabled = 1
|
||||
$mysql_log_count=14;
|
||||
$one_mysql_log=0;
|
||||
|
||||
require("dbconnect.php");
|
||||
|
||||
### If you have globals turned off uncomment these lines
|
||||
@@ -75,6 +83,7 @@ header ("Pragma: no-cache"); // HTTP/1.0
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmt = "SELECT use_non_latin FROM system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03001',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$qm_conf_ct = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
@@ -102,8 +111,6 @@ $Alogin='N';
|
||||
$RingCalls='N';
|
||||
$DiaLCalls='N';
|
||||
|
||||
$version = '2.0.4-12';
|
||||
$build = '71122-0205';
|
||||
$StarTtime = date("U");
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
@@ -116,6 +123,7 @@ $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' a
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03002',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
@@ -137,6 +145,7 @@ $auth=$row[0];
|
||||
$stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03002',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$SNauth=$row[0];
|
||||
if($SNauth==0)
|
||||
@@ -185,6 +194,7 @@ echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>
|
||||
$stmt="SELECT count(*) from vicidial_live_agents where user='$user' and server_ip='$server_ip';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03003',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$Acount=$row[0];
|
||||
|
||||
@@ -193,6 +203,7 @@ echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>
|
||||
$stmt="SELECT status from vicidial_live_agents where user='$user' and server_ip='$server_ip';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03004',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$Astatus=$row[0];
|
||||
}
|
||||
@@ -209,6 +220,16 @@ echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>
|
||||
$stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03005',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$retry_count=0;
|
||||
while ( ($errno > 0) and ($retry_count < 5) )
|
||||
{
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$one_mysql_log=1;
|
||||
$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9305$retry_count",$user,$server_ip,$session_name,$one_mysql_log);
|
||||
$one_mysql_log=0;
|
||||
$retry_count++;
|
||||
}
|
||||
|
||||
if ($campagentstdisp == 'YES')
|
||||
{
|
||||
@@ -216,6 +237,7 @@ echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>
|
||||
$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);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03006',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$Alogin=$row[0];
|
||||
$Acampaign=$row[1];
|
||||
@@ -227,6 +249,7 @@ echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>
|
||||
$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);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03007',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$RingCalls=$row[0];
|
||||
if ($RingCalls > 0) {$RingCalls = "<font class=\"queue_text_red\">Calls in Queue: $RingCalls</font>";}
|
||||
@@ -236,6 +259,7 @@ echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>
|
||||
$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);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03008',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$DiaLCalls=$row[0];
|
||||
|
||||
@@ -257,13 +281,23 @@ echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>
|
||||
$stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03009',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$retry_count=0;
|
||||
while ( ($errno > 0) and ($retry_count < 5) )
|
||||
{
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$one_mysql_log=1;
|
||||
$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,"9309$retry_count",$user,$server_ip,$session_name,$one_mysql_log);
|
||||
$one_mysql_log=0;
|
||||
$retry_count++;
|
||||
}
|
||||
}
|
||||
|
||||
### grab the API hangup and API dispo fields in vicidial_live_agents
|
||||
$stmt="SELECT external_hangup,external_status from vicidial_live_agents where user='$user' and server_ip='$server_ip';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03010',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$external_hangup = $row[0];
|
||||
$external_status = $row[1];
|
||||
@@ -279,6 +313,7 @@ echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>
|
||||
$stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03011',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($rslt) {$sip_list = mysql_num_rows($rslt);}
|
||||
# echo "$sip_list|";
|
||||
$loop_count=0;
|
||||
@@ -292,6 +327,7 @@ echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>
|
||||
$stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and extension = '$conf_exten';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03012',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($rslt) {$channels_list = mysql_num_rows($rslt);}
|
||||
# echo "$channels_list|";
|
||||
$loop_count=0;
|
||||
@@ -334,6 +370,7 @@ echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>
|
||||
$stmt="UPDATE conferences set extension='$exten' where server_ip = '$server_ip' and conf_exten = '$conf_exten';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03013',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
}
|
||||
echo "Conferenza $conf_exten e` stato registrato su $exten\n";
|
||||
}
|
||||
@@ -350,4 +387,26 @@ if ($format=='debug')
|
||||
|
||||
exit;
|
||||
|
||||
|
||||
##### MySQL Error Logging #####
|
||||
function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log)
|
||||
{
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
# mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log);
|
||||
$errno=''; $error='';
|
||||
if ( ($mel > 0) or ($one_mysql_log > 0) )
|
||||
{
|
||||
$errno = mysql_errno($link);
|
||||
if ( ($errno > 0) or ($mel > 1) or ($one_mysql_log > 0) )
|
||||
{
|
||||
$error = mysql_error($link);
|
||||
$efp = fopen ("./vicidial_mysql_errors.txt", "a");
|
||||
fwrite ($efp, "$NOW_TIME|conf_check |$query_id|$errno|$error|$stmt|$user|$server_ip|$session_name|\n");
|
||||
fclose($efp);
|
||||
}
|
||||
}
|
||||
$one_mysql_log=0;
|
||||
return $errno;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -77,8 +77,15 @@
|
||||
# 80915-1755 - Rewrote leave-3way functions for external calling
|
||||
# 81011-1404 - Fixed bugs in leave3way when transferring a manual dial call
|
||||
# 81020-1459 - Fixed bugs in queue_log logging
|
||||
# 81104-0203 - Added mysql error logging capability
|
||||
#
|
||||
|
||||
$version = '2.0.5-35';
|
||||
$build = '81104-0203';
|
||||
$mel=1; # Mysql Error Log enabled = 1
|
||||
$mysql_log_count=82;
|
||||
$one_mysql_log=0;
|
||||
|
||||
require("dbconnect.php");
|
||||
|
||||
### These are variable assignments for PHP globals off
|
||||
@@ -161,6 +168,7 @@ header ("Pragma: no-cache"); // HTTP/1.0
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmt = "SELECT use_non_latin FROM system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02001',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$qm_conf_ct = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
@@ -185,8 +193,6 @@ if (!isset($ACTION)) {$ACTION="Originate";}
|
||||
if (!isset($format)) {$format="alert";}
|
||||
if (!isset($ext_priority)) {$ext_priority="1";}
|
||||
|
||||
$version = '2.0.5-34';
|
||||
$build = '81020-1459';
|
||||
$StarTtime = date("U");
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
@@ -197,6 +203,7 @@ $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' a
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02002',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
@@ -218,6 +225,7 @@ $auth=$row[0];
|
||||
$stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02003',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$SNauth=$row[0];
|
||||
if($SNauth==0)
|
||||
@@ -267,6 +275,7 @@ if ($ACTION=="SysCIDOriginate")
|
||||
$stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $queryCID','','','','','');";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02004',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
echo "Originate comando inviato per Exten $exten Canale $channel su $server_ip\n";
|
||||
}
|
||||
}
|
||||
@@ -294,6 +303,7 @@ if ($ACTION=="OriginateName")
|
||||
$stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02005',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$name_count = mysql_num_rows($rslt);
|
||||
if ($name_count>0)
|
||||
{
|
||||
@@ -323,6 +333,7 @@ if ($ACTION=="OriginateNameVmail")
|
||||
$stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02006',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$name_count = mysql_num_rows($rslt);
|
||||
if ($name_count>0)
|
||||
{
|
||||
@@ -363,6 +374,7 @@ if ($ACTION=="Originate")
|
||||
$stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $outCID','','','','','');";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02007',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
echo "Originate comando inviato per Exten $exten Canale $channel su $server_ip\n";
|
||||
}
|
||||
}
|
||||
@@ -390,12 +402,14 @@ if ($ACTION=="HangupConfDial")
|
||||
$stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02008',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ($row > 0)
|
||||
{
|
||||
$stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02009',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$rowx=mysql_fetch_row($rslt);
|
||||
$channel=$rowx[0];
|
||||
$ACTION="Hangup";
|
||||
@@ -414,6 +428,7 @@ if ($ACTION=="Hangup")
|
||||
$stmt="UPDATE vicidial_live_agents SET external_hangup='0' where user='$user';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02010',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
$row=''; $rowx='';
|
||||
$channel_live=1;
|
||||
@@ -447,6 +462,7 @@ $rslt=mysql_query($stmt, $link);
|
||||
$stmt="SELECT count(*) FROM vicidial_auto_calls where channel='$channel' and callerid='$CalLCID';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02011',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$rowx=mysql_fetch_row($rslt);
|
||||
if ($rowx[0]==0)
|
||||
{
|
||||
@@ -455,6 +471,7 @@ $rslt=mysql_query($stmt, $link);
|
||||
$stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel' and extension LIKE \"%$exten\";";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02012',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ($row[0]==0)
|
||||
{
|
||||
@@ -474,6 +491,7 @@ $rslt=mysql_query($stmt, $link);
|
||||
{
|
||||
$stmt="SELECT count(*) FROM vicidial_auto_calls where callerid='$CalLCID';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02013',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$rowx=mysql_fetch_row($rslt);
|
||||
if ($format=='debug') {echo "\n<!-- $rowx[0]|$stmt -->";}
|
||||
if ($rowx[0] > 0)
|
||||
@@ -482,6 +500,7 @@ $rslt=mysql_query($stmt, $link);
|
||||
##### INIZIO 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 ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02014',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($format=='debug') {echo "\n<!-- $rowx[0]|$stmt -->";}
|
||||
$qm_conf_ct = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
@@ -505,6 +524,7 @@ $rslt=mysql_query($stmt, $link);
|
||||
|
||||
$stmt="SELECT count(*) from queue_log where call_id='$CalLCID' and verb='CONNECT';";
|
||||
$rslt=mysql_query($stmt, $linkB);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02015',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$VAC_cn_ct = mysql_num_rows($rslt);
|
||||
if ($VAC_cn_ct > 0)
|
||||
{
|
||||
@@ -517,6 +537,7 @@ $rslt=mysql_query($stmt, $link);
|
||||
### grab call lead information needed for QM logging
|
||||
$stmt="SELECT auto_call_id,lead_id,phone_number,status,campaign_id,phone_code,alt_dial,stage,callerid,uniqueid from vicidial_auto_calls where callerid='$CalLCID' order by call_time limit 1;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02016',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$VAC_qm_ct = mysql_num_rows($rslt);
|
||||
if ($VAC_qm_ct > 0)
|
||||
{
|
||||
@@ -539,6 +560,7 @@ $rslt=mysql_query($stmt, $link);
|
||||
|
||||
$stmt="SELECT count(*) from queue_log where call_id='$CalLCID' and verb='COMPLETECALLER' and queue='$CLcampaign_id';";
|
||||
$rslt=mysql_query($stmt, $linkB);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02017',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$VAC_cc_ct = mysql_num_rows($rslt);
|
||||
if ($VAC_cc_ct > 0)
|
||||
{
|
||||
@@ -552,6 +574,7 @@ $rslt=mysql_query($stmt, $link);
|
||||
$time_id=0;
|
||||
$stmt="SELECT time_id from queue_log where call_id='$CalLCID' and verb='ENTERQUEUE' and queue='$CLcampaign_id';";
|
||||
$rslt=mysql_query($stmt, $linkB);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02018',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$VAC_eq_ct = mysql_num_rows($rslt);
|
||||
if ($VAC_eq_ct > 0)
|
||||
{
|
||||
@@ -565,6 +588,7 @@ $rslt=mysql_query($stmt, $link);
|
||||
if ($format=='debug') {echo "\n<!-- $caller_complete|$stmt -->";}
|
||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$CalLCID',queue='$CLcampaign_id',agent='Agent/$user',verb='COMPLETEAGENT',data1='$CLstage',data2='$secondS',data3='1',serverid='$queuemetrics_log_id';";
|
||||
$rslt=mysql_query($stmt, $linkB);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02019',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$affected_rows = mysql_affected_rows($linkB);
|
||||
if ($format=='debug') {echo "\n<!-- $affected_rows|$stmt -->";}
|
||||
}
|
||||
@@ -576,6 +600,7 @@ $rslt=mysql_query($stmt, $link);
|
||||
$stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Hangup','$queryCID','Channel: $channel','','','','','','','','','');";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02020',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
echo "Hangup comando inviato per Canale $channel su $call_server_ip\n";
|
||||
}
|
||||
}
|
||||
@@ -610,24 +635,28 @@ if ($ACTION=="RedirectVD")
|
||||
$stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02021',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ($row[0] > 0)
|
||||
{
|
||||
$stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where lead_id='$lead_id' order by start_epoch desc limit 1;";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02022',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
}
|
||||
if ($auto_dial_level < 1)
|
||||
{
|
||||
$stmt = "UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where uniqueid='$uniqueid';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02023',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02024',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
}
|
||||
$ACTION="Redirect";
|
||||
}
|
||||
@@ -654,6 +683,7 @@ if ($ACTION=="RedirectToPark")
|
||||
$stmt = "INSERT INTO parked_channels values('$channel','$server_ip','','$extenName','$parkedby','$NOW_TIME');";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02025',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$ACTION="Redirect";
|
||||
}
|
||||
}
|
||||
@@ -677,6 +707,7 @@ if ($ACTION=="RedirectFromPark")
|
||||
$stmt = "DELETE FROM parked_channels where server_ip='$server_ip' and channel='$channel';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02026',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$ACTION="Redirect";
|
||||
}
|
||||
}
|
||||
@@ -699,6 +730,7 @@ if ($ACTION=="RedirectName")
|
||||
$stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02027',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$name_count = mysql_num_rows($rslt);
|
||||
if ($name_count>0)
|
||||
{
|
||||
@@ -728,6 +760,7 @@ if ($ACTION=="RedirectNameVmail")
|
||||
$stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02028',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$name_count = mysql_num_rows($rslt);
|
||||
if ($name_count>0)
|
||||
{
|
||||
@@ -778,16 +811,19 @@ if ($ACTION=="RedirectXtraCXNeW")
|
||||
$stmtA="SELECT count(*) FROM vicidial_conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) and conf_exten != '$session_id';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmtA -->";}
|
||||
$rslt=mysql_query($stmtA, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'02029',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ($row[0] > 1)
|
||||
{
|
||||
$stmtB="UPDATE vicidial_conferences set extension='$protocol/$extension$NOWnum', leave_3way='0' where server_ip='$server_ip' and ((extension='') or (extension is null)) and conf_exten != '$session_id' limit 1;";
|
||||
if ($format=='debug') {echo "\n<!-- $stmtB -->";}
|
||||
$rslt=mysql_query($stmtB, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtB,'02030',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
$stmtC="SELECT conf_exten from vicidial_conferences where server_ip='$server_ip' and extension='$protocol/$extension$NOWnum' and conf_exten != '$session_id';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmtC -->";}
|
||||
$rslt=mysql_query($stmtC, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtC,'02031',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$exten = $row[0];
|
||||
|
||||
@@ -799,25 +835,30 @@ if ($ACTION=="RedirectXtraCXNeW")
|
||||
$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);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtD,'02032',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
$stmtE="UPDATE vicidial_conferences set leave_3way='1', leave_3way_datetime='$NOW_TIME', extension='3WAY_$user' where server_ip='$server_ip' and conf_exten='$session_id';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmtE -->";}
|
||||
$rslt=mysql_query($stmtE, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtE,'02033',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
$queryCID = "CXAR24$NOWnum";
|
||||
$stmtF="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $agentchannel','Context: $ext_context','Exten: $exten','Priority: 1','CallerID: $queryCID','','','','','');";
|
||||
if ($format=='debug') {echo "\n<!-- $stmtF -->";}
|
||||
$rslt=mysql_query($stmtF, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtF,'02034',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
$stmtG="UPDATE vicidial_live_agents set conf_exten='$exten' where server_ip='$server_ip' and user='$user';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmtG -->";}
|
||||
$rslt=mysql_query($stmtG, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtG,'02035',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
if ($auto_dial_level < 1)
|
||||
{
|
||||
$stmtH = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and callerid LIKE \"M%\";";
|
||||
if ($format=='debug') {echo "\n<!-- $stmtH -->";}
|
||||
$rslt=mysql_query($stmtH, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtH,'02036',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
}
|
||||
|
||||
// $fp = fopen ("./vicidial_debug_3way.txt", "a");
|
||||
@@ -842,12 +883,14 @@ if ($ACTION=="RedirectXtraCXNeW")
|
||||
$stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02037',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ($row[0]==0)
|
||||
{
|
||||
$stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02038',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$rowx=mysql_fetch_row($rslt);
|
||||
if ($rowx[0]==0)
|
||||
{
|
||||
@@ -859,12 +902,14 @@ if ($ACTION=="RedirectXtraCXNeW")
|
||||
$stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02039',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ($row[0]==0)
|
||||
{
|
||||
$stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02040',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$rowx=mysql_fetch_row($rslt);
|
||||
if ($rowx[0]==0)
|
||||
{
|
||||
@@ -878,6 +923,7 @@ if ($ACTION=="RedirectXtraCXNeW")
|
||||
$stmt="SELECT count(*) FROM vicidial_live_agents where lead_id='$lead_id' and user!='$user';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02041',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$rowx=mysql_fetch_row($rslt);
|
||||
if ($rowx[0] < 1)
|
||||
{
|
||||
@@ -890,6 +936,7 @@ if ($ACTION=="RedirectXtraCXNeW")
|
||||
$stmt="SELECT server_ip,conf_exten,user FROM vicidial_live_agents where lead_id='$lead_id' and user!='$user';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02042',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$rowx=mysql_fetch_row($rslt);
|
||||
$dest_server_ip = $rowx[0];
|
||||
$dest_session_id = $rowx[1];
|
||||
@@ -910,10 +957,12 @@ if ($ACTION=="RedirectXtraCXNeW")
|
||||
$stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02043',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
$stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','$queryCID','Channel: $extrachannel','','','','','','','','','');";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02044',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
echo "RedirectXtraCX comando inviato per Canale $channel su $call_server_ip and \nHungup $extrachannel su $server_ip\n";
|
||||
if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel su $call_server_ip, Hungup $extrachannel su $server_ip";}
|
||||
@@ -989,41 +1038,49 @@ if ($ACTION=="RedirectXtraNeW")
|
||||
$stmt="SELECT count(*) FROM vicidial_conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) and conf_exten != '$session_id';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02045',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ($row[0] > 1)
|
||||
{
|
||||
$stmt="UPDATE vicidial_conferences set extension='$protocol/$extension$NOWnum', leave_3way='0' where server_ip='$server_ip' and ((extension='') or (extension is null)) and conf_exten != '$session_id' limit 1;";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02046',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
$stmt="SELECT conf_exten from vicidial_conferences where server_ip='$server_ip' and extension='$protocol/$extension$NOWnum' and conf_exten != '$session_id';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02047',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$exten = $row[0];
|
||||
|
||||
$stmt="UPDATE vicidial_conferences set extension='$protocol/$extension' where server_ip='$server_ip' and conf_exten='$exten' limit 1;";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02048',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
$stmt="UPDATE vicidial_conferences set leave_3way='1', leave_3way_datetime='$NOW_TIME', extension='3WAY_$user' where server_ip='$server_ip' and conf_exten='$session_id';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02049',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
$queryCID = "CXAR23$NOWnum";
|
||||
$stmtB="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $agentchannel','Context: $ext_context','Exten: $exten','Priority: 1','CallerID: $queryCID','','','','','');";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmtB, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02050',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
$stmt="UPDATE vicidial_live_agents set conf_exten='$exten' where server_ip='$server_ip' and user='$user';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02051',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
if ($auto_dial_level < 1)
|
||||
{
|
||||
$stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and callerid LIKE \"M%\";";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02052',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
}
|
||||
|
||||
echo "NeWSessioN|$exten|\n";
|
||||
@@ -1044,12 +1101,14 @@ if ($ACTION=="RedirectXtraNeW")
|
||||
$stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02053',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ( ($row[0]==0) && (!ereg("SECOND",$filename)) )
|
||||
{
|
||||
$stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02054',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$rowx=mysql_fetch_row($rslt);
|
||||
if ($rowx[0]==0)
|
||||
{
|
||||
@@ -1061,12 +1120,14 @@ if ($ACTION=="RedirectXtraNeW")
|
||||
$stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02055',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ( ($row[0]==0) && (!ereg("SECOND",$filename)) )
|
||||
{
|
||||
$stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02056',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$rowx=mysql_fetch_row($rslt);
|
||||
if ($rowx[0]==0)
|
||||
{
|
||||
@@ -1082,6 +1143,7 @@ if ($ACTION=="RedirectXtraNeW")
|
||||
$stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','ExtraChannel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','');";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02057',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
echo "RedirectXtra comando inviato per Canale $channel and \nExtraCanale $extrachannel\n to $exten su $server_ip\n";
|
||||
if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel and $extrachannel to $exten su $server_ip";}
|
||||
@@ -1103,10 +1165,12 @@ if ($ACTION=="RedirectXtraNeW")
|
||||
$stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02058',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
$stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02059',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
echo "RedirectXtra comando inviato per Canale $channel su $call_server_ip and \nExtraCanale $extrachannel\n to $exten su $server_ip\n";
|
||||
if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel/$call_server_ip and $extrachannel/$server_ip to $exten";}
|
||||
@@ -1443,12 +1507,14 @@ if ($ACTION=="Redirect")
|
||||
$stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02060',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ($row > 0)
|
||||
{
|
||||
$stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02061',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$rowx=mysql_fetch_row($rslt);
|
||||
$channel=$rowx[0];
|
||||
$channel = eregi_replace("1$","2",$channel);
|
||||
@@ -1475,12 +1541,14 @@ if ($ACTION=="Redirect")
|
||||
$stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02062',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ($row[0]==0)
|
||||
{
|
||||
$stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02063',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$rowx=mysql_fetch_row($rslt);
|
||||
if ($rowx[0]==0)
|
||||
{
|
||||
@@ -1493,6 +1561,7 @@ if ($ACTION=="Redirect")
|
||||
$stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02064',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
echo "Redirect comando inviato per Canale $channel su $server_ip\n";
|
||||
}
|
||||
@@ -1523,12 +1592,14 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") )
|
||||
$stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02065',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ($row[0]==0)
|
||||
{
|
||||
$stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02066',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$rowx=mysql_fetch_row($rslt);
|
||||
if ($rowx[0]==0)
|
||||
{
|
||||
@@ -1541,15 +1612,18 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") )
|
||||
$stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','$ACTION','$queryCID','Channel: $channel','$SQLfile','','','','','','','','');";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02067',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
if ($ACTION=="Monitor")
|
||||
{
|
||||
$stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename','$lead_id','$user')";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02068',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
$stmt="SELECT recording_id FROM recording_log where filename='$filename'";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02069',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$recording_id = $row[0];
|
||||
@@ -1558,6 +1632,7 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") )
|
||||
{
|
||||
$stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02070',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rec_count = mysql_num_rows($rslt);
|
||||
if ($rec_count>0)
|
||||
@@ -1572,6 +1647,7 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") )
|
||||
$stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02071',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1609,10 +1685,12 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") )
|
||||
$stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$filename','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $filename','','','','','');";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02072',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
$stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename','$lead_id','$user')";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02073',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$RLaffected_rows = mysql_affected_rows($link);
|
||||
if ($RLaffected_rows > 0)
|
||||
{
|
||||
@@ -1625,6 +1703,7 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") )
|
||||
$VLA_inOUT='NONE';
|
||||
$stmt="SELECT comments FROM vicidial_live_agents where user='$user' order by last_update_time desc limit 1;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02074',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$VLA_inOUT_ct = mysql_num_rows($rslt);
|
||||
if ($VLA_inOUT_ct > 0)
|
||||
@@ -1645,6 +1724,7 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") )
|
||||
$stmt="SELECT uniqueid FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';";
|
||||
}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02075',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$VM_mancall_ct = mysql_num_rows($rslt);
|
||||
if ($VM_mancall_ct > 0)
|
||||
@@ -1655,6 +1735,7 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") )
|
||||
$stmt = "UPDATE recording_log SET vicidial_id='$VDvicidial_id' where recording_id='$recording_id';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02076',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1669,6 +1750,7 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") )
|
||||
### find the value to put in the vicidial_id field if this was an inbound call
|
||||
$stmt="SELECT closecallid from vicidial_closer_log where lead_id='$lead_id' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02077',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$VAC_qm_ct = mysql_num_rows($rslt);
|
||||
if ($VAC_qm_ct > 0)
|
||||
{
|
||||
@@ -1684,6 +1766,7 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") )
|
||||
|
||||
$stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02078',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rec_count = mysql_num_rows($rslt);
|
||||
if ($rec_count>0)
|
||||
@@ -1698,12 +1781,14 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") )
|
||||
$stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' $uniqueidSQL where filename='$filename'";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02079',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
}
|
||||
|
||||
# find and hang up all recordings going su in this conference # and extension = '$exten'
|
||||
$stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$channel%\" and channel LIKE \"%,1\";";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02080',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
# $rec_count = intval(mysql_num_rows($rslt) / 2);
|
||||
$rec_count = mysql_num_rows($rslt);
|
||||
$h=0;
|
||||
@@ -1719,6 +1804,7 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") )
|
||||
$stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$i','Channel: $HUchannel[$i]','','','','','','','','','');";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02081',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$i++;
|
||||
}
|
||||
|
||||
@@ -1754,6 +1840,7 @@ if ($ACTION=="VolumeControl")
|
||||
$stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $volume_local_channel','Context: $ext_context','Exten: 8300','Priority: 1','Callerid: $queryCID','','','','$channel','$exten');";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02082',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
echo "Volume comando inviato per Conferenza $exten, Stage $stage Canale $channel su $server_ip\n";
|
||||
}
|
||||
}
|
||||
@@ -1776,9 +1863,26 @@ if ($format=='debug') {echo "\n</body>\n</html>\n";}
|
||||
|
||||
exit;
|
||||
|
||||
|
||||
##### MySQL Error Logging #####
|
||||
function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log)
|
||||
{
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
# mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log);
|
||||
$errno=''; $error='';
|
||||
if ( ($mel > 0) or ($one_mysql_log > 0) )
|
||||
{
|
||||
$errno = mysql_errno($link);
|
||||
if ( ($errno > 0) or ($mel > 1) or ($one_mysql_log > 0) )
|
||||
{
|
||||
$error = mysql_error($link);
|
||||
$efp = fopen ("./vicidial_mysql_errors.txt", "a");
|
||||
fwrite ($efp, "$NOW_TIME|manager_send|$query_id|$errno|$error|$stmt|$user|$server_ip|$session_name|\n");
|
||||
fclose($efp);
|
||||
}
|
||||
}
|
||||
$one_mysql_log=0;
|
||||
return $errno;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+148
-52
@@ -200,10 +200,18 @@
|
||||
# 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
|
||||
# 81030-0403 - Added option to force Pause Codes on PAUSE
|
||||
# 81103-1427 - Added 3way call dial prefix
|
||||
# 81104-0140 - Added mysql error logging capability
|
||||
# 81104-1618 - Changed MySQL queries logging
|
||||
# 81106-0411 - Changedthe campaign login list behaviour
|
||||
#
|
||||
|
||||
$version = '2.0.5-179';
|
||||
$build = '81023-0411';
|
||||
$version = '2.0.5-184';
|
||||
$build = '81106-0411';
|
||||
$mel=1; # Mysql Error Log enabled = 1
|
||||
$mysql_log_count=51;
|
||||
$one_mysql_log=0;
|
||||
|
||||
require("dbconnect.php");
|
||||
|
||||
@@ -277,6 +285,7 @@ $random = (rand(1000000, 9999999) + 10000000);
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmt = "SELECT use_non_latin,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,webroot_writable FROM system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01001',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$qm_conf_ct = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
@@ -396,11 +405,13 @@ if ($relogin == 'YES')
|
||||
$stmt="SELECT user_group from vicidial_users where user='$VD_login' and pass='$VD_pass'";
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01002',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$VU_user_group=$row[0];
|
||||
|
||||
$stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$VU_user_group';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01003',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ( (!eregi("ALL-CAMPAIGNS",$row[0])) )
|
||||
{
|
||||
@@ -413,6 +424,7 @@ if ($relogin == 'YES')
|
||||
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id";
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01004',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
$camps_to_print = mysql_num_rows($rslt);
|
||||
|
||||
$o=0;
|
||||
@@ -428,10 +440,16 @@ while ($camps_to_print > $o)
|
||||
if ( (eregi("$VD_campaign",$rowx[0])) and (strlen($VD_campaign) == strlen($rowx[0])) )
|
||||
{$camp_form_code .= "<option value=\"$rowx[0]\" SELEZIONATO>$rowx[0]$campname</option>\n";}
|
||||
else
|
||||
{$camp_form_code .= "<option value=\"$rowx[0]\">$rowx[0]$campname</option>\n";}
|
||||
{
|
||||
if (!ereg('login_allowable_campaigns',$camp_form_code))
|
||||
{$camp_form_code .= "<option value=\"$rowx[0]\">$rowx[0]$campname</option>\n";}
|
||||
}
|
||||
}
|
||||
else
|
||||
{$camp_form_code .= "<option value=\"$rowx[0]\">$rowx[0]$campname</option>\n";}
|
||||
{
|
||||
if (!ereg('login_allowable_campaigns',$camp_form_code))
|
||||
{$camp_form_code .= "<option value=\"$rowx[0]\">$rowx[0]$campname</option>\n";}
|
||||
}
|
||||
$o++;
|
||||
}
|
||||
$camp_form_code .= "</select>\n";
|
||||
@@ -524,8 +542,9 @@ echo "<TD ALIGN=LEFT><INPUT TYPE=TEXT NAME=VD_login SIZE=10 maxlength=20 VALUE=\
|
||||
echo "<TR><TD ALIGN=RIGHT>Password Utente: </TD>";
|
||||
echo "<TD ALIGN=LEFT><INPUT TYPE=PASSWORD NAME=VD_pass SIZE=10 maxlength=20 VALUE=\"$VD_pass\"></TD></TR>\n";
|
||||
echo "<TR><TD ALIGN=RIGHT>Campagna: </TD>";
|
||||
echo "<TD ALIGN=LEFT>$camp_form_code</TD></TR>\n";
|
||||
echo "<TR><TD ALIGN=CENTER COLSPAN=2><INPUT TYPE=Submit NAME=INVIA VALUE=INVIA></TD></TR>\n";
|
||||
echo "<TD ALIGN=LEFT><span id=\"LogiNCamPaigns\">$camp_form_code</span></TD></TR>\n";
|
||||
echo "<TR><TD ALIGN=CENTER COLSPAN=2><INPUT TYPE=Submit NAME=INVIA VALUE=INVIA> \n";
|
||||
echo "<span id=\"LogiNReseT\"><INPUT TYPE=BUTTON VALUE=\"Aggiorna Campagna List\" OnClick=\"login_allowable_campaigns()\"></span></TD></TR>\n";
|
||||
echo "<TR><TD ALIGN=LEFT COLSPAN=2><font size=1><BR>VERSIONE: $version BUILD: $build</TD></TR>\n";
|
||||
echo "</TABLE>\n";
|
||||
echo "</FORM>\n\n";
|
||||
@@ -577,6 +596,7 @@ echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP NOWRAP><a href=\"../agc_en/vicidial.
|
||||
$stmt="SELECT phone_login,phone_pass from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01005',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$phone_login=$row[0];
|
||||
$phone_pass=$row[1];
|
||||
@@ -662,6 +682,7 @@ $VDloginDISPLAY=0;
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01006',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
@@ -672,6 +693,7 @@ $VDloginDISPLAY=0;
|
||||
##### grab the full name of the agent
|
||||
$stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended,user_group,vicidial_recording_override,alter_custphone_override from vicidial_users where user='$VD_login' and pass='$VD_pass'";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01007',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGfullname=$row[0];
|
||||
$user_level=$row[1];
|
||||
@@ -698,6 +720,7 @@ $VDloginDISPLAY=0;
|
||||
|
||||
$stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$VU_user_group';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01008',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGallowed_campaigns =$row[0];
|
||||
|
||||
@@ -730,6 +753,7 @@ echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP NOWRAP><a href=\"../agc_en/vicidial.
|
||||
$stmt="SELECT count(*) FROM vicidial_campaigns where campaign_id='$VD_campaign' and active='Y';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01009',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$CAMPactive=$row[0];
|
||||
if($CAMPactive>0)
|
||||
@@ -741,6 +765,7 @@ echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP NOWRAP><a href=\"../agc_en/vicidial.
|
||||
##### grab the statuses that can be used for dispositioning by an agent
|
||||
$stmt="SELECT status,status_name FROM vicidial_statuses WHERE $selectableSQL status != 'NEW' order by status limit 50;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01010',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$VD_statuses_ct = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
@@ -755,8 +780,9 @@ echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP NOWRAP><a href=\"../agc_en/vicidial.
|
||||
}
|
||||
|
||||
##### grab the campaign-specific statuses that can be used for dispositioning by an agent
|
||||
$stmt="SELECT status,status_name FROM vicidial_campaign_statuses WHERE $selectableSQL status != 'NEW' and campaign_id='$VD_campaign' order by status limit 50;";
|
||||
$stmt="SELECT status,status_name FROM vicidial_campaign_statuses WHERE $selectableSQL status != 'NEW' and campaign_id='$VD_campaign' order by status limit 80;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01011',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$VD_statuses_camp = mysql_num_rows($rslt);
|
||||
$j=0;
|
||||
@@ -777,6 +803,7 @@ echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP NOWRAP><a href=\"../agc_en/vicidial.
|
||||
##### grab the campaign-specific HotKey statuses that can be used for dispositioning by an agent
|
||||
$stmt="SELECT hotkey,status,status_name FROM vicidial_campaign_hotkeys WHERE selectable='Y' and status != 'NEW' and campaign_id='$VD_campaign' order by hotkey limit 9;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01012',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$HK_statuses_camp = mysql_num_rows($rslt);
|
||||
$w=0;
|
||||
@@ -805,8 +832,9 @@ echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP NOWRAP><a href=\"../agc_en/vicidial.
|
||||
$HKstatusnames = substr("$HKstatusnames", 0, -1);
|
||||
|
||||
##### grab the campaign settings
|
||||
$stmt="SELECT park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,agent_pause_codes_active,no_hopper_leads_logins,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,use_campaign_dnc,three_way_call_cid,dial_method FROM vicidial_campaigns where campaign_id = '$VD_campaign';";
|
||||
$stmt="SELECT park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,agent_pause_codes_active,no_hopper_leads_logins,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,use_campaign_dnc,three_way_call_cid,dial_method,three_way_dial_prefix FROM vicidial_campaigns where campaign_id = '$VD_campaign';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01013',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$park_ext = $row[0];
|
||||
@@ -849,6 +877,7 @@ echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP NOWRAP><a href=\"../agc_en/vicidial.
|
||||
$use_campaign_dnc = $row[37];
|
||||
$three_way_call_cid = $row[38];
|
||||
$dial_method = $row[39];
|
||||
$three_way_dial_prefix = $row[40];
|
||||
|
||||
if ( (!ereg('DISABLED',$VU_vicidial_recording_override)) and ($VU_vicidial_recording > 0) )
|
||||
{
|
||||
@@ -861,6 +890,8 @@ echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP NOWRAP><a href=\"../agc_en/vicidial.
|
||||
{$campaign_recording='NEVER';}
|
||||
if ($VU_alter_custphone_override=='ALLOW_ALTER')
|
||||
{$disable_alter_custphone='N';}
|
||||
if (strlen($three_way_dial_prefix) < 1)
|
||||
{$three_way_dial_prefix = $dial_prefix ;}
|
||||
if ($alt_number_dialing=='Y')
|
||||
{$alt_phone_dialing='1';}
|
||||
else
|
||||
@@ -877,11 +908,12 @@ echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP NOWRAP><a href=\"../agc_en/vicidial.
|
||||
$closer_campaigns = preg_replace("/ /","','",$closer_campaigns);
|
||||
$closer_campaigns = "'$closer_campaigns'";
|
||||
|
||||
if ($agent_pause_codes_active=='Y')
|
||||
if ( (ereg('Y',$agent_pause_codes_active)) or (ereg('FORCE',$agent_pause_codes_active)) )
|
||||
{
|
||||
##### grab the pause codes for this campaign
|
||||
$stmt="SELECT pause_code,pause_code_name FROM vicidial_pause_codes WHERE campaign_id='$VD_campaign' order by pause_code limit 50;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01014',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$VD_pause_codes = mysql_num_rows($rslt);
|
||||
$j=0;
|
||||
@@ -907,6 +939,7 @@ echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP NOWRAP><a href=\"../agc_en/vicidial.
|
||||
$VARingroups='';
|
||||
$stmt="select group_id from vicidial_inbound_groups where active = 'Y' and group_id IN($closer_campaigns) order by group_id limit 60;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01015',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$closer_ct = mysql_num_rows($rslt);
|
||||
$INgrpCT=0;
|
||||
@@ -930,6 +963,7 @@ echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP NOWRAP><a href=\"../agc_en/vicidial.
|
||||
$VARxfergroups='';
|
||||
$stmt="select group_id,group_name from vicidial_inbound_groups where active = 'Y' and group_id IN($xfer_groups) order by group_id limit 60;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01016',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$xfer_ct = mysql_num_rows($rslt);
|
||||
$XFgrpCT=0;
|
||||
@@ -948,6 +982,7 @@ echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP NOWRAP><a href=\"../agc_en/vicidial.
|
||||
##### grab the number of leads in the hopper for this campaign
|
||||
$stmt="SELECT count(*) FROM vicidial_hopper where campaign_id = '$VD_campaign' and status='READY';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01017',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$campaign_leads_to_call = $row[0];
|
||||
@@ -1013,6 +1048,7 @@ echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP NOWRAP><a href=\"../agc_en/vicidial.
|
||||
$alias_found=0;
|
||||
$stmt="select count(*) from phones_alias where alias_id = '$phone_login';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01018',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
$alias_ct = mysql_num_rows($rslt);
|
||||
if ($alias_ct > 0)
|
||||
{
|
||||
@@ -1023,6 +1059,7 @@ if ($alias_found > 0)
|
||||
{
|
||||
$stmt="select alias_name,logins_list from phones_alias where alias_id = '$phone_login' limit 1;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01019',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
$alias_ct = mysql_num_rows($rslt);
|
||||
if ($alias_ct > 0)
|
||||
{
|
||||
@@ -1054,6 +1091,7 @@ $authphone=0;
|
||||
$stmt="SELECT count(*) from phones where $phoneSQL and active = 'Y';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01020',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$authphone=$row[0];
|
||||
if (!$authphone)
|
||||
@@ -1105,27 +1143,28 @@ else
|
||||
if ($DB) {echo "|$stmtx|\n";}
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmtx, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01021',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
$rowx=mysql_fetch_row($rslt);
|
||||
|
||||
### get number of agents logged in to each server
|
||||
$stmt="SELECT count(*) from vicidial_live_agents where server_ip = '$rowx[0]';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01022',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
### find out whether the server is set to active
|
||||
$stmt="SELECT count(*) from servers where server_ip = '$rowx[0]' and active='Y';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01023',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
$rowy=mysql_fetch_row($rslt);
|
||||
|
||||
### find out whether the server_updater is running
|
||||
$stmt="SELECT count(*) from server_updater where server_ip = '$rowx[0]' and last_update > '$past_minutes_date';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01024',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
$rowz=mysql_fetch_row($rslt);
|
||||
|
||||
$pb_log .= "$phones_auto[$pb]|$rowx[0]|$row[0]|$rowy[0]|$rowz[0]| ";
|
||||
@@ -1147,6 +1186,7 @@ else
|
||||
$stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01025',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$extension=$row[0];
|
||||
$dialplan_number=$row[1];
|
||||
@@ -1217,16 +1257,16 @@ else
|
||||
{
|
||||
$stmt="UPDATE phones SET computer_ip='$ip' where login='$phone_login' and pass='$phone_pass' and active = 'Y';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01026',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
}
|
||||
}
|
||||
if ($TelefonoSComPIP == '2')
|
||||
{
|
||||
$stmt="UPDATE phones SET computer_ip='$ip' where login='$phone_login' and pass='$phone_pass' and active = 'Y';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01027',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
}
|
||||
if ($clientDST)
|
||||
{
|
||||
@@ -1247,6 +1287,7 @@ else
|
||||
$stmt="SELECT asterisk_version from servers where server_ip='$server_ip';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01028',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$asterisk_version=$row[0];
|
||||
|
||||
@@ -1300,10 +1341,12 @@ else
|
||||
$stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'vicidial';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01029',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
$stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','vicidial','$NOW_TIME','$session_name');";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01030',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
if ( ($campaign_allow_inbound == 'Y') || ($campaign_leads_to_call > 0) || (ereg('Y',$no_hopper_leads_logins)) )
|
||||
{
|
||||
@@ -1311,10 +1354,12 @@ else
|
||||
$stmt = "INSERT INTO vicidial_user_log (user,event,campaign_id,event_date,event_epoch,user_group) values('$VD_login','LOGIN','$VD_campaign','$NOW_TIME','$StarTtimE','$VU_user_group')";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01031',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
##### check to see if the user has a conf extension already, this happens if they previously exited uncleanly
|
||||
$stmt="SELECT conf_exten FROM vicidial_conferences where extension='$SIP_user' and server_ip = '$server_ip' LIMIT 1;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01032',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$prev_login_ct = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
@@ -1332,16 +1377,19 @@ else
|
||||
$stmt="SELECT count(*) FROM vicidial_conferences where server_ip='$server_ip' and ((extension='') or (extension is null));";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01033',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ($row[0] > 0)
|
||||
{
|
||||
$stmt="UPDATE vicidial_conferences set extension='$SIP_user', leave_3way='0' where server_ip='$server_ip' and ((extension='') or (extension is null)) limit 1;";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01034',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
$stmt="SELECT conf_exten from vicidial_conferences where server_ip='$server_ip' and ( (extension='$SIP_user') or (extension='$user') );";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01035',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$session_id = $row[0];
|
||||
}
|
||||
@@ -1352,24 +1400,28 @@ else
|
||||
$stmt="UPDATE vicidial_list set status='ERI', user='' where status IN('QUEUE','INCALL') and user ='$VD_login';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01036',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
print "<!-- lista invertita INCALL ed old QUEUE: |$affected_rows| -->\n";
|
||||
|
||||
$stmt="DELETE from vicidial_hopper where status IN('QUEUE','INCALL','DONE') and user ='$VD_login';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01037',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
print "<!-- INCALL hopper invertito ed old QUEUE: |$affected_rows| -->\n";
|
||||
|
||||
$stmt="DELETE from vicidial_live_agents where user ='$VD_login';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01038',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
print "<!-- vecchi record di vicidial_live_agents eliminati: |$affected_rows| -->\n";
|
||||
|
||||
$stmt="DELETE from vicidial_live_inbound_agents where user ='$VD_login';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01039',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
print "<!-- old vicidial_live_inbound_agents records cleared: |$affected_rows| -->\n";
|
||||
|
||||
@@ -1383,6 +1435,7 @@ else
|
||||
##### INIZIO SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,vicidial_agent_disable,allow_sipsak_messages FROM system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01040',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$qm_conf_ct = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
@@ -1414,6 +1467,7 @@ else
|
||||
$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);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01041',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
print "<!-- call placed to session_id: $session_id from phone: $SIP_user $SIP_user_DiaL -->\n";
|
||||
|
||||
@@ -1424,6 +1478,7 @@ else
|
||||
##### grab the campaign_weight and number of calls today su that campaign for the agent
|
||||
$stmt="SELECT campaign_weight,calls_today FROM vicidial_campaign_agents where user='$VD_login' and campaign_id = '$VD_campaign';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01042',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$vca_ct = mysql_num_rows($rslt);
|
||||
if ($vca_ct > 0)
|
||||
@@ -1440,6 +1495,7 @@ else
|
||||
$stmt="INSERT INTO vicidial_campaign_agents (user,campaign_id,campaign_rank,campaign_weight,calls_today) values('$VD_login','$VD_campaign','0','0','$calls_today');";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01043',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
print "<!-- new vicidial_campaign_agents record inserted: |$affected_rows| -->\n";
|
||||
}
|
||||
@@ -1447,6 +1503,7 @@ else
|
||||
$stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,user_level,campaign_weight,calls_today) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level','$campaign_weight','$calls_today');";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01044',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
print "<!-- nuovo record vicidial_live_agents inserito: |$affected_rows| -->\n";
|
||||
|
||||
@@ -1458,12 +1515,14 @@ else
|
||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='AGENTLOGIN',data1='$VD_login@agents',serverid='$queuemetrics_log_id';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $linkB);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01045',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
$affected_rows = mysql_affected_rows($linkB);
|
||||
print "<!-- queue_log AGENTLOGIN entry added: $VD_login|$affected_rows -->\n";
|
||||
|
||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='PAUSEALL',serverid='$queuemetrics_log_id';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $linkB);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01046',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
$affected_rows = mysql_affected_rows($linkB);
|
||||
print "<!-- queue_log PAUSE entry added: $VD_login|$affected_rows -->\n";
|
||||
|
||||
@@ -1484,6 +1543,7 @@ else
|
||||
$stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,user_level) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$user_level');";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01047',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
print "<!-- nuovo record vicidial_live_agents inserito: |$affected_rows| -->\n";
|
||||
|
||||
@@ -1495,12 +1555,14 @@ else
|
||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='$VD_campaign',agent='Agent/$VD_login',verb='AGENTLOGIN',data1='$VD_login@agents',serverid='$queuemetrics_log_id';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $linkB);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01048',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
$affected_rows = mysql_affected_rows($linkB);
|
||||
print "<!-- queue_log AGENTLOGIN entry added: $VD_login|$affected_rows -->\n";
|
||||
|
||||
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='PAUSEALL',serverid='$queuemetrics_log_id';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $linkB);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01049',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
$affected_rows = mysql_affected_rows($linkB);
|
||||
print "<!-- queue_log PAUSE entry added: $VD_login|$affected_rows -->\n";
|
||||
|
||||
@@ -1575,6 +1637,7 @@ echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP NOWRAP><a href=\"../agc_en/vicidial.
|
||||
$stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch,user_group,sub_status) values('$VD_login','$server_ip','$NOW_TIME','$VD_campaign','$StarTtimE','0','$StarTtimE','$VU_user_group','LOGIN');";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01050',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
$agent_log_id = mysql_insert_id($link);
|
||||
print "<!-- vicidial_agent_log record inserted: |$affected_rows|$agent_log_id| -->\n";
|
||||
@@ -1594,6 +1657,7 @@ echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP NOWRAP><a href=\"../agc_en/vicidial.
|
||||
##### grab the datails of all active scripts in the system
|
||||
$stmt="SELECT script_id,script_name,script_text FROM vicidial_scripts WHERE active='Y' order by script_id limit 100;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01051',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$MM_scripts = mysql_num_rows($rslt);
|
||||
$e=0;
|
||||
@@ -1885,6 +1949,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
var starting_dial_level = '<? echo $auto_dial_level ?>';
|
||||
var dial_timeout = '<? echo $dial_timeout ?>';
|
||||
var dial_prefix = '<? echo $dial_prefix ?>';
|
||||
var three_way_dial_prefix = '<? echo $three_way_dial_prefix ?>';
|
||||
var campaign_cid = '<? echo $campaign_cid ?>';
|
||||
var campaign_vdad_exten = '<? echo $campaign_vdad_exten ?>';
|
||||
var campaign_leads_to_call = '<? echo $campaign_leads_to_call ?>';
|
||||
@@ -1996,7 +2061,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
var CBuser = '';
|
||||
var CBcomments = '';
|
||||
var volumecontrol_active = '<? echo $volumecontrol_active ?>';
|
||||
var PausaCode_HTML = '';
|
||||
var PauseCode_HTML = '';
|
||||
var manual_auto_hotkey = 0;
|
||||
var dialed_number = '';
|
||||
var dialed_label = '';
|
||||
@@ -2029,9 +2094,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
var conf_dialed = 0;
|
||||
var leaving_threeway = 0;
|
||||
var dial_method = '<? echo $dial_method ?>';
|
||||
var DiaLControl_auto_HTML = "<IMG SRC=\"../agc/images/vdc_LB_pause_OFF.gif\" border=0 alt=\"Pausa\"><a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADready');\"><IMG SRC=\"../agc/images/vdc_LB_resume.gif\" border=0 alt=\"Riprendi\"></a>";
|
||||
var DiaLControl_auto_HTML_ready = "<a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADpause');\"><IMG SRC=\"../agc/images/vdc_LB_pause.gif\" border=0 alt=\"Pausa\"></a><IMG SRC=\"../agc/images/vdc_LB_resume_OFF.gif\" border=0 alt=\"Riprendi\">";
|
||||
var DiaLControl_auto_HTML_OFF = "<IMG SRC=\"../agc/images/vdc_LB_pause_OFF.gif\" border=0 alt=\"Pausa\"><IMG SRC=\"../agc/images/vdc_LB_resume_OFF.gif\" border=0 alt=\"Riprendi\">";
|
||||
var DiaLControl_auto_HTML = "<IMG SRC=\"../agc/images/vdc_LB_pause_OFF.gif\" border=0 alt=\" Pausa \"><a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADready');\"><IMG SRC=\"../agc/images/vdc_LB_resume.gif\" border=0 alt=\"Riprendi\"></a>";
|
||||
var DiaLControl_auto_HTML_ready = "<a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADpause');\"><IMG SRC=\"../agc/images/vdc_LB_pause.gif\" border=0 alt=\" Pausa \"></a><IMG SRC=\"../agc/images/vdc_LB_resume_OFF.gif\" border=0 alt=\"Riprendi\">";
|
||||
var DiaLControl_auto_HTML_OFF = "<IMG SRC=\"../agc/images/vdc_LB_pause_OFF.gif\" border=0 alt=\" Pausa \"><IMG SRC=\"../agc/images/vdc_LB_resume_OFF.gif\" border=0 alt=\"Riprendi\">";
|
||||
var DiaLControl_manual_HTML = "<a href=\"#\" onclick=\"ManualDialNext('','','','','');\"><IMG SRC=\"../agc/images/vdc_LB_dialnextnumber.gif\" border=0 alt=\"Chiama il prossimo numero\"></a>";
|
||||
var image_blank = new Image();
|
||||
image_blank.src="../agc/images/blank.gif";
|
||||
@@ -2260,8 +2325,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
{
|
||||
if (document.vicidial_form.xferoverride.checked==false)
|
||||
{
|
||||
if (dial_prefix == 'X') {var temp_dial_prefix = '';}
|
||||
else {var temp_dial_prefix = dial_prefix;}
|
||||
if (three_way_dial_prefix == 'X') {var temp_dial_prefix = '';}
|
||||
else {var temp_dial_prefix = three_way_dial_prefix;}
|
||||
if (omit_phone_code == 'Y') {var temp_phone_code = '';}
|
||||
else {var temp_phone_code = document.vicidial_form.phone_code.value;}
|
||||
|
||||
@@ -2882,8 +2947,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
{
|
||||
if (document.vicidial_form.xferoverride.checked==false)
|
||||
{
|
||||
if (dial_prefix == 'X') {var temp_dial_prefix = '';}
|
||||
else {var temp_dial_prefix = dial_prefix;}
|
||||
if (three_way_dial_prefix == 'X') {var temp_dial_prefix = '';}
|
||||
else {var temp_dial_prefix = three_way_dial_prefix;}
|
||||
if (omit_phone_code == 'Y') {var temp_phone_code = '';}
|
||||
else {var temp_phone_code = document.vicidial_form.phone_code.value;}
|
||||
|
||||
@@ -3148,7 +3213,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
}
|
||||
if (xmlhttp)
|
||||
{
|
||||
manDiaLlog_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLlogCaLL&stage=" + taskMDstage + "&uniqueid=" + document.vicidial_form.uniqueid.value +
|
||||
manDiaLlog_query = "format=text&server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLlogCaLL&stage=" + taskMDstage + "&uniqueid=" + document.vicidial_form.uniqueid.value +
|
||||
"&user=" + user + "&pass=" + pass + "&campaign=" + campaign +
|
||||
"&lead_id=" + document.vicidial_form.lead_id.value +
|
||||
"&list_id=" + document.vicidial_form.list_id.value +
|
||||
@@ -3164,7 +3229,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
|
||||
{
|
||||
var MDlogResponse = null;
|
||||
// alert(xmlhttp.responseText);
|
||||
// alert(xmlhttp.responseText);
|
||||
MDlogResponse = xmlhttp.responseText;
|
||||
var MDlogResponse_array=MDlogResponse.split("\n");
|
||||
MDlogLINE = MDlogResponse_array[0];
|
||||
@@ -3628,7 +3693,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
|
||||
AutoDial_ReSume_PauSe('VDADpause');
|
||||
|
||||
document.getElementById("DiaLControl").innerHTML = "<IMG SRC=\"../agc/images/vdc_LB_pause_OFF.gif\" border=0 alt=\"Pausa\"><IMG SRC=\"../agc/images/vdc_LB_resume_OFF.gif\" border=0 alt=\"Riprendi\"><BR><IMG SRC=\"../agc/images/vdc_LB_dialnextnumber_OFF.gif\" border=0 alt=\"Chiama il prossimo numero\">";
|
||||
document.getElementById("DiaLControl").innerHTML = "<IMG SRC=\"../agc/images/vdc_LB_pause_OFF.gif\" border=0 alt=\" Pausa \"><IMG SRC=\"../agc/images/vdc_LB_resume_OFF.gif\" border=0 alt=\"Riprendi\"><BR><IMG SRC=\"../agc/images/vdc_LB_dialnextnumber_OFF.gif\" border=0 alt=\"Chiama il prossimo numero\">";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3714,7 +3779,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
{
|
||||
auto_dial_level=starting_dial_level;
|
||||
|
||||
document.getElementById("DiaLControl").innerHTML = "<IMG SRC=\"../agc/images/vdc_LB_pause_OFF.gif\" border=0 alt=\"Pausa\"><a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADready');\"><IMG SRC=\"../agc/images/vdc_LB_resume.gif\" border=0 alt=\"Riprendi\"></a><BR><a href=\"#\" onclick=\"ManualDialNext('','','','','');\"><IMG SRC=\"../agc/images/vdc_LB_dialnextnumber.gif\" border=0 alt=\"Chiama il prossimo numero\"></a>";
|
||||
document.getElementById("DiaLControl").innerHTML = "<IMG SRC=\"../agc/images/vdc_LB_pause_OFF.gif\" border=0 alt=\" Pausa \"><a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADready');\"><IMG SRC=\"../agc/images/vdc_LB_resume.gif\" border=0 alt=\"Riprendi\"></a><BR><a href=\"#\" onclick=\"ManualDialNext('','','','','');\"><IMG SRC=\"../agc/images/vdc_LB_dialnextnumber.gif\" border=0 alt=\"Chiama il prossimo numero\"></a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3928,7 +3993,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
{
|
||||
auto_dial_level=starting_dial_level;
|
||||
|
||||
document.getElementById("DiaLControl").innerHTML = "<IMG SRC=\"../agc/images/vdc_LB_pause_OFF.gif\" border=0 alt=\"Pausa\"><IMG SRC=\"../agc/images/vdc_LB_resume_OFF.gif\" border=0 alt=\"Riprendi\"><BR><IMG SRC=\"../agc/images/vdc_LB_dialnextnumber_OFF.gif\" border=0 alt=\"Chiama il prossimo numero\">";
|
||||
document.getElementById("DiaLControl").innerHTML = "<IMG SRC=\"../agc/images/vdc_LB_pause_OFF.gif\" border=0 alt=\" Pausa \"><IMG SRC=\"../agc/images/vdc_LB_resume_OFF.gif\" border=0 alt=\"Riprendi\"><BR><IMG SRC=\"../agc/images/vdc_LB_dialnextnumber_OFF.gif\" border=0 alt=\"Chiama il prossimo numero\">";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -4017,7 +4082,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
|
||||
if (dial_method == "INBOUND_MAN")
|
||||
{
|
||||
document.getElementById("DiaLControl").innerHTML = "<IMG SRC=\"../agc/images/vdc_LB_pause_OFF.gif\" border=0 alt=\"Pausa\"><a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADready');\"><IMG SRC=\"../agc/images/vdc_LB_resume.gif\" border=0 alt=\"Riprendi\"></a><BR><a href=\"#\" onclick=\"ManualDialNext('','','','','');\"><IMG SRC=\"../agc/images/vdc_LB_dialnextnumber.gif\" border=0 alt=\"Chiama il prossimo numero\"></a>";
|
||||
document.getElementById("DiaLControl").innerHTML = "<IMG SRC=\"../agc/images/vdc_LB_pause_OFF.gif\" border=0 alt=\" Pausa \"><a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADready');\"><IMG SRC=\"../agc/images/vdc_LB_resume.gif\" border=0 alt=\"Riprendi\"></a><BR><a href=\"#\" onclick=\"ManualDialNext('','','','','');\"><IMG SRC=\"../agc/images/vdc_LB_dialnextnumber.gif\" border=0 alt=\"Chiama il prossimo numero\"></a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -4199,7 +4264,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
{
|
||||
auto_dial_level=starting_dial_level;
|
||||
|
||||
document.getElementById("DiaLControl").innerHTML = "<a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADpause');\"><IMG SRC=\"../agc/images/vdc_LB_pause.gif\" border=0 alt=\"Pausa\"></a><IMG SRC=\"../agc/images/vdc_LB_resume_OFF.gif\" border=0 alt=\"Riprendi\"></a><BR><a href=\"#\" onclick=\"ManualDialNext('','','','','');\"><IMG SRC=\"../agc/images/vdc_LB_dialnextnumber.gif\" border=0 alt=\"Chiama il prossimo numero\"></a>";
|
||||
document.getElementById("DiaLControl").innerHTML = "<a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADpause');\"><IMG SRC=\"../agc/images/vdc_LB_pause.gif\" border=0 alt=\" Pausa \"></a><IMG SRC=\"../agc/images/vdc_LB_resume_OFF.gif\" border=0 alt=\"Riprendi\"></a><BR><a href=\"#\" onclick=\"ManualDialNext('','','','','');\"><IMG SRC=\"../agc/images/vdc_LB_dialnextnumber.gif\" border=0 alt=\"Chiama il prossimo numero\"></a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -4215,12 +4280,17 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
{
|
||||
auto_dial_level=starting_dial_level;
|
||||
|
||||
document.getElementById("DiaLControl").innerHTML = "<IMG SRC=\"../agc/images/vdc_LB_pause_OFF.gif\" border=0 alt=\"Pausa\"><a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADready');\"><IMG SRC=\"../agc/images/vdc_LB_resume.gif\" border=0 alt=\"Riprendi\"></a><BR><a href=\"#\" onclick=\"ManualDialNext('','','','','');\"><IMG SRC=\"../agc/images/vdc_LB_dialnextnumber.gif\" border=0 alt=\"Chiama il prossimo numero\"></a>";
|
||||
document.getElementById("DiaLControl").innerHTML = "<IMG SRC=\"../agc/images/vdc_LB_pause_OFF.gif\" border=0 alt=\" Pausa \"><a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADready');\"><IMG SRC=\"../agc/images/vdc_LB_resume.gif\" border=0 alt=\"Riprendi\"></a><BR><a href=\"#\" onclick=\"ManualDialNext('','','','','');\"><IMG SRC=\"../agc/images/vdc_LB_dialnextnumber.gif\" border=0 alt=\"Chiama il prossimo numero\"></a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML;
|
||||
}
|
||||
|
||||
if (agent_pause_codes_active=='FORCE')
|
||||
{
|
||||
PauseCodeSelectContent_create();
|
||||
}
|
||||
}
|
||||
|
||||
var xmlhttp=false;
|
||||
@@ -4601,7 +4671,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
|
||||
if (dial_method == "INBOUND_MAN")
|
||||
{
|
||||
document.getElementById("DiaLControl").innerHTML = "<IMG SRC=\"../agc/images/vdc_LB_pause_OFF.gif\" border=0 alt=\"Pausa\"><IMG SRC=\"../agc/images/vdc_LB_resume_OFF.gif\" border=0 alt=\"Riprendi\"><BR><IMG SRC=\"../agc/images/vdc_LB_dialnextnumber_OFF.gif\" border=0 alt=\"Chiama il prossimo numero\">";
|
||||
document.getElementById("DiaLControl").innerHTML = "<IMG SRC=\"../agc/images/vdc_LB_pause_OFF.gif\" border=0 alt=\" Pausa \"><IMG SRC=\"../agc/images/vdc_LB_resume_OFF.gif\" border=0 alt=\"Riprendi\"><BR><IMG SRC=\"../agc/images/vdc_LB_dialnextnumber_OFF.gif\" border=0 alt=\"Chiama il prossimo numero\">";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -5070,7 +5140,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
document.getElementById("MainStatuSSpan").innerHTML = '';
|
||||
if (dial_method == "INBOUND_MAN")
|
||||
{
|
||||
document.getElementById("DiaLControl").innerHTML = "<IMG SRC=\"../agc/images/vdc_LB_pause_OFF.gif\" border=0 alt=\"Pausa\"><IMG SRC=\"../agc/images/vdc_LB_resume_OFF.gif\" border=0 alt=\"Riprendi\"><BR><IMG SRC=\"../agc/images/vdc_LB_dialnextnumber_OFF.gif\" border=0 alt=\"Chiama il prossimo numero\">";
|
||||
document.getElementById("DiaLControl").innerHTML = "<IMG SRC=\"../agc/images/vdc_LB_pause_OFF.gif\" border=0 alt=\" Pausa \"><IMG SRC=\"../agc/images/vdc_LB_resume_OFF.gif\" border=0 alt=\"Riprendi\"><BR><IMG SRC=\"../agc/images/vdc_LB_dialnextnumber_OFF.gif\" border=0 alt=\"Chiama il prossimo numero\">";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -5086,7 +5156,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
document.getElementById("MainStatuSSpan").style.background = panel_bgcolor;
|
||||
if (dial_method == "INBOUND_MAN")
|
||||
{
|
||||
document.getElementById("DiaLControl").innerHTML = "<IMG SRC=\"../agc/images/vdc_LB_pause_OFF.gif\" border=0 alt=\"Pausa\"><IMG SRC=\"../agc/images/vdc_LB_resume_OFF.gif\" border=0 alt=\"Riprendi\"><BR><IMG SRC=\"../agc/images/vdc_LB_dialnextnumber_OFF.gif\" border=0 alt=\"Chiama il prossimo numero\">";
|
||||
document.getElementById("DiaLControl").innerHTML = "<IMG SRC=\"../agc/images/vdc_LB_pause_OFF.gif\" border=0 alt=\" Pausa \"><IMG SRC=\"../agc/images/vdc_LB_resume_OFF.gif\" border=0 alt=\"Riprendi\"><BR><IMG SRC=\"../agc/images/vdc_LB_dialnextnumber_OFF.gif\" border=0 alt=\"Chiama il prossimo numero\">";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -5348,22 +5418,28 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
}
|
||||
else
|
||||
{
|
||||
showDiv('PausaCodeSelectBox');
|
||||
showDiv('PauseCodeSelectBox');
|
||||
WaitingForNextStep=1;
|
||||
PausaCode_HTML = '';
|
||||
document.vicidial_form.PausaCodeSelection.value = '';
|
||||
PauseCode_HTML = '';
|
||||
document.vicidial_form.PauseCodeSelection.value = '';
|
||||
var VD_pause_codes_ct_half = parseInt(VD_pause_codes_ct / 2);
|
||||
PausaCode_HTML = "<table cellpadding=5 cellspacing=5 width=500><tr><td colspan=2><B> PAUSE CODE</B></td></tr><tr><td bgcolor=\"#99FF99\" height=300 width=240 valign=top><font class=\"log_text\"><span id=PausaCodeSelectA>";
|
||||
PauseCode_HTML = "<table cellpadding=5 cellspacing=5 width=500><tr><td colspan=2><B> PAUSE CODE</B></td></tr><tr><td bgcolor=\"#99FF99\" height=300 width=240 valign=top><font class=\"log_text\"><span id=PauseCodeSelectA>";
|
||||
var loop_ct = 0;
|
||||
while (loop_ct < VD_pause_codes_ct)
|
||||
{
|
||||
PausaCode_HTML = PausaCode_HTML + "<font size=3 style=\"BACKGROUND-COLOR: #FFFFCC\"><b><a href=\"#\" onclick=\"PausaCodeSelect_submit('" + VARpause_codes[loop_ct] + "');return false;\">" + VARpause_codes[loop_ct] + " - " + VARpause_code_names[loop_ct] + "</a></b></font><BR><BR>";
|
||||
PauseCode_HTML = PauseCode_HTML + "<font size=3 style=\"BACKGROUND-COLOR: #FFFFCC\"><b><a href=\"#\" onclick=\"PauseCodeSelect_submit('" + VARpause_codes[loop_ct] + "');return false;\">" + VARpause_codes[loop_ct] + " - " + VARpause_code_names[loop_ct] + "</a></b></font><BR><BR>";
|
||||
loop_ct++;
|
||||
if (loop_ct == VD_pause_codes_ct_half)
|
||||
{PausaCode_HTML = PausaCode_HTML + "</span></font></td><td bgcolor=\"#99FF99\" height=300 width=240 valign=top><font class=\"log_text\"><span id=PausaCodeSelectB>";}
|
||||
{PauseCode_HTML = PauseCode_HTML + "</span></font></td><td bgcolor=\"#99FF99\" height=300 width=240 valign=top><font class=\"log_text\"><span id=PauseCodeSelectB>";}
|
||||
}
|
||||
PausaCode_HTML = PausaCode_HTML + "</span></font></td></tr></table><BR><BR><font size=3 style=\"BACKGROUND-COLOR: #FFFFCC\"><b><a href=\"#\" onclick=\"PausaCodeSelect_submit('');return false;\">Torna Indietro</a>";
|
||||
document.getElementById("PausaCodeSelectContent").innerHTML = PausaCode_HTML;
|
||||
|
||||
if (agent_pause_codes_active=='FORCE')
|
||||
{var Go_BacK_LinK = '';}
|
||||
else
|
||||
{var Go_BacK_LinK = "<font size=3 style=\"BACKGROUND-COLOR: #FFFFCC\"><b><a href=\"#\" onclick=\"PauseCodeSelect_submit('');return false;\">Torna Indietro</a>";}
|
||||
|
||||
PauseCode_HTML = PauseCode_HTML + "</span></font></td></tr></table><BR><BR>" + Go_BacK_LinK;
|
||||
document.getElementById("PauseCodeSelectContent").innerHTML = PauseCode_HTML;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5565,7 +5641,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
// Submit the Pausa Code
|
||||
function PauseCodeSelect_submit(newpausecode)
|
||||
{
|
||||
hideDiv('PausaCodeSelectBox');
|
||||
hideDiv('PauseCodeSelectBox');
|
||||
WaitingForNextStep=0;
|
||||
|
||||
var xmlhttp=false;
|
||||
@@ -5589,7 +5665,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
}
|
||||
if (xmlhttp)
|
||||
{
|
||||
VMCpausecode_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=PausaCodeSubmit&format=text&status=" + newpausecode + "&agent_log_id=" + agent_log_id + "&campaign=" + campaign + "&extension=" + extension + "&protocol=" + protocol + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages;
|
||||
VMCpausecode_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=PauseCodeSubmit&format=text&status=" + newpausecode + "&agent_log_id=" + agent_log_id + "&campaign=" + campaign + "&extension=" + extension + "&protocol=" + protocol + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages;
|
||||
xmlhttp.open('POST', 'vdc_db_query.php');
|
||||
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
|
||||
xmlhttp.send(VMCpausecode_query);
|
||||
@@ -6569,7 +6645,7 @@ else
|
||||
hideDiv('DispoButtonHideC');
|
||||
hideDiv('CallBacKsLisTBox');
|
||||
hideDiv('NeWManuaLDiaLBox');
|
||||
hideDiv('PausaCodeSelectBox');
|
||||
hideDiv('PauseCodeSelectBox');
|
||||
if (agentonly_callbacks != '1')
|
||||
{hideDiv('CallbacksButtons');}
|
||||
// if ( (agentcall_manual != '1') && (starting_dial_level > 0) )
|
||||
@@ -6590,9 +6666,9 @@ else
|
||||
|
||||
document.vicidial_form.LeadLookuP.checked=true;
|
||||
|
||||
if (agent_pause_codes_active=='Y')
|
||||
if ( (agent_pause_codes_active=='Y') || (agent_pause_codes_active=='FORCE') )
|
||||
{
|
||||
document.getElementById("PausaCodeLinkSpan").innerHTML = "<a href=\"#\" onclick=\"PausaCodeSelectContent_create();return false;\">INSERIRE UN CODICE PAUSA</a>";
|
||||
document.getElementById("PauseCodeLinkSpan").innerHTML = "<a href=\"#\" onclick=\"PauseCodeSelectContent_create();return false;\">INSERIRE UN CODICE PAUSA</a>";
|
||||
}
|
||||
if (VICIDiaL_allow_closers < 1)
|
||||
{
|
||||
@@ -7174,7 +7250,7 @@ else
|
||||
{
|
||||
if (dial_method == "INBOUND_MAN")
|
||||
{
|
||||
document.getElementById("DiaLControl").innerHTML = "<IMG SRC=\"../agc/images/vdc_LB_pause_OFF.gif\" border=0 alt=\"Pausa\"><a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADready');\"><IMG SRC=\"../agc/images/vdc_LB_resume.gif\" border=0 alt=\"Riprendi\"></a><BR><a href=\"#\" onclick=\"ManualDialNext('','','','','');\"><IMG SRC=\"../agc/images/vdc_LB_dialnextnumber.gif\" border=0 alt=\"Chiama il prossimo numero\"></a>";
|
||||
document.getElementById("DiaLControl").innerHTML = "<IMG SRC=\"../agc/images/vdc_LB_pause_OFF.gif\" border=0 alt=\" Pausa \"><a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADready');\"><IMG SRC=\"../agc/images/vdc_LB_resume.gif\" border=0 alt=\"Riprendi\"></a><BR><a href=\"#\" onclick=\"ManualDialNext('','','','','');\"><IMG SRC=\"../agc/images/vdc_LB_dialnextnumber.gif\" border=0 alt=\"Chiama il prossimo numero\"></a>";
|
||||
if (manual_dial_preview == 1)
|
||||
{buildDiv('DiaLLeaDPrevieW');}
|
||||
}
|
||||
@@ -7273,8 +7349,8 @@ echo "</head>\n";
|
||||
<span id="CBstatusSpan">X CHIAMATABACK ATTIVE</span> <BR>
|
||||
</font></span>
|
||||
|
||||
<span style="position:absolute;left:500px;top:<?=$CBheight ?>px;z-index:14;" id="PausaCodeButtons"><font class="body_text">
|
||||
<span id="PausaCodeLinkSpan"></span> <BR>
|
||||
<span style="position:absolute;left:500px;top:<?=$CBheight ?>px;z-index:14;" id="PauseCodeButtons"><font class="body_text">
|
||||
<span id="PauseCodeLinkSpan"></span> <BR>
|
||||
</font></span>
|
||||
|
||||
<span style="position:absolute;left:<?=$SCwidth ?>px;top:49px;z-index:18;" id="SecondSspan"><font class="body_text"> secondi:
|
||||
@@ -7516,10 +7592,10 @@ Il tuo stato: <span id="AgentStatoStato"></span> <BR>Calls Dialing: <span id="Ag
|
||||
</TD></TR></TABLE>
|
||||
</span>
|
||||
|
||||
<span style="position:absolute;left:0px;top:0px;z-index:42;" id="PausaCodeSelectBox">
|
||||
<span style="position:absolute;left:0px;top:0px;z-index:42;" id="PauseCodeSelectBox">
|
||||
<table border=1 bgcolor="#CCFFCC" width=<?=$CAwidth ?> height=460><TR><TD align=center VALIGN=top> SELEZIONARE UN CODICE PAUSA:<BR>
|
||||
<span id="PausaCodeSelectContent"> Pausa Code Selection </span>
|
||||
<input type=hidden name=PausaCodeSelection>
|
||||
<span id="PauseCodeSelectContent"> Pausa Code Selection </span>
|
||||
<input type=hidden name=PauseCodeSelection>
|
||||
<BR><BR>
|
||||
</TD></TR></TABLE>
|
||||
</span>
|
||||
@@ -7760,6 +7836,26 @@ else
|
||||
exit;
|
||||
|
||||
|
||||
##### MySQL Error Logging #####
|
||||
function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log)
|
||||
{
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
# mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log);
|
||||
$errno=''; $error='';
|
||||
if ( ($mel > 0) or ($one_mysql_log > 0) )
|
||||
{
|
||||
$errno = mysql_errno($link);
|
||||
if ( ($errno > 0) or ($mel > 1) or ($one_mysql_log > 0) )
|
||||
{
|
||||
$error = mysql_error($link);
|
||||
$efp = fopen ("./vicidial_mysql_errors.txt", "a");
|
||||
fwrite ($efp, "$NOW_TIME|vicidial |$query_id|$errno|$error|$stmt|$user|$server_ip|$session_name|\n");
|
||||
fclose($efp);
|
||||
}
|
||||
}
|
||||
$one_mysql_log=0;
|
||||
return $errno;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
# 80722-2149 - Added Status Category stats
|
||||
# 81015-0705 - Added IVR calls count
|
||||
# 81024-0037 - Added multi-select inbound-groups
|
||||
# 81105-2118 - Added Answered calls 15-minute breakdown
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -104,6 +105,7 @@ while($i < $group_ct)
|
||||
{
|
||||
$group_string .= "$group[$i]|";
|
||||
$group_SQL .= "'$group[$i]',";
|
||||
$groupQS .= "&group[]=$group[$i]";
|
||||
$i++;
|
||||
}
|
||||
if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) )
|
||||
@@ -177,7 +179,11 @@ echo "<SELECT SIZE=5 NAME=group[] multiple>\n";
|
||||
}
|
||||
echo "</SELECT>\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 "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> ";
|
||||
echo "<a href=\"./admin.php?ADD=3111&group_id=$group[0]\">MODIFICA</a> | ";
|
||||
echo "<a href=\"./admin.php?ADD=999999\">REPORT</a> | ";
|
||||
echo "<a href=\"./AST_IVRstats.php?query_date=$query_date&end_date=$end_date&shift=$shift$groupQS\">IVR REPORT</a> \n";
|
||||
echo "</FONT>\n";
|
||||
|
||||
echo "</TD></TR>\n";
|
||||
echo "<TR><TD>\n";
|
||||
@@ -301,6 +307,11 @@ $rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
$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 status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE');";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rowy=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 IN($group_SQL) and comment_b='START';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
@@ -317,9 +328,28 @@ else
|
||||
$average_call_seconds = round($average_call_seconds, 0);
|
||||
$average_call_seconds = sprintf("%10s", $average_call_seconds);
|
||||
}
|
||||
$ANSWEREDcalls = sprintf("%10s", $rowy[0]);
|
||||
if ( ($ANSWEREDcalls < 1) or ($TOTALcalls < 1) )
|
||||
{$ANSWEREDpercent = '0';}
|
||||
else
|
||||
{
|
||||
$ANSWEREDpercent = (($ANSWEREDcalls / $TOTALcalls) * 100);
|
||||
$ANSWEREDpercent = round($ANSWEREDpercent, 0);
|
||||
}
|
||||
if ( ($rowy[0] < 1) or ($ANSWEREDcalls < 1) )
|
||||
{$average_answer_seconds = ' 0';}
|
||||
else
|
||||
{
|
||||
$average_answer_seconds = ($rowy[1] / $rowy[0]);
|
||||
$average_answer_seconds = round($average_answer_seconds, 2);
|
||||
$average_answer_seconds = sprintf("%10s", $average_answer_seconds);
|
||||
}
|
||||
|
||||
|
||||
echo "Llamadas totales tomadas in to this In-Gruppo: $TOTALcalls\n";
|
||||
echo "Average Call Length for all Calls: $average_call_seconds seconds\n";
|
||||
echo "Answered Calls: $ANSWEREDcalls $ANSWEREDpercent%\n";
|
||||
echo "Average queue time for Answered Calls: $average_answer_seconds seconds\n";
|
||||
echo "Calls taken into the IVR for this In-Gruppo: $IVRcalls\n";
|
||||
|
||||
echo "\n";
|
||||
@@ -349,8 +379,15 @@ else
|
||||
$average_hold_seconds = round($average_hold_seconds, 0);
|
||||
$average_hold_seconds = sprintf("%10s", $average_hold_seconds);
|
||||
}
|
||||
if ( ($ANSWEREDcalls < 1) or ($DROPcalls < 1) )
|
||||
{$DROP_ANSWEREDpercent = '0';}
|
||||
else
|
||||
{
|
||||
$DROP_ANSWEREDpercent = (($DROPcalls / $ANSWEREDcalls) * 100);
|
||||
$DROP_ANSWEREDpercent = round($DROP_ANSWEREDpercent, 0);
|
||||
}
|
||||
|
||||
echo "Totale Chiamate ABBATTUTE: $DROPcalls $DROPpercent%\n";
|
||||
echo "Totale Chiamate ABBATTUTE: $DROPcalls $DROPpercent% drop/answered: $DROP_ANSWEREDpercent%\n";
|
||||
echo "Average hold time for DROP Calls: $average_hold_seconds seconds\n";
|
||||
|
||||
|
||||
@@ -435,7 +472,7 @@ echo "Average QUEUE Length across all calls: $average_total_queue_seconds
|
||||
|
||||
|
||||
##############################
|
||||
######### CALL HOLD TIME BREAKDONW IN SECONDS
|
||||
######### CALL HOLD TIME BREAKDOWN IN SECONDS
|
||||
|
||||
$TOTALcalls = 0;
|
||||
|
||||
@@ -497,6 +534,278 @@ echo "+-------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
##############################
|
||||
######### CALL DROP TIME BREAKDOWN IN SECONDS
|
||||
|
||||
$BDdropCALLS = 0;
|
||||
|
||||
echo "\n";
|
||||
echo "---------- CALL DROP TIME BREAKDOWN IN SECONDS\n";
|
||||
echo "+-------------------------------------------------------------------------------------------+------------+\n";
|
||||
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 IN($group_SQL) and status IN('DROP','XDROP') group by queue_seconds;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$reasons_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $reasons_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
$BDdropCALLS = ($BDdropCALLS + $row[0]);
|
||||
|
||||
if ($row[1] == 0) {$dd_0 = ($dd_0 + $row[0]);}
|
||||
if ( ($row[1] > 0) and ($row{1} <= 5) ) {$dd_5 = ($dd_5 + $row[0]);}
|
||||
if ( ($row[1] > 5) and ($row{1} <= 10) ) {$dd10 = ($dd10 + $row[0]);}
|
||||
if ( ($row[1] > 10) and ($row{1} <= 15) ) {$dd15 = ($dd15 + $row[0]);}
|
||||
if ( ($row[1] > 15) and ($row{1} <= 20) ) {$dd20 = ($dd20 + $row[0]);}
|
||||
if ( ($row[1] > 20) and ($row{1} <= 25) ) {$dd25 = ($dd25 + $row[0]);}
|
||||
if ( ($row[1] > 25) and ($row{1} <= 30) ) {$dd30 = ($dd30 + $row[0]);}
|
||||
if ( ($row[1] > 30) and ($row{1} <= 35) ) {$dd35 = ($dd35 + $row[0]);}
|
||||
if ( ($row[1] > 35) and ($row{1} <= 40) ) {$dd40 = ($dd40 + $row[0]);}
|
||||
if ( ($row[1] > 40) and ($row{1} <= 45) ) {$dd45 = ($dd45 + $row[0]);}
|
||||
if ( ($row[1] > 45) and ($row{1} <= 50) ) {$dd50 = ($dd50 + $row[0]);}
|
||||
if ( ($row[1] > 50) and ($row{1} <= 55) ) {$dd55 = ($dd55 + $row[0]);}
|
||||
if ( ($row[1] > 55) and ($row{1} <= 60) ) {$dd60 = ($dd60 + $row[0]);}
|
||||
if ( ($row[1] > 60) and ($row{1} <= 90) ) {$dd90 = ($dd90 + $row[0]);}
|
||||
if ($row[1] > 90) {$dd99 = ($dd99 + $row[0]);}
|
||||
$i++;
|
||||
}
|
||||
|
||||
$dd_0 = sprintf("%5s", $dd_0);
|
||||
$dd_5 = sprintf("%5s", $dd_5);
|
||||
$dd10 = sprintf("%5s", $dd10);
|
||||
$dd15 = sprintf("%5s", $dd15);
|
||||
$dd20 = sprintf("%5s", $dd20);
|
||||
$dd25 = sprintf("%5s", $dd25);
|
||||
$dd30 = sprintf("%5s", $dd30);
|
||||
$dd35 = sprintf("%5s", $dd35);
|
||||
$dd40 = sprintf("%5s", $dd40);
|
||||
$dd45 = sprintf("%5s", $dd45);
|
||||
$dd50 = sprintf("%5s", $dd50);
|
||||
$dd55 = sprintf("%5s", $dd55);
|
||||
$dd60 = sprintf("%5s", $dd60);
|
||||
$dd90 = sprintf("%5s", $dd90);
|
||||
$dd99 = sprintf("%5s", $dd99);
|
||||
|
||||
$BDdropCALLS = sprintf("%10s", $BDdropCALLS);
|
||||
|
||||
echo "| $dd_0 $dd_5 $dd10 $dd15 $dd20 $dd25 $dd30 $dd35 $dd40 $dd45 $dd50 $dd55 $dd60 $dd90 $dd99 | $BDdropCALLS |\n";
|
||||
echo "+-------------------------------------------------------------------------------------------+------------+\n";
|
||||
|
||||
|
||||
|
||||
|
||||
##############################
|
||||
######### CALL ANSWERED TIME AND PERCENT BREAKDOWN IN SECONDS
|
||||
|
||||
$BDansweredCALLS = 0;
|
||||
|
||||
echo "\n";
|
||||
echo " CALL ANSWERED TIME AND PERCENT BREAKDOWN IN SECONDS\n";
|
||||
echo " +-------------------------------------------------------------------------------------------+------------+\n";
|
||||
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 IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE') group by queue_seconds;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$reasons_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $reasons_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
$BDansweredCALLS = ($BDansweredCALLS + $row[0]);
|
||||
|
||||
### Get interval totals
|
||||
if ($row[1] == 0) {$ad_0 = ($ad_0 + $row[0]);}
|
||||
if ( ($row[1] > 0) and ($row{1} <= 5) ) {$ad_5 = ($ad_5 + $row[0]);}
|
||||
if ( ($row[1] > 5) and ($row{1} <= 10) ) {$ad10 = ($ad10 + $row[0]);}
|
||||
if ( ($row[1] > 10) and ($row{1} <= 15) ) {$ad15 = ($ad15 + $row[0]);}
|
||||
if ( ($row[1] > 15) and ($row{1} <= 20) ) {$ad20 = ($ad20 + $row[0]);}
|
||||
if ( ($row[1] > 20) and ($row{1} <= 25) ) {$ad25 = ($ad25 + $row[0]);}
|
||||
if ( ($row[1] > 25) and ($row{1} <= 30) ) {$ad30 = ($ad30 + $row[0]);}
|
||||
if ( ($row[1] > 30) and ($row{1} <= 35) ) {$ad35 = ($ad35 + $row[0]);}
|
||||
if ( ($row[1] > 35) and ($row{1} <= 40) ) {$ad40 = ($ad40 + $row[0]);}
|
||||
if ( ($row[1] > 40) and ($row{1} <= 45) ) {$ad45 = ($ad45 + $row[0]);}
|
||||
if ( ($row[1] > 45) and ($row{1} <= 50) ) {$ad50 = ($ad50 + $row[0]);}
|
||||
if ( ($row[1] > 50) and ($row{1} <= 55) ) {$ad55 = ($ad55 + $row[0]);}
|
||||
if ( ($row[1] > 55) and ($row{1} <= 60) ) {$ad60 = ($ad60 + $row[0]);}
|
||||
if ( ($row[1] > 60) and ($row{1} <= 90) ) {$ad90 = ($ad90 + $row[0]);}
|
||||
if ($row[1] > 90) {$ad99 = ($ad99 + $row[0]);}
|
||||
$i++;
|
||||
}
|
||||
|
||||
### Calculate cumulative totals
|
||||
$Cad_0 =$ad_0;
|
||||
$Cad_5 =($Cad_0 + $ad_5);
|
||||
$Cad10 =($Cad_5 + $ad10);
|
||||
$Cad15 =($Cad10 + $ad15);
|
||||
$Cad20 =($Cad15 + $ad20);
|
||||
$Cad25 =($Cad20 + $ad25);
|
||||
$Cad30 =($Cad25 + $ad30);
|
||||
$Cad35 =($Cad30 + $ad35);
|
||||
$Cad40 =($Cad35 + $ad40);
|
||||
$Cad45 =($Cad40 + $ad45);
|
||||
$Cad50 =($Cad45 + $ad50);
|
||||
$Cad55 =($Cad50 + $ad55);
|
||||
$Cad60 =($Cad55 + $ad60);
|
||||
$Cad90 =($Cad60 + $ad90);
|
||||
$Cad99 =($Cad90 + $ad99);
|
||||
|
||||
### Calculate interval percentages
|
||||
$pad_0=0; $pad_5=0; $pad10=0; $pad15=0; $pad20=0; $pad25=0; $pad30=0; $pad35=0; $pad40=0; $pad45=0; $pad50=0; $pad55=0; $pad60=0; $pad90=0; $pad99=0;
|
||||
$pCad_0=0; $pCad_5=0; $pCad10=0; $pCad15=0; $pCad20=0; $pCad25=0; $pCad30=0; $pCad35=0; $pCad40=0; $pCad45=0; $pCad50=0; $pCad55=0; $pCad60=0; $pCad90=0; $pCad99=0;
|
||||
if ( ($BDansweredCALLS > 0) and ($TOTALcalls > 0) )
|
||||
{
|
||||
if ($ad_0 > 0) {$pad_0 = (($ad_0 / $TOTALcalls) * 100); $pad_0 = round($pad_0, 0);}
|
||||
if ($ad_5 > 0) {$pad_5 = (($ad_5 / $TOTALcalls) * 100); $pad_5 = round($pad_5, 0);}
|
||||
if ($ad10 > 0) {$pad10 = (($ad10 / $TOTALcalls) * 100); $pad10 = round($pad10, 0);}
|
||||
if ($ad15 > 0) {$pad15 = (($ad15 / $TOTALcalls) * 100); $pad15 = round($pad15, 0);}
|
||||
if ($ad20 > 0) {$pad20 = (($ad20 / $TOTALcalls) * 100); $pad20 = round($pad20, 0);}
|
||||
if ($ad25 > 0) {$pad25 = (($ad25 / $TOTALcalls) * 100); $pad25 = round($pad25, 0);}
|
||||
if ($ad30 > 0) {$pad30 = (($ad30 / $TOTALcalls) * 100); $pad30 = round($pad30, 0);}
|
||||
if ($ad35 > 0) {$pad35 = (($ad35 / $TOTALcalls) * 100); $pad35 = round($pad35, 0);}
|
||||
if ($ad40 > 0) {$pad40 = (($ad40 / $TOTALcalls) * 100); $pad40 = round($pad40, 0);}
|
||||
if ($ad45 > 0) {$pad45 = (($ad45 / $TOTALcalls) * 100); $pad45 = round($pad45, 0);}
|
||||
if ($ad50 > 0) {$pad50 = (($ad50 / $TOTALcalls) * 100); $pad50 = round($pad50, 0);}
|
||||
if ($ad55 > 0) {$pad55 = (($ad55 / $TOTALcalls) * 100); $pad55 = round($pad55, 0);}
|
||||
if ($ad60 > 0) {$pad60 = (($ad60 / $TOTALcalls) * 100); $pad60 = round($pad60, 0);}
|
||||
if ($ad90 > 0) {$pad90 = (($ad90 / $TOTALcalls) * 100); $pad90 = round($pad90, 0);}
|
||||
if ($ad99 > 0) {$pad99 = (($ad99 / $TOTALcalls) * 100); $pad99 = round($pad99, 0);}
|
||||
|
||||
if ($Cad_0 > 0) {$pCad_0 = (($Cad_0 / $TOTALcalls) * 100); $pCad_0 = round($pCad_0, 0);}
|
||||
if ($Cad_5 > 0) {$pCad_5 = (($Cad_5 / $TOTALcalls) * 100); $pCad_5 = round($pCad_5, 0);}
|
||||
if ($Cad10 > 0) {$pCad10 = (($Cad10 / $TOTALcalls) * 100); $pCad10 = round($pCad10, 0);}
|
||||
if ($Cad15 > 0) {$pCad15 = (($Cad15 / $TOTALcalls) * 100); $pCad15 = round($pCad15, 0);}
|
||||
if ($Cad20 > 0) {$pCad20 = (($Cad20 / $TOTALcalls) * 100); $pCad20 = round($pCad20, 0);}
|
||||
if ($Cad25 > 0) {$pCad25 = (($Cad25 / $TOTALcalls) * 100); $pCad25 = round($pCad25, 0);}
|
||||
if ($Cad30 > 0) {$pCad30 = (($Cad30 / $TOTALcalls) * 100); $pCad30 = round($pCad30, 0);}
|
||||
if ($Cad35 > 0) {$pCad35 = (($Cad35 / $TOTALcalls) * 100); $pCad35 = round($pCad35, 0);}
|
||||
if ($Cad40 > 0) {$pCad40 = (($Cad40 / $TOTALcalls) * 100); $pCad40 = round($pCad40, 0);}
|
||||
if ($Cad45 > 0) {$pCad45 = (($Cad45 / $TOTALcalls) * 100); $pCad45 = round($pCad45, 0);}
|
||||
if ($Cad50 > 0) {$pCad50 = (($Cad50 / $TOTALcalls) * 100); $pCad50 = round($pCad50, 0);}
|
||||
if ($Cad55 > 0) {$pCad55 = (($Cad55 / $TOTALcalls) * 100); $pCad55 = round($pCad55, 0);}
|
||||
if ($Cad60 > 0) {$pCad60 = (($Cad60 / $TOTALcalls) * 100); $pCad60 = round($pCad60, 0);}
|
||||
if ($Cad90 > 0) {$pCad90 = (($Cad90 / $TOTALcalls) * 100); $pCad90 = round($pCad90, 0);}
|
||||
if ($Cad99 > 0) {$pCad99 = (($Cad99 / $TOTALcalls) * 100); $pCad99 = round($pCad99, 0);}
|
||||
|
||||
if ($Cad_0 > 0) {$ApCad_0 = (($Cad_0 / $BDansweredCALLS) * 100); $ApCad_0 = round($ApCad_0, 0);}
|
||||
if ($Cad_5 > 0) {$ApCad_5 = (($Cad_5 / $BDansweredCALLS) * 100); $ApCad_5 = round($ApCad_5, 0);}
|
||||
if ($Cad10 > 0) {$ApCad10 = (($Cad10 / $BDansweredCALLS) * 100); $ApCad10 = round($ApCad10, 0);}
|
||||
if ($Cad15 > 0) {$ApCad15 = (($Cad15 / $BDansweredCALLS) * 100); $ApCad15 = round($ApCad15, 0);}
|
||||
if ($Cad20 > 0) {$ApCad20 = (($Cad20 / $BDansweredCALLS) * 100); $ApCad20 = round($ApCad20, 0);}
|
||||
if ($Cad25 > 0) {$ApCad25 = (($Cad25 / $BDansweredCALLS) * 100); $ApCad25 = round($ApCad25, 0);}
|
||||
if ($Cad30 > 0) {$ApCad30 = (($Cad30 / $BDansweredCALLS) * 100); $ApCad30 = round($ApCad30, 0);}
|
||||
if ($Cad35 > 0) {$ApCad35 = (($Cad35 / $BDansweredCALLS) * 100); $ApCad35 = round($ApCad35, 0);}
|
||||
if ($Cad40 > 0) {$ApCad40 = (($Cad40 / $BDansweredCALLS) * 100); $ApCad40 = round($ApCad40, 0);}
|
||||
if ($Cad45 > 0) {$ApCad45 = (($Cad45 / $BDansweredCALLS) * 100); $ApCad45 = round($ApCad45, 0);}
|
||||
if ($Cad50 > 0) {$ApCad50 = (($Cad50 / $BDansweredCALLS) * 100); $ApCad50 = round($ApCad50, 0);}
|
||||
if ($Cad55 > 0) {$ApCad55 = (($Cad55 / $BDansweredCALLS) * 100); $ApCad55 = round($ApCad55, 0);}
|
||||
if ($Cad60 > 0) {$ApCad60 = (($Cad60 / $BDansweredCALLS) * 100); $ApCad60 = round($ApCad60, 0);}
|
||||
if ($Cad90 > 0) {$ApCad90 = (($Cad90 / $BDansweredCALLS) * 100); $ApCad90 = round($ApCad90, 0);}
|
||||
if ($Cad99 > 0) {$ApCad99 = (($Cad99 / $BDansweredCALLS) * 100); $ApCad99 = round($ApCad99, 0);}
|
||||
}
|
||||
|
||||
### Format variables
|
||||
$ad_0 = sprintf("%5s", $ad_0);
|
||||
$ad_5 = sprintf("%5s", $ad_5);
|
||||
$ad10 = sprintf("%5s", $ad10);
|
||||
$ad15 = sprintf("%5s", $ad15);
|
||||
$ad20 = sprintf("%5s", $ad20);
|
||||
$ad25 = sprintf("%5s", $ad25);
|
||||
$ad30 = sprintf("%5s", $ad30);
|
||||
$ad35 = sprintf("%5s", $ad35);
|
||||
$ad40 = sprintf("%5s", $ad40);
|
||||
$ad45 = sprintf("%5s", $ad45);
|
||||
$ad50 = sprintf("%5s", $ad50);
|
||||
$ad55 = sprintf("%5s", $ad55);
|
||||
$ad60 = sprintf("%5s", $ad60);
|
||||
$ad90 = sprintf("%5s", $ad90);
|
||||
$ad99 = sprintf("%5s", $ad99);
|
||||
$Cad_0 = sprintf("%5s", $Cad_0);
|
||||
$Cad_5 = sprintf("%5s", $Cad_5);
|
||||
$Cad10 = sprintf("%5s", $Cad10);
|
||||
$Cad15 = sprintf("%5s", $Cad15);
|
||||
$Cad20 = sprintf("%5s", $Cad20);
|
||||
$Cad25 = sprintf("%5s", $Cad25);
|
||||
$Cad30 = sprintf("%5s", $Cad30);
|
||||
$Cad35 = sprintf("%5s", $Cad35);
|
||||
$Cad40 = sprintf("%5s", $Cad40);
|
||||
$Cad45 = sprintf("%5s", $Cad45);
|
||||
$Cad50 = sprintf("%5s", $Cad50);
|
||||
$Cad55 = sprintf("%5s", $Cad55);
|
||||
$Cad60 = sprintf("%5s", $Cad60);
|
||||
$Cad90 = sprintf("%5s", $Cad90);
|
||||
$Cad99 = sprintf("%5s", $Cad99);
|
||||
$pad_0 = sprintf("%4s", $pad_0) . '%';
|
||||
$pad_5 = sprintf("%4s", $pad_5) . '%';
|
||||
$pad10 = sprintf("%4s", $pad10) . '%';
|
||||
$pad15 = sprintf("%4s", $pad15) . '%';
|
||||
$pad20 = sprintf("%4s", $pad20) . '%';
|
||||
$pad25 = sprintf("%4s", $pad25) . '%';
|
||||
$pad30 = sprintf("%4s", $pad30) . '%';
|
||||
$pad35 = sprintf("%4s", $pad35) . '%';
|
||||
$pad40 = sprintf("%4s", $pad40) . '%';
|
||||
$pad45 = sprintf("%4s", $pad45) . '%';
|
||||
$pad50 = sprintf("%4s", $pad50) . '%';
|
||||
$pad55 = sprintf("%4s", $pad55) . '%';
|
||||
$pad60 = sprintf("%4s", $pad60) . '%';
|
||||
$pad90 = sprintf("%4s", $pad90) . '%';
|
||||
$pad99 = sprintf("%4s", $pad99) . '%';
|
||||
$pCad_0 = sprintf("%4s", $pCad_0) . '%';
|
||||
$pCad_5 = sprintf("%4s", $pCad_5) . '%';
|
||||
$pCad10 = sprintf("%4s", $pCad10) . '%';
|
||||
$pCad15 = sprintf("%4s", $pCad15) . '%';
|
||||
$pCad20 = sprintf("%4s", $pCad20) . '%';
|
||||
$pCad25 = sprintf("%4s", $pCad25) . '%';
|
||||
$pCad30 = sprintf("%4s", $pCad30) . '%';
|
||||
$pCad35 = sprintf("%4s", $pCad35) . '%';
|
||||
$pCad40 = sprintf("%4s", $pCad40) . '%';
|
||||
$pCad45 = sprintf("%4s", $pCad45) . '%';
|
||||
$pCad50 = sprintf("%4s", $pCad50) . '%';
|
||||
$pCad55 = sprintf("%4s", $pCad55) . '%';
|
||||
$pCad60 = sprintf("%4s", $pCad60) . '%';
|
||||
$pCad90 = sprintf("%4s", $pCad90) . '%';
|
||||
$pCad99 = sprintf("%4s", $pCad99) . '%';
|
||||
$ApCad_0 = sprintf("%4s", $ApCad_0) . '%';
|
||||
$ApCad_5 = sprintf("%4s", $ApCad_5) . '%';
|
||||
$ApCad10 = sprintf("%4s", $ApCad10) . '%';
|
||||
$ApCad15 = sprintf("%4s", $ApCad15) . '%';
|
||||
$ApCad20 = sprintf("%4s", $ApCad20) . '%';
|
||||
$ApCad25 = sprintf("%4s", $ApCad25) . '%';
|
||||
$ApCad30 = sprintf("%4s", $ApCad30) . '%';
|
||||
$ApCad35 = sprintf("%4s", $ApCad35) . '%';
|
||||
$ApCad40 = sprintf("%4s", $ApCad40) . '%';
|
||||
$ApCad45 = sprintf("%4s", $ApCad45) . '%';
|
||||
$ApCad50 = sprintf("%4s", $ApCad50) . '%';
|
||||
$ApCad55 = sprintf("%4s", $ApCad55) . '%';
|
||||
$ApCad60 = sprintf("%4s", $ApCad60) . '%';
|
||||
$ApCad90 = sprintf("%4s", $ApCad90) . '%';
|
||||
$ApCad99 = sprintf("%4s", $ApCad99) . '%';
|
||||
|
||||
$BDansweredCALLS = sprintf("%10s", $BDansweredCALLS);
|
||||
|
||||
### Format and output
|
||||
$answeredTOTALs = "$ad_0 $ad_5 $ad10 $ad15 $ad20 $ad25 $ad30 $ad35 $ad40 $ad45 $ad50 $ad55 $ad60 $ad90 $ad99 | $BDansweredCALLS |";
|
||||
$answeredCUMULATIVE = "$Cad_0 $Cad_5 $Cad10 $Cad15 $Cad20 $Cad25 $Cad30 $Cad35 $Cad40 $Cad45 $Cad50 $Cad55 $Cad60 $Cad90 $Cad99 | $BDansweredCALLS |";
|
||||
$answeredINT_PERCENT = "$pad_0 $pad_5 $pad10 $pad15 $pad20 $pad25 $pad30 $pad35 $pad40 $pad45 $pad50 $pad55 $pad60 $pad90 $pad99 | |";
|
||||
$answeredCUM_PERCENT = "$pCad_0 $pCad_5 $pCad10 $pCad15 $pCad20 $pCad25 $pCad30 $pCad35 $pCad40 $pCad45 $pCad50 $pCad55 $pCad60 $pCad90 $pCad99 | |";
|
||||
$answeredCUM_ANS_PERCENT = "$ApCad_0 $ApCad_5 $ApCad10 $ApCad15 $ApCad20 $ApCad25 $ApCad30 $ApCad35 $ApCad40 $ApCad45 $ApCad50 $ApCad55 $ApCad60 $ApCad90 $ApCad99 | |";
|
||||
echo "INTERVAL | $answeredTOTALs\n";
|
||||
echo "INT % | $answeredINT_PERCENT\n";
|
||||
echo "CUMULATIVE| $answeredCUMULATIVE\n";
|
||||
echo "CUM % | $answeredCUM_PERCENT\n";
|
||||
echo "CUM ANS % | $answeredCUM_ANS_PERCENT\n";
|
||||
echo "----------+-------------------------------------------------------------------------------------------+------------+\n";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
##############################
|
||||
######### CALL HANGUP REASON STATS
|
||||
|
||||
@@ -758,6 +1067,7 @@ while ($i < $users_to_print)
|
||||
$USERtotTALK_S = round($USERtotTALK_S, 0);
|
||||
if ($USERtotTALK_S < 10) {$USERtotTALK_S = "0$USERtotTALK_S";}
|
||||
$USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S";
|
||||
$USERtotTALK_MS = eregi_replace('-','',$USERtotTALK_MS);
|
||||
$USERtotTALK_MS = sprintf("%8s", $USERtotTALK_MS);
|
||||
|
||||
$USERavgTALK_M = ($USERavgTALK / 60);
|
||||
@@ -768,6 +1078,7 @@ while ($i < $users_to_print)
|
||||
$USERavgTALK_S = round($USERavgTALK_S, 0);
|
||||
if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";}
|
||||
$USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S";
|
||||
$USERavgTALK_MS = eregi_replace('-','',$USERavgTALK_MS);
|
||||
$USERavgTALK_MS = sprintf("%6s", $USERavgTALK_MS);
|
||||
|
||||
echo "| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n";
|
||||
@@ -775,18 +1086,21 @@ while ($i < $users_to_print)
|
||||
$i++;
|
||||
}
|
||||
|
||||
if (!$TOTcalls) {$TOTcalls = 1;}
|
||||
$TOTavg = ($TOTtime / $TOTcalls);
|
||||
$TOTavg = round($TOTavg, 0);
|
||||
$TOTavg_M = ($TOTavg / 60);
|
||||
$TOTavg_M_int = round($TOTavg_M, 2);
|
||||
$TOTavg_M_int = intval("$TOTavg_M_int");
|
||||
$TOTavg_S = ($TOTavg_M - $TOTavg_M_int);
|
||||
$TOTavg_S = ($TOTavg_S * 60);
|
||||
$TOTavg_S = round($TOTavg_S, 0);
|
||||
if ($TOTavg_S < 10) {$TOTavg_S = "0$TOTavg_S";}
|
||||
$TOTavg_MS = "$TOTavg_M_int:$TOTavg_S";
|
||||
$TOTavg = sprintf("%6s", $TOTavg_MS);
|
||||
if ($TOTcalls < 1) {$TOTcalls = 0; $TOTavg=0;}
|
||||
else
|
||||
{
|
||||
$TOTavg = ($TOTtime / $TOTcalls);
|
||||
$TOTavg = round($TOTavg, 0);
|
||||
$TOTavg_M = ($TOTavg / 60);
|
||||
$TOTavg_M_int = round($TOTavg_M, 2);
|
||||
$TOTavg_M_int = intval("$TOTavg_M_int");
|
||||
$TOTavg_S = ($TOTavg_M - $TOTavg_M_int);
|
||||
$TOTavg_S = ($TOTavg_S * 60);
|
||||
$TOTavg_S = round($TOTavg_S, 0);
|
||||
if ($TOTavg_S < 10) {$TOTavg_S = "0$TOTavg_S";}
|
||||
$TOTavg_MS = "$TOTavg_M_int:$TOTavg_S";
|
||||
$TOTavg = sprintf("%6s", $TOTavg_MS);
|
||||
}
|
||||
|
||||
$TOTtime_M = ($TOTtime / 60);
|
||||
$TOTtime_M_int = round($TOTtime_M, 2);
|
||||
@@ -1012,6 +1326,114 @@ echo "+------+------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
##############################
|
||||
######### CALL ANSWERED TIME BREAKDOWN IN SECONDS
|
||||
|
||||
$BDansweredCALLS = 0;
|
||||
|
||||
echo "\n";
|
||||
echo "---------- CALL ANSWERED TIME BREAKDOWN IN SECONDS\n";
|
||||
echo "+------+-------------------------------------------------------------------------------------------+------------+\n";
|
||||
echo "| HOUR | 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n";
|
||||
echo "+------+-------------------------------------------------------------------------------------------+------------+\n";
|
||||
|
||||
|
||||
|
||||
|
||||
$ZZ = '00';
|
||||
$i=0;
|
||||
$h=4;
|
||||
$hour= -1;
|
||||
$no_lines_yet=1;
|
||||
|
||||
while ($i <= 96)
|
||||
{
|
||||
$char_counter=0;
|
||||
$time = ' ';
|
||||
if ($h >= 4)
|
||||
{
|
||||
$hour++;
|
||||
$h=0;
|
||||
if ($hour < 10) {$hour = "0$hour";}
|
||||
$time = "+$hour$ZZ+";
|
||||
$SQLtime = "$hour:$ZZ:00";
|
||||
$SQLtimeEND = "$hour:15:00";
|
||||
}
|
||||
if ($h == 1) {$time = " 15 "; $SQLtime = "$hour:15:00"; $SQLtimeEND = "$hour:30:00";}
|
||||
if ($h == 2) {$time = " 30 "; $SQLtime = "$hour:30:00"; $SQLtimeEND = "$hour:45:00";}
|
||||
if ($h == 3)
|
||||
{
|
||||
$time = " 45 ";
|
||||
$SQLtime = "$hour:45:00";
|
||||
$hourEND = ($hour + 1);
|
||||
if ($hourEND < 10) {$hourEND = "0$hourEND";}
|
||||
if ($hourEND > 23) {$SQLtimeEND = "23:59:59";}
|
||||
else {$SQLtimeEND = "$hourEND:00:00";}
|
||||
}
|
||||
|
||||
$ad_0=0; $ad_5=0; $ad10=0; $ad15=0; $ad20=0; $ad25=0; $ad30=0; $ad35=0;
|
||||
$ad40=0; $ad45=0; $ad50=0; $ad55=0; $ad60=0; $ad90=0; $ad99=0; $BDansweredCALLS=0;
|
||||
|
||||
$stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date $SQLtime' and call_date < '$query_date $SQLtimeEND' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE') group by queue_seconds;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$reasons_to_print = mysql_num_rows($rslt);
|
||||
$j=0;
|
||||
while ($j < $reasons_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
$BDansweredCALLS = ($BDansweredCALLS + $row[0]);
|
||||
|
||||
if ($row[1] == 0) {$ad_0 = ($ad_0 + $row[0]);}
|
||||
if ( ($row[1] > 0) and ($row{1} <= 5) ) {$ad_5 = ($ad_5 + $row[0]);}
|
||||
if ( ($row[1] > 5) and ($row{1} <= 10) ) {$ad10 = ($ad10 + $row[0]);}
|
||||
if ( ($row[1] > 10) and ($row{1} <= 15) ) {$ad15 = ($ad15 + $row[0]);}
|
||||
if ( ($row[1] > 15) and ($row{1} <= 20) ) {$ad20 = ($ad20 + $row[0]);}
|
||||
if ( ($row[1] > 20) and ($row{1} <= 25) ) {$ad25 = ($ad25 + $row[0]);}
|
||||
if ( ($row[1] > 25) and ($row{1} <= 30) ) {$ad30 = ($ad30 + $row[0]);}
|
||||
if ( ($row[1] > 30) and ($row{1} <= 35) ) {$ad35 = ($ad35 + $row[0]);}
|
||||
if ( ($row[1] > 35) and ($row{1} <= 40) ) {$ad40 = ($ad40 + $row[0]);}
|
||||
if ( ($row[1] > 40) and ($row{1} <= 45) ) {$ad45 = ($ad45 + $row[0]);}
|
||||
if ( ($row[1] > 45) and ($row{1} <= 50) ) {$ad50 = ($ad50 + $row[0]);}
|
||||
if ( ($row[1] > 50) and ($row{1} <= 55) ) {$ad55 = ($ad55 + $row[0]);}
|
||||
if ( ($row[1] > 55) and ($row{1} <= 60) ) {$ad60 = ($ad60 + $row[0]);}
|
||||
if ( ($row[1] > 60) and ($row{1} <= 90) ) {$ad90 = ($ad90 + $row[0]);}
|
||||
if ($row[1] > 90) {$ad99 = ($ad99 + $row[0]);}
|
||||
$j++;
|
||||
}
|
||||
|
||||
$ad_0 = sprintf("%5s", $ad_0);
|
||||
$ad_5 = sprintf("%5s", $ad_5);
|
||||
$ad10 = sprintf("%5s", $ad10);
|
||||
$ad15 = sprintf("%5s", $ad15);
|
||||
$ad20 = sprintf("%5s", $ad20);
|
||||
$ad25 = sprintf("%5s", $ad25);
|
||||
$ad30 = sprintf("%5s", $ad30);
|
||||
$ad35 = sprintf("%5s", $ad35);
|
||||
$ad40 = sprintf("%5s", $ad40);
|
||||
$ad45 = sprintf("%5s", $ad45);
|
||||
$ad50 = sprintf("%5s", $ad50);
|
||||
$ad55 = sprintf("%5s", $ad55);
|
||||
$ad60 = sprintf("%5s", $ad60);
|
||||
$ad90 = sprintf("%5s", $ad90);
|
||||
$ad99 = sprintf("%5s", $ad99);
|
||||
|
||||
$BDansweredCALLS = sprintf("%10s", $BDansweredCALLS);
|
||||
|
||||
echo "|$time| $ad_0 $ad_5 $ad10 $ad15 $ad20 $ad25 $ad30 $ad35 $ad40 $ad45 $ad50 $ad55 $ad60 $ad90 $ad99 | $BDansweredCALLS |\n";
|
||||
|
||||
|
||||
$i++;
|
||||
$h++;
|
||||
}
|
||||
|
||||
echo "+------+-------------------------------------------------------------------------------------------+------------+\n";
|
||||
echo "|TOTALI| $answeredTOTALs\n";
|
||||
echo "+------+-------------------------------------------------------------------------------------------+------------+\n";
|
||||
|
||||
|
||||
$ENDtime = date("U");
|
||||
$RUNtime = ($ENDtime - $STARTtime);
|
||||
echo "\nRun Time: $RUNtime seconds\n";
|
||||
|
||||
@@ -0,0 +1,675 @@
|
||||
<?
|
||||
# AST_IVRstats.php
|
||||
#
|
||||
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
#
|
||||
# 81026-2026 - First build
|
||||
# 81107-0341 - Added time range and option and 15-minute increment graph
|
||||
# 81107-1148 - Added average times and totals
|
||||
# 81108-0922 - Added no-callerID and unique caller counts
|
||||
#
|
||||
|
||||
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["group"])) {$group=$_GET["group"];}
|
||||
elseif (isset($_POST["group"])) {$group=$_POST["group"];}
|
||||
if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];}
|
||||
elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];}
|
||||
if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];}
|
||||
elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];}
|
||||
if (isset($_GET["shift"])) {$shift=$_GET["shift"];}
|
||||
elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];}
|
||||
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"];}
|
||||
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
|
||||
if (strlen($shift)<2) {$shift='ALL';}
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmt = "SELECT use_non_latin 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);
|
||||
$non_latin = $row[0];
|
||||
$i++;
|
||||
}
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
{
|
||||
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
$STARTtime = date("U");
|
||||
if (!isset($group)) {$group = '';}
|
||||
if (!isset($query_date)) {$query_date = "$NOW_DATE 00:00:00";}
|
||||
if (!isset($end_date)) {$end_date = "$NOW_DATE 23:23:59";}
|
||||
|
||||
$stmt="select group_id from vicidial_inbound_groups;";
|
||||
$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);
|
||||
$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]',";
|
||||
$groupQS .= "&group[]=$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";}
|
||||
$statcats_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $statcats_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$vsc_id[$i] = $row[0];
|
||||
$vsc_name[$i] = $row[1];
|
||||
$vsc_count[$i] = 0;
|
||||
$i++;
|
||||
}
|
||||
?>
|
||||
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<STYLE type="text/css">
|
||||
<!--
|
||||
.green {color: white; background-color: green}
|
||||
.red {color: white; background-color: red}
|
||||
.blue {color: white; background-color: blue}
|
||||
.purple {color: white; background-color: purple}
|
||||
-->
|
||||
</STYLE>
|
||||
|
||||
<?
|
||||
if ($shift == 'RANGE')
|
||||
{
|
||||
$query_date_BEGIN = "$query_date";
|
||||
$query_date_END = "$end_date";
|
||||
}
|
||||
else
|
||||
{
|
||||
$EXquery_date = explode(' ',$query_date);
|
||||
$query_date = "$EXquery_date[0]";
|
||||
$EXend_date = explode(' ',$end_date);
|
||||
$end_date = "$EXend_date[0]";
|
||||
|
||||
if ($shift == 'AM')
|
||||
{
|
||||
$time_BEGIN=$AM_shift_BEGIN;
|
||||
$time_END=$AM_shift_END;
|
||||
if (strlen($time_BEGIN) < 6) {$time_BEGIN = "03:45:00";}
|
||||
if (strlen($time_END) < 6) {$time_END = "15:15:00";}
|
||||
}
|
||||
if ($shift == 'PM')
|
||||
{
|
||||
$time_BEGIN=$PM_shift_BEGIN;
|
||||
$time_END=$PM_shift_END;
|
||||
if (strlen($time_BEGIN) < 6) {$time_BEGIN = "15:15:00";}
|
||||
if (strlen($time_END) < 6) {$time_END = "23:15:00";}
|
||||
}
|
||||
if ($shift == 'ALL')
|
||||
{
|
||||
if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";}
|
||||
if (strlen($time_END) < 6) {$time_END = "23:59:59";}
|
||||
}
|
||||
$query_date_BEGIN = "$query_date $time_BEGIN";
|
||||
$query_date_END = "$end_date $time_END";
|
||||
}
|
||||
|
||||
echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
|
||||
echo "<TITLE>VICIDIAL: IVR Stats</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=19 MAXLENGTH=19 VALUE=\"$query_date_BEGIN\">\n";
|
||||
echo " to <INPUT TYPE=TEXT NAME=end_date SIZE=19 MAXLENGTH=19 VALUE=\"$query_date_END\">\n";
|
||||
echo "</TD><TD ROWSPAN=2 VALIGN=TOP>\n";
|
||||
echo "Inbound Groups: \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 (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 "</TD><TD ROWSPAN=2 VALIGN=TOP>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> ";
|
||||
echo "<a href=\"./admin.php?ADD=3111&group_id=$group[0]\">MODIFY</a> | ";
|
||||
echo "<a href=\"./admin.php?ADD=999999\">REPORTS</a> | ";
|
||||
echo "<a href=\"./AST_CLOSERstats.php?query_date=$query_date&end_date=$end_date&shift=$shift$groupQS\">CLOSER REPORT</a> \n";
|
||||
echo "</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 "<option value=\"RANGE\">RANGE</option>\n";
|
||||
echo "</SELECT>\n";
|
||||
echo " <INPUT TYPE=submit NAME=SUBMIT VALUE=SUBMIT>\n";
|
||||
echo "</TD></TR></TABLE>\n";
|
||||
echo "</FORM>\n\n";
|
||||
|
||||
echo "<PRE><FONT SIZE=2>\n\n";
|
||||
|
||||
|
||||
if ($groups_to_print < 1)
|
||||
{
|
||||
echo "\n\n";
|
||||
echo "PLEASE SELECT AN IN-GROUP AND DATE RANGE ABOVE AND CLICK SUBMIT\n";
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
echo "VICIDIAL: IVR Stats: $group_string $NOW_TIME\n";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$TOTALcalls=0;
|
||||
$NOCALLERIDcalls=0;
|
||||
$UNIQUEcallers=0;
|
||||
$totFLOWivr_time=0;
|
||||
$totFLOWtotal_time=0;
|
||||
|
||||
##### Grab all records for the IVR for the specified time period
|
||||
$stmt="select uniqueid,extension,start_time,comment_a,comment_b,comment_d,UNIX_TIMESTAMP(start_time),phone_ext from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a IN($group_SQL) order by uniqueid,start_time;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$logs_to_print = mysql_num_rows($rslt);
|
||||
$p=0;
|
||||
while ($p < $logs_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$uniqueid[$p] = $row[0];
|
||||
$extension[$p] = $row[1];
|
||||
$start_time[$p] = $row[2];
|
||||
$comment_a[$p] = $row[3];
|
||||
$comment_b[$p] = $row[4];
|
||||
$comment_d[$p] = $row[5];
|
||||
$epoch[$p] = $row[6];
|
||||
$phone_ext[$p] = $row[7];
|
||||
$p++;
|
||||
}
|
||||
|
||||
### create the call flow of all calls by uniqueid
|
||||
$last_uniqueid='';
|
||||
$first_epoch='';
|
||||
$last_epoch='';
|
||||
$p=0;
|
||||
$r=-1;
|
||||
while ($p < $logs_to_print)
|
||||
{
|
||||
if ($DB > 0) {echo "$p|$uniqueid[$p]|$comment_b[$p]";}
|
||||
if ($last_uniqueid === "$uniqueid[$p]")
|
||||
{
|
||||
$unique_calls[$r] .= "----------$comment_b[$p]";
|
||||
if ($DB > 0) {echo " $r|$unique_calls[$r]\n";}
|
||||
$last_epoch[$r]=$epoch[$p];
|
||||
}
|
||||
else
|
||||
{
|
||||
$r++;
|
||||
$caller_id[$r]=$phone_ext[$p];
|
||||
if (strlen($phone_ext[$p])<2)
|
||||
{$NOCALLERIDcalls++;}
|
||||
else
|
||||
{
|
||||
if (!ereg("_$phone_ext[$p]_",$unique_callerIDs))
|
||||
{
|
||||
$unique_callerIDs .= "_$phone_ext[$p]_";
|
||||
$UNIQUEcallers++;
|
||||
}
|
||||
}
|
||||
$first_epoch[$r]=$epoch[$p];
|
||||
$last_epoch[$r]=$epoch[$p];
|
||||
$unique_calls[$r] = $comment_b[$p];
|
||||
$FLOWuniqueid[$r] = "$uniqueid[$p]";
|
||||
$last_uniqueid = "$uniqueid[$p]";
|
||||
if ($DB > 0) {echo " $r|$unique_calls[$r]\n";}
|
||||
}
|
||||
$p++;
|
||||
}
|
||||
|
||||
### sort call flows for counting
|
||||
$RAWunique_calls = $unique_calls;
|
||||
if ($logs_to_print > 0)
|
||||
{sort($unique_calls);}
|
||||
|
||||
|
||||
### count each unique call flow
|
||||
$last_Suniqueid='';
|
||||
$p=-1;
|
||||
$s=0;
|
||||
while ($s <= $r)
|
||||
{
|
||||
if ($DB > 0) {echo "$s|$unique_calls[$s]\n";}
|
||||
if ($last_Suniqueid === "$unique_calls[$s]")
|
||||
{
|
||||
$STunique_calls_count[$p]++;
|
||||
}
|
||||
else
|
||||
{
|
||||
$p++;
|
||||
$STunique_calls[$p] = $unique_calls[$s];
|
||||
$last_Suniqueid = "$unique_calls[$s]";
|
||||
$STunique_calls_count[$p]=1;
|
||||
}
|
||||
$s++;
|
||||
}
|
||||
|
||||
|
||||
### put call flows and counts together for sorting again
|
||||
$TOTALcalls=0;
|
||||
$s=0;
|
||||
while ($s <= $p)
|
||||
{
|
||||
$TOTALcalls = ($TOTALcalls + $STunique_calls_count[$s]);
|
||||
$STunique_calls_count[$s] = sprintf("%07s", $STunique_calls_count[$s]);
|
||||
$FLOWunique_calls[$s] = "$STunique_calls_count[$s]__________$STunique_calls[$s]";
|
||||
$s++;
|
||||
}
|
||||
|
||||
#### PRINT TOTAL CALLS INTO THIS IVR
|
||||
echo "\n";
|
||||
echo "Calls taken into this IVR: $TOTALcalls\n";
|
||||
echo "Calls with no CallerID: $NOCALLERIDcalls\n";
|
||||
echo "Unique Callers: $UNIQUEcallers\n";
|
||||
echo "\n";
|
||||
|
||||
### sort call flows for counting
|
||||
if ($p > 0)
|
||||
{rsort($FLOWunique_calls);}
|
||||
|
||||
|
||||
### put call flows and counts together for sorting again
|
||||
$RUC_ct = count($RAWunique_calls);
|
||||
$s=0;
|
||||
while ($s <= $p)
|
||||
{
|
||||
$FLOWsummary = explode('__________',$FLOWunique_calls[$s]);
|
||||
$FLOWsummary[0] = ($FLOWsummary[0] + 0);
|
||||
|
||||
$t=0;
|
||||
while ($t < $RUC_ct)
|
||||
{
|
||||
if ($FLOWsummary[1] === "$RAWunique_calls[$t]")
|
||||
{
|
||||
$FLOWunique_calls_list[$s] .= "'$FLOWuniqueid[$t]',";
|
||||
if ($last_epoch[$t] <= $first_epoch[$t]) {$last_epoch[$t] = ($first_epoch[$t] + 5);}
|
||||
else {$last_epoch[$t] = ($last_epoch[$t] + 10);}
|
||||
$FLOWivr_time[$s] = ($FLOWivr_time[$s] + ($last_epoch[$t] - $first_epoch[$t]));
|
||||
}
|
||||
$t++;
|
||||
}
|
||||
|
||||
$s++;
|
||||
}
|
||||
|
||||
|
||||
### put call flows and counts together for sorting again
|
||||
$s=0;
|
||||
|
||||
echo "+--------+--------+--------+--------+------+------+\n";
|
||||
echo "| | | QUEUE | QUEUE | IVR | TOTAL|\n";
|
||||
echo "| IVR | QUEUE | DROP | DROP | AVG | AVG |\n";
|
||||
echo "| CALLS | CALLS | CALLS | PERCENT| TIME | TIME | CALL PATH\n";
|
||||
echo "+--------+--------+--------+--------+------+------+------------\n";
|
||||
|
||||
while ($s <= $p)
|
||||
{
|
||||
$vcl_statuses = $MT;
|
||||
$FLOWdrop[$s]=0;
|
||||
$FLOWtotal[$s]=0;
|
||||
$FLOWdropPCT[$s]=0;
|
||||
$FLOWsummary = explode('__________',$FLOWunique_calls[$s]);
|
||||
$FLOWsummary[0] = ($FLOWsummary[0] + 0);
|
||||
|
||||
$FLOWunique_calls_list[$s] = preg_replace("/,$/","",$FLOWunique_calls_list[$s]);
|
||||
|
||||
|
||||
##### Grab all records for the IVR for the specified time period
|
||||
$stmt="select status,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 uniqueid IN($FLOWunique_calls_list[$s]);";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$vcl_statuses_to_print = mysql_num_rows($rslt);
|
||||
$w=0;
|
||||
while ($w < $vcl_statuses_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$vcl_statuses[$w] = $row[0];
|
||||
if ( (ereg("DROP",$vcl_statuses[$w])) or (ereg("XDROP",$vcl_statuses[$w])) )
|
||||
{$FLOWdrop[$s]++;}
|
||||
$FLOWclose_time[$s] = ($FLOWclose_time[$s] + $row[1]);
|
||||
$FLOWtotal[$s]++;
|
||||
$w++;
|
||||
}
|
||||
if ( ($FLOWtotal[$s] > 0) and ($FLOWdrop[$s] > 0) )
|
||||
{
|
||||
$FLOWdropPCT[$s] = ( ($FLOWdrop[$s] / $FLOWtotal[$s]) * 100);
|
||||
$FLOWdropPCT[$s] = round($FLOWdropPCT[$s], 2);
|
||||
}
|
||||
$FLOWsummary[0] = sprintf("%6s", $FLOWsummary[0]);
|
||||
$FLOWtotal[$s] = sprintf("%6s", $FLOWtotal[$s]);
|
||||
$FLOWdrop[$s] = sprintf("%6s", $FLOWdrop[$s]);
|
||||
$FLOWdropPCT[$s] = sprintf("%6s", $FLOWdropPCT[$s]);
|
||||
$FLOWsummary[1] = ereg_replace('----------',' / ',$FLOWsummary[1]);
|
||||
$FLOWtotal_time[$s] = ($FLOWivr_time[$s] + $FLOWclose_time[$s]);
|
||||
|
||||
$avgFLOWivr_time[$s] = ($FLOWivr_time[$s] / $FLOWsummary[0]);
|
||||
$avgFLOWivr_time[$s] = round($avgFLOWivr_time[$s], 0);
|
||||
$avgFLOWivr_time[$s] = sprintf("%4s", $avgFLOWivr_time[$s]);
|
||||
$avgFLOWtotal_time[$s] = ($FLOWtotal_time[$s] / $FLOWsummary[0]);
|
||||
$avgFLOWtotal_time[$s] = round($avgFLOWtotal_time[$s], 0);
|
||||
$avgFLOWtotal_time[$s] = sprintf("%4s", $avgFLOWtotal_time[$s]);
|
||||
|
||||
$totFLOWtotal_time = ($totFLOWtotal_time + $FLOWtotal_time[$s]);
|
||||
$totFLOWivr_time = ($totFLOWivr_time + $FLOWivr_time[$s]);
|
||||
$totFLOWtotal = ($totFLOWtotal + $FLOWtotal[$s]);
|
||||
$totFLOWdrop = ($totFLOWdrop + $FLOWdrop[$s]);
|
||||
|
||||
echo "| $FLOWsummary[0] | $FLOWtotal[$s] | $FLOWdrop[$s] | $FLOWdropPCT[$s]%| $avgFLOWivr_time[$s] | $avgFLOWtotal_time[$s] | $FLOWsummary[1]\n";
|
||||
|
||||
$s++;
|
||||
}
|
||||
$TOTALcalls = sprintf("%6s", $TOTALcalls);
|
||||
$totFLOWtotal = sprintf("%6s", $totFLOWtotal);
|
||||
$totFLOWdrop = sprintf("%6s", $totFLOWdrop);
|
||||
if ( ($totFLOWivr_time > 0) and ($TOTALcalls > 0) )
|
||||
{$TavgFLOWivr_time = ($totFLOWivr_time / $TOTALcalls);}
|
||||
$TavgFLOWivr_time = round($TavgFLOWivr_time, 0);
|
||||
$TavgFLOWivr_time = sprintf("%4s", $TavgFLOWivr_time);
|
||||
if ( ($totFLOWtotal_time > 0) and ($TOTALcalls > 0) )
|
||||
{$TavgFLOWtotal_time = ($totFLOWtotal_time / $TOTALcalls);}
|
||||
$TavgFLOWtotal_time = round($TavgFLOWtotal_time, 0);
|
||||
$TavgFLOWtotal_time = sprintf("%4s", $TavgFLOWtotal_time);
|
||||
if ( ($totFLOWtotal < 1) or ($totFLOWdrop < 1) )
|
||||
{$totFLOWdropPCT = '0';}
|
||||
else
|
||||
{
|
||||
$totFLOWdropPCT = (($totFLOWdrop / $totFLOWtotal) * 100);
|
||||
$totFLOWdropPCT = round($totFLOWdropPCT, 0);
|
||||
}
|
||||
$totFLOWdropPCT = sprintf("%5s", $totFLOWdropPCT);
|
||||
|
||||
echo "+--------+--------+--------+--------+------+------+------------\n";
|
||||
echo "| $TOTALcalls | $totFLOWtotal | $totFLOWdrop | $totFLOWdropPCT% | $TavgFLOWivr_time | $TavgFLOWtotal_time |\n";
|
||||
echo "+--------+--------+--------+--------+------+------+\n";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
##############################
|
||||
######### TIME STATS
|
||||
|
||||
echo "\n";
|
||||
echo "---------- TIME STATS\n";
|
||||
|
||||
echo "<FONT SIZE=0>\n";
|
||||
|
||||
$hi_hour_count=0;
|
||||
$last_full_record=0;
|
||||
$i=0;
|
||||
$h=0;
|
||||
while ($i <= 96)
|
||||
{
|
||||
$stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:00:00' and start_time <= '$query_date $h:14:59' and comment_a IN($group_SQL) and comment_b='START';";
|
||||
$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;}
|
||||
$i++;
|
||||
|
||||
|
||||
$stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:15:00' and start_time <= '$query_date $h:29:59' and comment_a IN($group_SQL) and comment_b='START';";
|
||||
$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;}
|
||||
$i++;
|
||||
|
||||
$stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:30:00' and start_time <= '$query_date $h:44:59' and comment_a IN($group_SQL) and comment_b='START';";
|
||||
$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;}
|
||||
$i++;
|
||||
|
||||
$stmt="select count(*) from live_inbound_log where start_time >= '$query_date $h:45:00' and start_time <= '$query_date $h:59:59' and comment_a IN($group_SQL) and comment_b='START';";
|
||||
$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;}
|
||||
$i++;
|
||||
$h++;
|
||||
}
|
||||
|
||||
if ($hi_hour_count < 1)
|
||||
{$hour_multiplier = 0;}
|
||||
else
|
||||
{
|
||||
$hour_multiplier = (100 / $hi_hour_count);
|
||||
#$hour_multiplier = round($hour_multiplier, 0);
|
||||
}
|
||||
|
||||
echo "<!-- HICOUNT: $hi_hour_count|$hour_multiplier -->\n";
|
||||
echo "GRAPH IN 15 MINUTE INCREMENTS OF TOTAL CALLS TAKEN INTO THIS IVR\n";
|
||||
|
||||
$k=1;
|
||||
$Mk=0;
|
||||
$call_scale = '0';
|
||||
while ($k <= 102)
|
||||
{
|
||||
if ($Mk >= 5)
|
||||
{
|
||||
$Mk=0;
|
||||
if ( ($k < 1) or ($hour_multiplier <= 0) )
|
||||
{$scale_num = 100;}
|
||||
else
|
||||
{
|
||||
$scale_num=($k / $hour_multiplier);
|
||||
$scale_num = round($scale_num, 0);
|
||||
}
|
||||
$LENscale_num = (strlen($scale_num));
|
||||
$k = ($k + $LENscale_num);
|
||||
$call_scale .= "$scale_num";
|
||||
}
|
||||
else
|
||||
{
|
||||
$call_scale .= " ";
|
||||
$k++; $Mk++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
echo "+------+-------------------------------------------------------------------------------------------------------+-------+\n";
|
||||
#echo "| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP | TOTAL |\n";
|
||||
echo "| HOUR |$call_scale| TOTAL |\n";
|
||||
echo "+------+-------------------------------------------------------------------------------------------------------+-------+\n";
|
||||
|
||||
$ZZ = '00';
|
||||
$i=0;
|
||||
$h=4;
|
||||
$hour= -1;
|
||||
$no_lines_yet=1;
|
||||
|
||||
while ($i <= 96)
|
||||
{
|
||||
$char_counter=0;
|
||||
$time = ' ';
|
||||
if ($h >= 4)
|
||||
{
|
||||
$hour++;
|
||||
$h=0;
|
||||
if ($hour < 10) {$hour = "0$hour";}
|
||||
$time = "+$hour$ZZ+";
|
||||
}
|
||||
if ($h == 1) {$time = " 15 ";}
|
||||
if ($h == 2) {$time = " 30 ";}
|
||||
if ($h == 3) {$time = " 45 ";}
|
||||
$Ghour_count = $hour_count[$i];
|
||||
if ($Ghour_count < 1)
|
||||
{
|
||||
if ( ($no_lines_yet) or ($i > $last_full_record) )
|
||||
{
|
||||
$do_nothing=1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$hour_count[$i] = sprintf("%-5s", $hour_count[$i]);
|
||||
echo "|$time|";
|
||||
$k=0; while ($k <= 102) {echo " "; $k++;}
|
||||
echo "| $hour_count[$i] |\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$no_lines_yet=0;
|
||||
$Xhour_count = ($Ghour_count * $hour_multiplier);
|
||||
$Yhour_count = (99 - $Xhour_count);
|
||||
|
||||
$hour_count[$i] = sprintf("%-5s", $hour_count[$i]);
|
||||
|
||||
echo "|$time|<SPAN class=\"green\">";
|
||||
$k=0; while ($k <= $Xhour_count) {echo "*"; $k++; $char_counter++;}
|
||||
echo "*X</SPAN>"; $char_counter++;
|
||||
$k=0; while ($k <= $Yhour_count) {echo " "; $k++; $char_counter++;}
|
||||
while ($char_counter <= 101) {echo " "; $char_counter++;}
|
||||
echo "| $hour_count[$i] |\n";
|
||||
}
|
||||
|
||||
|
||||
$i++;
|
||||
$h++;
|
||||
}
|
||||
|
||||
|
||||
echo "+------+-------------------------------------------------------------------------------------------------------+-------+\n\n";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$ENDtime = date("U");
|
||||
$RUNtime = ($ENDtime - $STARTtime);
|
||||
echo "\nRun Time: $RUNtime seconds\n";
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
</PRE>
|
||||
|
||||
</BODY></HTML>
|
||||
@@ -11,6 +11,9 @@
|
||||
# 71218-1155 - added end_date for multi-day reports
|
||||
# 80428-0144 - UTF8 cleanup
|
||||
# 80712-1007 - tally bug fixes and time display change
|
||||
# 81030-0346 - Added pause code stats
|
||||
# 81030-1924 - Added total non-pause and total logged-in time to pause code section
|
||||
# 81108-0716 - fixed user same-name bug
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -71,6 +74,7 @@ $auth=$row[0];
|
||||
exit;
|
||||
}
|
||||
|
||||
$MT[0]='';
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
$STARTtime = date("U");
|
||||
@@ -207,7 +211,7 @@ $usersARY[0]='';
|
||||
$user_namesARY[0]='';
|
||||
$k=0;
|
||||
|
||||
$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,sum(pause_sec),sum(wait_sec),sum(dispo_sec),status from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and campaign_id='" . mysql_real_escape_string($group) . "' and pause_sec<36000 and wait_sec<36000 and talk_sec<36000 and dispo_sec<36000 $ugSQL group by full_name,status order by status desc,full_name limit 100000;";
|
||||
$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,sum(pause_sec),sum(wait_sec),sum(dispo_sec),status from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and campaign_id='" . mysql_real_escape_string($group) . "' and pause_sec<36000 and wait_sec<36000 and talk_sec<36000 and dispo_sec<36000 $ugSQL group by user,full_name,status order by full_name,user,status desc limit 500000;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rows_to_print = mysql_num_rows($rslt);
|
||||
@@ -245,7 +249,7 @@ while ($i < $rows_to_print)
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
echo "CALL STATS BREAKDOWN:\n";
|
||||
echo "+-----------------+----------+--------+---------+--------+--------+--------+--------+--------+--------+--------+--------+$statusesHEAD\n";
|
||||
echo "| USER NAME | ID | CALLS | TIME | PAUSE | PAUSAVG| WAIT | WAITAVG| TALK | TALKAVG| DISPO | DISPAVG|$statusesHTML\n";
|
||||
echo "+-----------------+----------+--------+---------+--------+--------+--------+--------+--------+--------+--------+--------+$statusesHEAD\n";
|
||||
@@ -316,20 +320,20 @@ while ($m < $k)
|
||||
$Scalls = sprintf("%6s", $Scalls);
|
||||
|
||||
if ($non_latin < 1)
|
||||
{
|
||||
$Sfull_name= sprintf("%-15s", $Sfull_name);
|
||||
while(strlen($Sfull_name)>15) {$Sfull_name = substr("$Sfull_name", 0, -1);}
|
||||
$Suser = sprintf("%-8s", $Suser);
|
||||
while(strlen($Suser)>8) {$Suser = substr("$Suser", 0, -1);}
|
||||
}
|
||||
{
|
||||
$Sfull_name= sprintf("%-15s", $Sfull_name);
|
||||
while(strlen($Sfull_name)>15) {$Sfull_name = substr("$Sfull_name", 0, -1);}
|
||||
$Suser = sprintf("%-8s", $Suser);
|
||||
while(strlen($Suser)>8) {$Suser = substr("$Suser", 0, -1);}
|
||||
}
|
||||
else
|
||||
{
|
||||
$Sfull_name= sprintf("%-45s", $Sfull_name);
|
||||
while(mb_strlen($Sfull_name,'utf-8')>15) {$Sfull_name = mb_substr("$Sfull_name", 0, -1,'utf-8');}
|
||||
{
|
||||
$Sfull_name= sprintf("%-45s", $Sfull_name);
|
||||
while(mb_strlen($Sfull_name,'utf-8')>15) {$Sfull_name = mb_substr("$Sfull_name", 0, -1,'utf-8');}
|
||||
|
||||
$Suser = sprintf("%-24s", $Suser);
|
||||
while(mb_strlen($Suser,'utf-8')>8) {$Suser = mb_substr("$Suser", 0, -1,'utf-8');}
|
||||
}
|
||||
$Suser = sprintf("%-24s", $Suser);
|
||||
while(mb_strlen($Suser,'utf-8')>8) {$Suser = mb_substr("$Suser", 0, -1,'utf-8');}
|
||||
}
|
||||
|
||||
$USERtime_M = ($Stime / 60);
|
||||
$USERtime_M_int = round($USERtime_M, 2);
|
||||
@@ -370,6 +374,7 @@ while ($m < $k)
|
||||
if ($USERtotPAUSE_S < 10) {$USERtotPAUSE_S = "0$USERtotPAUSE_S";}
|
||||
$USERtotPAUSE_MS = "$USERtotPAUSE_M_int:$USERtotPAUSE_S";
|
||||
$pfUSERtotPAUSE_MS = sprintf("%6s", $USERtotPAUSE_MS);
|
||||
$PAUSEtotal[$m] = $pfUSERtotPAUSE_MS;
|
||||
|
||||
$USERavgPAUSE_M = ($Spause_avg / 60);
|
||||
$USERavgPAUSE_M_int = round($USERavgPAUSE_M, 2);
|
||||
@@ -570,7 +575,281 @@ echo "+-----------------+----------+--------+---------+--------+--------+-------
|
||||
echo "| TOTALI AGENTS:$TOT_AGENTS | $TOTcalls| $TOTtime_MS|$TOTtotPAUSE_MS| $TOTavgPAUSE_MS |$TOTtotWAIT_MS| $TOTavgWAIT_MS |$TOTtotTALK_MS| $TOTavgTALK_MS |$TOTtotDISPO_MS| $TOTavgDISPO_MS |$SUMstatusesHTML\n";
|
||||
echo "+----------------------------+--------+---------+--------+--------+--------+--------+--------+--------+--------+--------+$statusesHEAD\n";
|
||||
|
||||
echo "\n";
|
||||
echo "\n\n";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$sub_statuses='-';
|
||||
$sub_statusesTXT='';
|
||||
$sub_statusesHEAD='';
|
||||
$sub_statusesHTML='';
|
||||
$sub_statusesARY=$MT;
|
||||
$j=0;
|
||||
$PCusers='-';
|
||||
$PCusersARY=$MT;
|
||||
$PCuser_namesARY=$MT;
|
||||
$k=0;
|
||||
$stmt="select full_name,vicidial_users.user,sum(pause_sec),sub_status,sum(wait_sec + talk_sec + dispo_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and campaign_id='" . mysql_real_escape_string($group) . "' and pause_sec<36000 $ugSQL group by user,full_name,sub_status order by user,full_name,sub_status desc limit 100000;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$subs_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $subs_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$PCfull_name[$i] = $row[0];
|
||||
$PCuser[$i] = $row[1];
|
||||
$PCpause_sec[$i] = $row[2];
|
||||
$sub_status[$i] = $row[3];
|
||||
$PCnon_pause_sec[$i] = $row[4];
|
||||
# if ( (!eregi("-$sub_status[$i]-", $sub_statuses)) and (strlen($sub_status[$i])>0) )
|
||||
if (!eregi("-$sub_status[$i]-", $sub_statuses))
|
||||
{
|
||||
$sub_statusesTXT = sprintf("%8s", $sub_status[$i]);
|
||||
$sub_statusesHEAD .= "----------+";
|
||||
$sub_statusesHTML .= " $sub_statusesTXT |";
|
||||
$sub_statuses .= "$sub_status[$i]-";
|
||||
$sub_statusesARY[$j] = $sub_status[$i];
|
||||
$j++;
|
||||
}
|
||||
if (!eregi("-$PCuser[$i]-", $PCusers))
|
||||
{
|
||||
$PCusers .= "$PCuser[$i]-";
|
||||
$PCusersARY[$k] = $PCuser[$i];
|
||||
$PCuser_namesARY[$k] = $PCfull_name[$i];
|
||||
$k++;
|
||||
}
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
echo "PAUSE CODE BREAKDOWN:\n";
|
||||
echo "+-----------------+----------+--------+--------+--------+ +$sub_statusesHEAD\n";
|
||||
echo "| USER NAME | ID | TOTAL |NONPAUSE| PAUSE | |$sub_statusesHTML\n";
|
||||
echo "+-----------------+----------+--------+--------+--------+ +$sub_statusesHEAD\n";
|
||||
|
||||
|
||||
### BEGIN loop through each user ###
|
||||
$m=0;
|
||||
$Suser_ct = count($usersARY);
|
||||
$TOTtotNONPAUSE = 0;
|
||||
$TOTtotTOTAL = 0;
|
||||
|
||||
while ($m < $k)
|
||||
{
|
||||
$d=0;
|
||||
while ($d < $Suser_ct)
|
||||
{
|
||||
if ($usersARY[$d] === "$PCusersARY[$m]")
|
||||
{$pcPAUSEtotal = $PAUSEtotal[$d];}
|
||||
$d++;
|
||||
}
|
||||
$Suser=$PCusersARY[$m];
|
||||
$Sfull_name=$PCuser_namesARY[$m];
|
||||
$Spause_sec=0;
|
||||
$Snon_pause_sec=0;
|
||||
$Stotal_sec=0;
|
||||
$SstatusesHTML='';
|
||||
|
||||
### BEGIN loop through each status ###
|
||||
$n=0;
|
||||
while ($n < $j)
|
||||
{
|
||||
$Sstatus=$sub_statusesARY[$n];
|
||||
$SstatusTXT='';
|
||||
### BEGIN loop through each stat line ###
|
||||
$i=0; $status_found=0;
|
||||
while ($i < $rows_to_print)
|
||||
{
|
||||
if ( ($Suser=="$PCuser[$i]") and ($Sstatus=="$sub_status[$i]") )
|
||||
{
|
||||
$Spause_sec = ($Spause_sec + $PCpause_sec[$i]);
|
||||
$Snon_pause_sec = ($Snon_pause_sec + $PCnon_pause_sec[$i]);
|
||||
$Stotal_sec = ($Stotal_sec + $PCnon_pause_sec[$i] + $PCpause_sec[$i]);
|
||||
|
||||
$USERcodePAUSE_M = ($PCpause_sec[$i] / 60);
|
||||
$USERcodePAUSE_M_int = round($USERcodePAUSE_M, 2);
|
||||
$USERcodePAUSE_M_int = intval("$USERcodePAUSE_M_int");
|
||||
$USERcodePAUSE_S = ($USERcodePAUSE_M - $USERcodePAUSE_M_int);
|
||||
$USERcodePAUSE_S = ($USERcodePAUSE_S * 60);
|
||||
$USERcodePAUSE_S = round($USERcodePAUSE_S, 0);
|
||||
if ($USERcodePAUSE_S < 10) {$USERcodePAUSE_S = "0$USERcodePAUSE_S";}
|
||||
$USERcodePAUSE_MS = "$USERcodePAUSE_M_int:$USERcodePAUSE_S";
|
||||
$pfUSERcodePAUSE_MS = sprintf("%6s", $USERcodePAUSE_MS);
|
||||
|
||||
$SstatusTXT = sprintf("%8s", $pfUSERcodePAUSE_MS);
|
||||
$SstatusesHTML .= " $SstatusTXT |";
|
||||
$status_found++;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
if ($status_found < 1)
|
||||
{
|
||||
$SstatusesHTML .= " 0 |";
|
||||
}
|
||||
### END loop through each stat line ###
|
||||
$n++;
|
||||
}
|
||||
### END loop through each status ###
|
||||
$TOTtotPAUSE=($TOTtotPAUSE + $Spause_sec);
|
||||
|
||||
if ($non_latin < 1)
|
||||
{
|
||||
$Sfull_name= sprintf("%-15s", $Sfull_name);
|
||||
while(strlen($Sfull_name)>15) {$Sfull_name = substr("$Sfull_name", 0, -1);}
|
||||
$Suser = sprintf("%-8s", $Suser);
|
||||
while(strlen($Suser)>8) {$Suser = substr("$Suser", 0, -1);}
|
||||
}
|
||||
else
|
||||
{
|
||||
$Sfull_name= sprintf("%-45s", $Sfull_name);
|
||||
while(mb_strlen($Sfull_name,'utf-8')>15) {$Sfull_name = mb_substr("$Sfull_name", 0, -1,'utf-8');}
|
||||
|
||||
$Suser = sprintf("%-24s", $Suser);
|
||||
while(mb_strlen($Suser,'utf-8')>8) {$Suser = mb_substr("$Suser", 0, -1,'utf-8');}
|
||||
}
|
||||
|
||||
$TOTtotNONPAUSE = ($TOTtotNONPAUSE + $Snon_pause_sec);
|
||||
$TOTtotTOTAL = ($TOTtotTOTAL + $Stotal_sec);
|
||||
|
||||
$USERtotPAUSE_M = ($Spause_sec / 60);
|
||||
$USERtotPAUSE_M_int = round($USERtotPAUSE_M, 2);
|
||||
$USERtotPAUSE_M_int = intval("$USERtotPAUSE_M_int");
|
||||
$USERtotPAUSE_S = ($USERtotPAUSE_M - $USERtotPAUSE_M_int);
|
||||
$USERtotPAUSE_S = ($USERtotPAUSE_S * 60);
|
||||
$USERtotPAUSE_S = round($USERtotPAUSE_S, 0);
|
||||
if ($USERtotPAUSE_S < 10) {$USERtotPAUSE_S = "0$USERtotPAUSE_S";}
|
||||
$USERtotPAUSE_MS = "$USERtotPAUSE_M_int:$USERtotPAUSE_S";
|
||||
$pfUSERtotPAUSE_MS = sprintf("%6s", $USERtotPAUSE_MS);
|
||||
|
||||
$USERtotNONPAUSE_M = ($Snon_pause_sec / 60);
|
||||
$USERtotNONPAUSE_M_int = round($USERtotNONPAUSE_M, 2);
|
||||
$USERtotNONPAUSE_M_int = intval("$USERtotNONPAUSE_M_int");
|
||||
$USERtotNONPAUSE_S = ($USERtotNONPAUSE_M - $USERtotNONPAUSE_M_int);
|
||||
$USERtotNONPAUSE_S = ($USERtotNONPAUSE_S * 60);
|
||||
$USERtotNONPAUSE_S = round($USERtotNONPAUSE_S, 0);
|
||||
if ($USERtotNONPAUSE_S < 10) {$USERtotNONPAUSE_S = "0$USERtotNONPAUSE_S";}
|
||||
$USERtotNONPAUSE_MS = "$USERtotNONPAUSE_M_int:$USERtotNONPAUSE_S";
|
||||
$pfUSERtotNONPAUSE_MS = sprintf("%6s", $USERtotNONPAUSE_MS);
|
||||
|
||||
$USERtotTOTAL_M = ($Stotal_sec / 60);
|
||||
$USERtotTOTAL_M_int = round($USERtotTOTAL_M, 2);
|
||||
$USERtotTOTAL_M_int = intval("$USERtotTOTAL_M_int");
|
||||
$USERtotTOTAL_S = ($USERtotTOTAL_M - $USERtotTOTAL_M_int);
|
||||
$USERtotTOTAL_S = ($USERtotTOTAL_S * 60);
|
||||
$USERtotTOTAL_S = round($USERtotTOTAL_S, 0);
|
||||
if ($USERtotTOTAL_S < 10) {$USERtotTOTAL_S = "0$USERtotTOTAL_S";}
|
||||
$USERtotTOTAL_MS = "$USERtotTOTAL_M_int:$USERtotTOTAL_S";
|
||||
$pfUSERtotTOTAL_MS = sprintf("%6s", $USERtotTOTAL_MS);
|
||||
|
||||
|
||||
echo "| $Sfull_name | $Suser | $pfUSERtotTOTAL_MS | $pfUSERtotNONPAUSE_MS | $pfUSERtotPAUSE_MS | |$SstatusesHTML\n";
|
||||
$m++;
|
||||
}
|
||||
### END loop through each user ###
|
||||
|
||||
|
||||
###### LAST LINE FORMATTING ##########
|
||||
### BEGIN loop through each status ###
|
||||
$SUMstatusesHTML='';
|
||||
$TOTtotPAUSE=0;
|
||||
$n=0;
|
||||
while ($n < $j)
|
||||
{
|
||||
$Scalls=0;
|
||||
$Sstatus=$sub_statusesARY[$n];
|
||||
$SUMstatusTXT='';
|
||||
### BEGIN loop through each stat line ###
|
||||
$i=0; $status_found=0;
|
||||
while ($i < $rows_to_print)
|
||||
{
|
||||
if ($Sstatus=="$sub_status[$i]")
|
||||
{
|
||||
$Scalls = ($Scalls + $PCpause_sec[$i]);
|
||||
$status_found++;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
### END loop through each stat line ###
|
||||
if ($status_found < 1)
|
||||
{
|
||||
$SUMstatusesHTML .= " 0 |";
|
||||
}
|
||||
else
|
||||
{
|
||||
$TOTtotPAUSE = ($TOTtotPAUSE + $Scalls);
|
||||
|
||||
$USERsumstatPAUSE_M = ($Scalls / 60);
|
||||
$USERsumstatPAUSE_M_int = round($USERsumstatPAUSE_M, 2);
|
||||
$USERsumstatPAUSE_M_int = intval("$USERsumstatPAUSE_M_int");
|
||||
$USERsumstatPAUSE_S = ($USERsumstatPAUSE_M - $USERsumstatPAUSE_M_int);
|
||||
$USERsumstatPAUSE_S = ($USERsumstatPAUSE_S * 60);
|
||||
$USERsumstatPAUSE_S = round($USERsumstatPAUSE_S, 0);
|
||||
if ($USERsumstatPAUSE_S < 10) {$USERsumstatPAUSE_S = "0$USERsumstatPAUSE_S";}
|
||||
$USERsumstatPAUSE_MS = "$USERsumstatPAUSE_M_int:$USERsumstatPAUSE_S";
|
||||
$pfUSERsumstatPAUSE_MS = sprintf("%6s", $USERsumstatPAUSE_MS);
|
||||
|
||||
$SUMstatusTXT = sprintf("%8s", $pfUSERsumstatPAUSE_MS);
|
||||
$SUMstatusesHTML .= " $SUMstatusTXT |";
|
||||
}
|
||||
$n++;
|
||||
}
|
||||
### END loop through each status ###
|
||||
|
||||
$TOT_AGENTS = sprintf("%-4s", $m);
|
||||
|
||||
$TOTtotPAUSE_M = ($TOTtotPAUSE / 60);
|
||||
$TOTtotPAUSE_M_int = round($TOTtotPAUSE_M, 2);
|
||||
$TOTtotPAUSE_M_int = intval("$TOTtotPAUSE_M_int");
|
||||
$TOTtotPAUSE_S = ($TOTtotPAUSE_M - $TOTtotPAUSE_M_int);
|
||||
$TOTtotPAUSE_S = ($TOTtotPAUSE_S * 60);
|
||||
$TOTtotPAUSE_S = round($TOTtotPAUSE_S, 0);
|
||||
if ($TOTtotPAUSE_S < 10) {$TOTtotPAUSE_S = "0$TOTtotPAUSE_S";}
|
||||
$TOTtotPAUSE_MS = "$TOTtotPAUSE_M_int:$TOTtotPAUSE_S";
|
||||
$TOTtotPAUSE_MS = sprintf("%8s", $TOTtotPAUSE_MS);
|
||||
while(strlen($TOTtotPAUSE_MS)>8) {$TOTtotPAUSE_MS = substr("$TOTtotPAUSE_MS", 0, -1);}
|
||||
|
||||
$TOTtotNONPAUSE_M = ($TOTtotNONPAUSE / 60);
|
||||
$TOTtotNONPAUSE_M_int = round($TOTtotNONPAUSE_M, 2);
|
||||
$TOTtotNONPAUSE_M_int = intval("$TOTtotNONPAUSE_M_int");
|
||||
$TOTtotNONPAUSE_S = ($TOTtotNONPAUSE_M - $TOTtotNONPAUSE_M_int);
|
||||
$TOTtotNONPAUSE_S = ($TOTtotNONPAUSE_S * 60);
|
||||
$TOTtotNONPAUSE_S = round($TOTtotNONPAUSE_S, 0);
|
||||
if ($TOTtotNONPAUSE_S < 10) {$TOTtotNONPAUSE_S = "0$TOTtotNONPAUSE_S";}
|
||||
$TOTtotNONPAUSE_MS = "$TOTtotNONPAUSE_M_int:$TOTtotNONPAUSE_S";
|
||||
$TOTtotNONPAUSE_MS = sprintf("%8s", $TOTtotNONPAUSE_MS);
|
||||
while(strlen($TOTtotNONPAUSE_MS)>8) {$TOTtotNONPAUSE_MS = substr("$TOTtotNONPAUSE_MS", 0, -1);}
|
||||
|
||||
$TOTtotTOTAL_M = ($TOTtotTOTAL / 60);
|
||||
$TOTtotTOTAL_M_int = round($TOTtotTOTAL_M, 2);
|
||||
$TOTtotTOTAL_M_int = intval("$TOTtotTOTAL_M_int");
|
||||
$TOTtotTOTAL_S = ($TOTtotTOTAL_M - $TOTtotTOTAL_M_int);
|
||||
$TOTtotTOTAL_S = ($TOTtotTOTAL_S * 60);
|
||||
$TOTtotTOTAL_S = round($TOTtotTOTAL_S, 0);
|
||||
if ($TOTtotTOTAL_S < 10) {$TOTtotTOTAL_S = "0$TOTtotTOTAL_S";}
|
||||
$TOTtotTOTAL_MS = "$TOTtotTOTAL_M_int:$TOTtotTOTAL_S";
|
||||
$TOTtotTOTAL_MS = sprintf("%8s", $TOTtotTOTAL_MS);
|
||||
while(strlen($TOTtotTOTAL_MS)>8) {$TOTtotTOTAL_MS = substr("$TOTtotTOTAL_MS", 0, -1);}
|
||||
|
||||
|
||||
|
||||
echo "+-----------------+----------+--------+--------+--------+ +$sub_statusesHEAD\n";
|
||||
echo "| TOTALI AGENTS:$TOT_AGENTS |$TOTtotTOTAL_MS|$TOTtotNONPAUSE_MS|$TOTtotPAUSE_MS| |$SUMstatusesHTML\n";
|
||||
echo "+----------------------------+--------+--------+--------+ +$sub_statusesHEAD\n";
|
||||
|
||||
echo "\n\n";
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,400 @@
|
||||
<?
|
||||
# AST_inboundEXTstats.php
|
||||
#
|
||||
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
# 60421-1450 - check GET/POST vars lines with isset to not trigger PHP NOTICES
|
||||
# 60620-1322 - Added variable filtering to eliminate SQL injection attack threat
|
||||
# - Added required user/pass to gain access to this page
|
||||
#
|
||||
|
||||
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["group"])) {$group=$_GET["group"];}
|
||||
elseif (isset($_POST["group"])) {$group=$_POST["group"];}
|
||||
if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];}
|
||||
elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];}
|
||||
if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];}
|
||||
elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];}
|
||||
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"];}
|
||||
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
{
|
||||
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
echo "Username/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$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($server_ip)) {$server_ip = '10.10.11.20';}
|
||||
|
||||
$stmt="select extension,full_number,inbound_name from inbound_numbers where server_ip='" . mysql_real_escape_string($server_ip) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$inbound_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $inbound_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$inbound[$i] =$row[0];
|
||||
$fullnum[$i] =$row[1];
|
||||
$inbname[$i] =$row[2];
|
||||
$i++;
|
||||
}
|
||||
?>
|
||||
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<STYLE type="text/css">
|
||||
<!--
|
||||
.green {color: white; background-color: green}
|
||||
.red {color: white; background-color: red}
|
||||
.blue {color: white; background-color: blue}
|
||||
.purple {color: white; background-color: purple}
|
||||
-->
|
||||
</STYLE>
|
||||
|
||||
<?
|
||||
echo"<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
|
||||
#echo"<META HTTP-EQUIV=Refresh CONTENT=\"7; URL=$PHP_SELF?server_ip=$server_ip&DB=$DB\">\n";
|
||||
echo "<TITLE>ASTERISK: Statistiche Chiamate In Entrata</TITLE></HEAD><BODY BGCOLOR=WHITE>\n";
|
||||
echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET>\n";
|
||||
echo "<INPUT TYPE=HIDDEN NAME=server_ip VALUE=\"$server_ip\">\n";
|
||||
echo "<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">\n";
|
||||
echo "<SELECT SIZE=1 NAME=group>\n";
|
||||
$o=0;
|
||||
while ($inbound_to_print > $o)
|
||||
{
|
||||
if ($inbound[$o] == $group) {echo "<option selected value=\"$inbound[$o]\">$fullnum[$o] - $inbname[$o]</option>\n";}
|
||||
else {echo "<option value=\"$inbound[$o]\">$fullnum[$o] - $inbname[$o]</option>\n";}
|
||||
$o++;
|
||||
}
|
||||
echo "</SELECT>\n";
|
||||
echo "<INPUT TYPE=Submit NAME=INVIA VALUE=INVIA>\n";
|
||||
echo "</FORM>\n\n";
|
||||
|
||||
echo "<PRE><FONT SIZE=2>\n\n";
|
||||
|
||||
|
||||
if (!$group)
|
||||
{
|
||||
echo "\n\n";
|
||||
echo "SELEZIONARE UN NUMERO E UNA DATA QUI IN ALTO E CLICCARE SU INVIA\n";
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
echo "ASTERISK: Statistiche Chiamate In Entrata $NOW_TIME\n";
|
||||
|
||||
echo "\n";
|
||||
echo "---------- TOTALI\n";
|
||||
|
||||
$extenSQL = "and extension='" . mysql_real_escape_string($group) . "'";
|
||||
if (eregi("\*",$group))
|
||||
{$extenSQL = "and extension LIKE \"%$group\"";}
|
||||
$stmt="select count(*),sum(length_in_sec) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " 00:00:01' and start_time <= '" . mysql_real_escape_string($query_date) . " 23:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
$TOTALcalls = sprintf("%10s", $row[0]);
|
||||
$average_hold_seconds = ($row[1] / $row[0]);
|
||||
$average_hold_seconds = round($average_hold_seconds, 0);
|
||||
$average_hold_seconds = sprintf("%10s", $average_hold_seconds);
|
||||
|
||||
echo "Totale chiamate ricevute da questo numero: $TOTALcalls\n";
|
||||
echo "Average Call Length(seconds) for all Calls: $average_hold_seconds\n";
|
||||
|
||||
echo "\n";
|
||||
echo "---------- ABBATTUTE\n";
|
||||
|
||||
$stmt="select count(*),sum(length_in_sec) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " 00:00:01' and start_time <= '" . mysql_real_escape_string($query_date) . " 23:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
$DROPcalls = sprintf("%10s", $row[0]);
|
||||
$DROPpercent = (($DROPcalls / $TOTALcalls) * 100);
|
||||
$DROPpercent = round($DROPpercent, 0);
|
||||
|
||||
if ($row[0])
|
||||
{
|
||||
$average_hold_seconds = ($row[1] / $row[0]);
|
||||
$average_hold_seconds = round($average_hold_seconds, 0);
|
||||
$average_hold_seconds = sprintf("%10s", $average_hold_seconds);
|
||||
}
|
||||
else {$DROPpercent=0; $average_hold_seconds=0;}
|
||||
echo "Total DROP Calls: (less than 10 seconds) $DROPcalls $DROPpercent%\n";
|
||||
echo "Average Call Length(seconds) for DROP Calls: $average_hold_seconds\n";
|
||||
|
||||
|
||||
##############################
|
||||
######### CALLS STATS
|
||||
|
||||
echo "\n";
|
||||
echo "---------- CALL LISTINGS\n";
|
||||
echo "+----------------------+----------------------+--------+---------------------+\n";
|
||||
echo "| CALLERID | CALLERIDNAME | LENGTH | DATE TIME |\n";
|
||||
echo "+----------------------+----------------------+--------+---------------------+\n";
|
||||
|
||||
$stmt="select number_dialed,caller_code,length_in_sec,start_time from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " 00:00:01' and start_time <= '" . mysql_real_escape_string($query_date) . " 23:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$users_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $users_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
$CID = sprintf("%-20s", $row[0]);
|
||||
$CIDname = sprintf("%-20s", $row[1]); while(strlen($full_name)>15) {$full_name = substr("$full_name", 0, -1);}
|
||||
$datetime = sprintf("%-19s", $row[3]);
|
||||
$USERavgTALK = $row[2];
|
||||
|
||||
$USERavgTALK_M = ($USERavgTALK / 60);
|
||||
$USERavgTALK_M = round($USERavgTALK_M, 2);
|
||||
$USERavgTALK_M_int = intval("$USERavgTALK_M");
|
||||
$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
|
||||
$USERavgTALK_S = ($USERavgTALK_S * 60);
|
||||
$USERavgTALK_S = round($USERavgTALK_S, 0);
|
||||
if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";}
|
||||
$USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S";
|
||||
$USERavgTALK_MS = sprintf("%6s", $USERavgTALK_MS);
|
||||
|
||||
echo "| $CID | $CIDname | $USERavgTALK_MS | $datetime |\n";
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
echo "+----------------------+----------------------+--------+---------------------+\n";
|
||||
|
||||
##############################
|
||||
######### TIME STATS
|
||||
|
||||
if ($output == 'FULL')
|
||||
{
|
||||
|
||||
echo "\n";
|
||||
echo "---------- STATISTICHE TEMPO\n";
|
||||
|
||||
echo "<FONT SIZE=0>\n";
|
||||
|
||||
$hi_hour_count=0;
|
||||
$last_full_record=0;
|
||||
$i=0;
|
||||
$h=0;
|
||||
while ($i <= 96)
|
||||
{
|
||||
$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:00:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:14:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
|
||||
$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 call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:00:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:14:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
|
||||
$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 call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:15:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:29:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
|
||||
$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 call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:15:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:29:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
|
||||
$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 call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:30:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:44:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
|
||||
$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 call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:30:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:44:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
|
||||
$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 call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:45:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
|
||||
$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 call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:45:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$drop_count[$i] = $row[0];
|
||||
$i++;
|
||||
$h++;
|
||||
}
|
||||
|
||||
$hour_multiplier = (100 / $hi_hour_count);
|
||||
#$hour_multiplier = round($hour_multiplier, 0);
|
||||
|
||||
echo "<!-- HICOUNT: $hi_hour_count|$hour_multiplier -->\n";
|
||||
echo "GRAFICO AD INCREMENTO DI 15 MINUTI DEL TOTALE DELLE CHIAMATE\n";
|
||||
|
||||
$k=1;
|
||||
$Mk=0;
|
||||
$call_scale = '0';
|
||||
while ($k <= 102)
|
||||
{
|
||||
if ($Mk >= 5)
|
||||
{
|
||||
$Mk=0;
|
||||
$scale_num=($k / $hour_multiplier);
|
||||
$scale_num = round($scale_num, 0);
|
||||
$LENscale_num = (strlen($scale_num));
|
||||
$k = ($k + $LENscale_num);
|
||||
$call_scale .= "$scale_num";
|
||||
}
|
||||
else
|
||||
{
|
||||
$call_scale .= " ";
|
||||
$k++; $Mk++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
|
||||
#echo "| HOUR | GRAPH IN 15 MINUTE INCREMENTS OF TOTAL INCOMING CALLS FOR THIS GROUP | DROPS | TOTAL |\n";
|
||||
echo "| HOUR |$call_scale| DROPS | TOTAL |\n";
|
||||
echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
|
||||
|
||||
$ZZ = '00';
|
||||
$i=0;
|
||||
$h=4;
|
||||
$hour= -1;
|
||||
$no_lines_yet=1;
|
||||
|
||||
while ($i <= 96)
|
||||
{
|
||||
$char_counter=0;
|
||||
$time = ' ';
|
||||
if ($h >= 4)
|
||||
{
|
||||
$hour++;
|
||||
$h=0;
|
||||
if ($hour < 10) {$hour = "0$hour";}
|
||||
$time = "+$hour$ZZ+";
|
||||
}
|
||||
if ($h == 1) {$time = " 15 ";}
|
||||
if ($h == 2) {$time = " 30 ";}
|
||||
if ($h == 3) {$time = " 45 ";}
|
||||
$Ghour_count = $hour_count[$i];
|
||||
if ($Ghour_count < 1)
|
||||
{
|
||||
if ( ($no_lines_yet) or ($i > $last_full_record) )
|
||||
{
|
||||
$do_nothing=1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$hour_count[$i] = sprintf("%-5s", $hour_count[$i]);
|
||||
echo "|$time|";
|
||||
$k=0; while ($k <= 102) {echo " "; $k++;}
|
||||
echo "| $hour_count[$i] |\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$no_lines_yet=0;
|
||||
$Xhour_count = ($Ghour_count * $hour_multiplier);
|
||||
$Yhour_count = (99 - $Xhour_count);
|
||||
|
||||
$Gdrop_count = $drop_count[$i];
|
||||
if ($Gdrop_count < 1)
|
||||
{
|
||||
$hour_count[$i] = sprintf("%-5s", $hour_count[$i]);
|
||||
|
||||
echo "|$time|<SPAN class=\"green\">";
|
||||
$k=0; while ($k <= $Xhour_count) {echo "*"; $k++; $char_counter++;}
|
||||
echo "*X</SPAN>"; $char_counter++;
|
||||
$k=0; while ($k <= $Yhour_count) {echo " "; $k++; $char_counter++;}
|
||||
while ($char_counter <= 101) {echo " "; $char_counter++;}
|
||||
echo "| 0 | $hour_count[$i] |\n";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$Xdrop_count = ($Gdrop_count * $hour_multiplier);
|
||||
|
||||
# if ($Xdrop_count >= $Xhour_count) {$Xdrop_count = ($Xdrop_count - 1);}
|
||||
|
||||
$XXhour_count = ( ($Xhour_count - $Xdrop_count) - 1 );
|
||||
|
||||
$hour_count[$i] = sprintf("%-5s", $hour_count[$i]);
|
||||
$drop_count[$i] = sprintf("%-5s", $drop_count[$i]);
|
||||
|
||||
echo "|$time|<SPAN class=\"red\">";
|
||||
$k=0; while ($k <= $Xdrop_count) {echo ">"; $k++; $char_counter++;}
|
||||
echo "D</SPAN><SPAN class=\"green\">"; $char_counter++;
|
||||
$k=0; while ($k <= $XXhour_count) {echo "*"; $k++; $char_counter++;}
|
||||
echo "X</SPAN>"; $char_counter++;
|
||||
$k=0; while ($k <= $Yhour_count) {echo " "; $k++; $char_counter++;}
|
||||
while ($char_counter <= 102) {echo " "; $char_counter++;}
|
||||
echo "| $drop_count[$i] | $hour_count[$i] |\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$i++;
|
||||
$h++;
|
||||
}
|
||||
|
||||
|
||||
echo "+------+-------------------------------------------------------------------------------------------------------+-------+-------+\n";
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
</PRE>
|
||||
|
||||
</BODY></HTML>
|
||||
@@ -39,6 +39,9 @@
|
||||
# 80822-1222 - Added option for display of customer phone number
|
||||
# 81011-0335 - Fixed remote agent display bug
|
||||
# 81022-1500 - Added inbound call stats display option
|
||||
# 81029-1023 - Changed drop percent calculation for multi-stat reports
|
||||
# 81029-1706 - Added pause code display if enabled per campaign
|
||||
# 81108-2337 - Added inbound-only section
|
||||
#
|
||||
|
||||
header ("Content-type: text/html; charset=utf-8");
|
||||
@@ -103,8 +106,8 @@ while ($i < $qm_conf_ct)
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
|
||||
if (!isset($RR)) {$gRRroup=4;}
|
||||
if (!isset($group)) {$group='';}
|
||||
if (!isset($RR)) {$RR=40;}
|
||||
if (!isset($group)) {$group=''; $RR=40;}
|
||||
if (!isset($usergroup)) {$usergroup='';}
|
||||
if (!isset($UGdisplay)) {$UGdisplay=0;} # 0=no, 1=yes
|
||||
if (!isset($UidORname)) {$UidORname=0;} # 0=id, 1=name
|
||||
@@ -114,6 +117,8 @@ if (!isset($CALLSdisplay)) {$CALLSdisplay=1;} # 0=no, 1=yes
|
||||
if (!isset($PHONEdisplay)) {$PHONEdisplay=0;} # 0=no, 1=yes
|
||||
if (!isset($CUSTPHONEdisplay)) {$CUSTPHONEdisplay=0;} # 0=no, 1=yes
|
||||
if (!isset($with_inbound)) {$with_inbound='N';} # 0=no, 1=yes
|
||||
if (!isset($PAUSEcodes)) {$PAUSEcodes='N';} # 0=no, 1=yes
|
||||
$ingroup_detail='';
|
||||
|
||||
function get_server_load($windows = false) {
|
||||
$os = strtolower(PHP_OS);
|
||||
@@ -310,9 +315,15 @@ if ($UGdisplay > 0)
|
||||
if (!eregi('XXXX-ALL-ACTIVE-XXXX', $group))
|
||||
{
|
||||
echo " Inbound: <SELECT SIZE=1 NAME=with_inbound>\n";
|
||||
echo "<option value=\"N\">No</option>\n";
|
||||
echo "<option value=\"Y\">Yes</option>\n";
|
||||
echo "<option selected>$with_inbound</option>\n";
|
||||
echo "<option value=\"N\"";
|
||||
if ($with_inbound=='N') {echo " selected";}
|
||||
echo ">No</option>\n";
|
||||
echo "<option value=\"Y\"";
|
||||
if ($with_inbound=='Y') {echo " selected";}
|
||||
echo ">Yes</option>\n";
|
||||
echo "<option value=\"O\"";
|
||||
if ($with_inbound=='O') {echo " selected";}
|
||||
echo ">Only</option>\n";
|
||||
}
|
||||
echo "<INPUT type=submit NAME=INVIA VALUE=INVIA><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> \n";
|
||||
echo "<a href=\"$PHP_SELF?group=$group&RR=4000&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound\">STOP</a> | ";
|
||||
@@ -334,162 +345,424 @@ echo "\n\n";
|
||||
if (!$group) {echo "<BR><BR>per favore seleziona una campagna dal menu qui in alto</FORM>\n"; exit;}
|
||||
else
|
||||
{
|
||||
if ($group=='XXXX-ALL-ACTIVE-XXXX')
|
||||
{
|
||||
$stmt="select avg(auto_dial_level),min(dial_status_a),min(dial_status_b),min(dial_status_c),min(dial_status_d),min(dial_status_e),min(lead_order),min(lead_filter_id),sum(hopper_level),min(dial_method),avg(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),min(available_only_ratio_tally),min(adaptive_latest_server_time),min(local_call_time),avg(dial_timeout),min(dial_statuses) from vicidial_campaigns;";
|
||||
$multi_drop=0;
|
||||
|
||||
$stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),min(status_category_1),sum(status_category_count_1),min(status_category_2),sum(status_category_count_2),min(status_category_3),sum(status_category_count_3),min(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats;";
|
||||
}
|
||||
else
|
||||
##### INBOUND ONLY ###
|
||||
if (ereg('O',$with_inbound))
|
||||
{
|
||||
if ($DB > 0) {echo "\n|$with_inbound|$campaign_allow_inbound|\n";}
|
||||
$multi_drop++;
|
||||
$stmt = "select closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$closer_campaigns = $row[0];
|
||||
$closer_campaigns = preg_replace("/^ | -$/","",$closer_campaigns);
|
||||
$closer_campaigns = preg_replace("/ /","','",$closer_campaigns);
|
||||
$closer_campaignsSQL = "'$closer_campaigns'";
|
||||
if ($DB > 0) {echo "\n|$closer_campaigns|$closer_campaignsSQL|$stmt|\n";}
|
||||
|
||||
if ( (ereg('Y',$with_inbound)) and ($campaign_allow_inbound > 0) )
|
||||
if ($adastats>1)
|
||||
{
|
||||
$stmt = "select closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$stmtB="select calls_today,drops_today,answers_today,status_category_1,status_category_count_1,status_category_2,status_category_count_2,status_category_3,status_category_count_3,status_category_4,status_category_count_4,hold_sec_stat_one,hold_sec_stat_two,hold_sec_answer_calls,hold_sec_drop_calls,hold_sec_queue_calls,campaign_id from vicidial_campaign_stats where campaign_id IN ($closer_campaignsSQL);";
|
||||
|
||||
if ($DB > 0) {echo "\n|$stmtB|\n";}
|
||||
|
||||
$r=0;
|
||||
$rslt=mysql_query($stmtB, $link);
|
||||
$ingroups_to_print = mysql_num_rows($rslt);
|
||||
if ($ingroups_to_print > 0)
|
||||
{$ingroup_detail .= "<table cellpadding=0 cellspacing=0>";}
|
||||
while ($ingroups_to_print > $r)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$closer_campaigns = $row[0];
|
||||
$closer_campaigns = preg_replace("/^ | -$/","",$closer_campaigns);
|
||||
$closer_campaigns = preg_replace("/ /","','",$closer_campaigns);
|
||||
$closer_campaignsSQL = "'$closer_campaigns'";
|
||||
if ($DB > 0) {echo "\n|$closer_campaigns|$closer_campaignsSQL|$stmt|\n";}
|
||||
$callsTODAY = $row[0];
|
||||
$dropsTODAY = $row[1];
|
||||
$answersTODAY = $row[2];
|
||||
$VSCcat1 = $row[3];
|
||||
$VSCcat1tally = $row[4];
|
||||
$VSCcat2 = $row[5];
|
||||
$VSCcat2tally = $row[6];
|
||||
$VSCcat3 = $row[7];
|
||||
$VSCcat3tally = $row[8];
|
||||
$VSCcat4 = $row[9];
|
||||
$VSCcat4tally = $row[10];
|
||||
$hold_sec_stat_one = $row[11];
|
||||
$hold_sec_stat_two = $row[12];
|
||||
$hold_sec_answer_calls = $row[13];
|
||||
$hold_sec_drop_calls = $row[14];
|
||||
$hold_sec_queue_calls = $row[15];
|
||||
$ingroupdetail = $row[16];
|
||||
if ( ($dropsTODAY > 0) and ($answersTODAY > 0) )
|
||||
{
|
||||
$drpctTODAY = ( ($dropsTODAY / $answersTODAY) * 100);
|
||||
$drpctTODAY = round($drpctTODAY, 2);
|
||||
$drpctTODAY = sprintf("%01.2f", $drpctTODAY);
|
||||
}
|
||||
else
|
||||
{$drpctTODAY=0;}
|
||||
|
||||
$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses from vicidial_campaigns where campaign_id IN ('" . mysql_real_escape_string($group) . "',$closer_campaignsSQL);";
|
||||
if ($callsTODAY > 0)
|
||||
{
|
||||
$AVGhold_sec_queue_calls = ($hold_sec_queue_calls / $callsTODAY);
|
||||
$AVGhold_sec_queue_calls = round($AVGhold_sec_queue_calls, 0);
|
||||
}
|
||||
else
|
||||
{$AVGhold_sec_queue_calls=0;}
|
||||
|
||||
$stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),min(status_category_1),sum(status_category_count_1),min(status_category_2),sum(status_category_count_2),min(status_category_3),sum(status_category_count_3),min(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats where campaign_id IN ('" . mysql_real_escape_string($group) . "',$closer_campaignsSQL);";
|
||||
if ($dropsTODAY > 0)
|
||||
{
|
||||
$AVGhold_sec_drop_calls = ($hold_sec_drop_calls / $dropsTODAY);
|
||||
$AVGhold_sec_drop_calls = round($AVGhold_sec_drop_calls, 0);
|
||||
}
|
||||
else
|
||||
{$AVGhold_sec_drop_calls=0;}
|
||||
|
||||
if ($answersTODAY > 0)
|
||||
{
|
||||
$PCThold_sec_stat_one = ( ($hold_sec_stat_one / $answersTODAY) * 100);
|
||||
$PCThold_sec_stat_one = round($PCThold_sec_stat_one, 2);
|
||||
$PCThold_sec_stat_one = sprintf("%01.2f", $PCThold_sec_stat_one);
|
||||
$PCThold_sec_stat_two = ( ($hold_sec_stat_two / $answersTODAY) * 100);
|
||||
$PCThold_sec_stat_two = round($PCThold_sec_stat_two, 2);
|
||||
$PCThold_sec_stat_two = sprintf("%01.2f", $PCThold_sec_stat_two);
|
||||
$AVGhold_sec_answer_calls = ($hold_sec_answer_calls / $answersTODAY);
|
||||
$AVGhold_sec_answer_calls = round($AVGhold_sec_answer_calls, 0);
|
||||
if ($agent_non_pause_sec > 0)
|
||||
{
|
||||
$AVG_ANSWERagent_non_pause_sec = ($agent_non_pause_sec / $answersTODAY);
|
||||
$AVG_ANSWERagent_non_pause_sec = round($AVG_ANSWERagent_non_pause_sec, 2);
|
||||
$AVG_ANSWERagent_non_pause_sec = sprintf("%01.2f", $AVG_ANSWERagent_non_pause_sec);
|
||||
}
|
||||
else
|
||||
{$AVG_ANSWERagent_non_pause_sec=0;}
|
||||
}
|
||||
else
|
||||
{
|
||||
$PCThold_sec_stat_one=0;
|
||||
$PCThold_sec_stat_two=0;
|
||||
$AVGhold_sec_answer_calls=0;
|
||||
$AVG_ANSWERagent_non_pause_sec=0;
|
||||
}
|
||||
|
||||
if (ereg("0$|2$|4$|6$|8$",$r)) {$bgcolor='#E6E6E6';}
|
||||
else {$bgcolor='white';}
|
||||
$ingroup_detail .= "<TR bgcolor=\"$bgcolor\">";
|
||||
$ingroup_detail .= "<TD ALIGN=RIGHT bgcolor=white><font size=2> </TD>";
|
||||
$ingroup_detail .= "<TD ALIGN=RIGHT><font size=2><B>$ingroupdetail </B></TD>";
|
||||
$ingroup_detail .= "<TD ALIGN=RIGHT><font size=2><B>CHIAMATE OGGI:</B></TD><TD ALIGN=LEFT><font size=2> $callsTODAY </TD>";
|
||||
$ingroup_detail .= "<TD ALIGN=RIGHT><font size=2><B>TMA 1:</B></TD><TD ALIGN=LEFT><font size=2> $PCThold_sec_stat_one% </TD>";
|
||||
$ingroup_detail .= "<TD ALIGN=RIGHT><font size=2><B>Average Hold time for Answered Calls:</B></TD><TD ALIGN=LEFT><font size=2> $AVGhold_sec_answer_calls </TD>";
|
||||
$ingroup_detail .= "</TR>";
|
||||
$ingroup_detail .= "<TR bgcolor=\"$bgcolor\">";
|
||||
$ingroup_detail .= "<TD ALIGN=RIGHT bgcolor=white><font size=2></TD><TD ALIGN=LEFT><font size=2></TD>";
|
||||
$ingroup_detail .= "<TD ALIGN=RIGHT><font size=2><B>DROPS TODAY:</B></TD><TD ALIGN=LEFT><font size=2> $dropsTODAY </TD>";
|
||||
$ingroup_detail .= "<TD ALIGN=RIGHT><font size=2><B>TMA 2:</B></TD><TD ALIGN=LEFT><font size=2> $PCThold_sec_stat_two% </TD>";
|
||||
$ingroup_detail .= "<TD ALIGN=RIGHT><font size=2><B>Average Hold time for Dropped Calls:</B></TD><TD ALIGN=LEFT><font size=2> $AVGhold_sec_drop_calls </TD>";
|
||||
$ingroup_detail .= "</TR>";
|
||||
$ingroup_detail .= "<TR bgcolor=\"$bgcolor\">";
|
||||
$ingroup_detail .= "<TD ALIGN=RIGHT bgcolor=white><font size=2></TD><TD ALIGN=LEFT><font size=2></TD>";
|
||||
$ingroup_detail .= "<TD ALIGN=RIGHT><font size=2><B>ANSWERS TODAY:</B></TD><TD ALIGN=LEFT><font size=2> $answersTODAY </TD>";
|
||||
$ingroup_detail .= "<TD ALIGN=RIGHT><font size=2><B>DROP PERCENT:</B></TD><TD ALIGN=LEFT><font size=2> $drpctTODAY% </TD>";
|
||||
$ingroup_detail .= "<TD ALIGN=RIGHT><font size=2><B>Average Hold time for All Calls:</B></TD><TD ALIGN=LEFT><font size=2> $AVGhold_sec_queue_calls </TD>";
|
||||
$ingroup_detail .= "</TR>";
|
||||
|
||||
$r++;
|
||||
}
|
||||
|
||||
if ($ingroups_to_print > 0)
|
||||
{$ingroup_detail .= "</table>";}
|
||||
|
||||
}
|
||||
|
||||
$stmt="select agent_pause_codes_active from vicidial_campaigns where campaign_id IN ('" . mysql_real_escape_string($group) . "',$closer_campaignsSQL);";
|
||||
|
||||
$stmtB="select sum(calls_today),sum(drops_today),sum(answers_today),min(status_category_1),sum(status_category_count_1),min(status_category_2),sum(status_category_count_2),min(status_category_3),sum(status_category_count_3),min(status_category_4),sum(status_category_count_4),sum(hold_sec_stat_one),sum(hold_sec_stat_two),sum(hold_sec_answer_calls),sum(hold_sec_drop_calls),sum(hold_sec_queue_calls) from vicidial_campaign_stats where campaign_id IN ($closer_campaignsSQL);";
|
||||
|
||||
$stmtC="select agent_non_pause_sec from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
|
||||
|
||||
if ($DB > 0) {echo "\n|$stmt|$stmtB|$stmtC|\n";}
|
||||
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$agent_pause_codes_active = $row[0];
|
||||
|
||||
$rslt=mysql_query($stmtC, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$agent_non_pause_sec = $row[0];
|
||||
|
||||
$rslt=mysql_query($stmtB, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$callsTODAY = $row[0];
|
||||
$dropsTODAY = $row[1];
|
||||
$answersTODAY = $row[2];
|
||||
$VSCcat1 = $row[3];
|
||||
$VSCcat1tally = $row[4];
|
||||
$VSCcat2 = $row[5];
|
||||
$VSCcat2tally = $row[6];
|
||||
$VSCcat3 = $row[7];
|
||||
$VSCcat3tally = $row[8];
|
||||
$VSCcat4 = $row[9];
|
||||
$VSCcat4tally = $row[10];
|
||||
$hold_sec_stat_one = $row[11];
|
||||
$hold_sec_stat_two = $row[12];
|
||||
$hold_sec_answer_calls = $row[13];
|
||||
$hold_sec_drop_calls = $row[14];
|
||||
$hold_sec_queue_calls = $row[15];
|
||||
if ( ($dropsTODAY > 0) and ($answersTODAY > 0) )
|
||||
{
|
||||
$drpctTODAY = ( ($dropsTODAY / $answersTODAY) * 100);
|
||||
$drpctTODAY = round($drpctTODAY, 2);
|
||||
$drpctTODAY = sprintf("%01.2f", $drpctTODAY);
|
||||
}
|
||||
else
|
||||
{$drpctTODAY=0;}
|
||||
|
||||
if ($callsTODAY > 0)
|
||||
{
|
||||
$AVGhold_sec_queue_calls = ($hold_sec_queue_calls / $callsTODAY);
|
||||
$AVGhold_sec_queue_calls = round($AVGhold_sec_queue_calls, 0);
|
||||
}
|
||||
else
|
||||
{$AVGhold_sec_queue_calls=0;}
|
||||
|
||||
if ($dropsTODAY > 0)
|
||||
{
|
||||
$AVGhold_sec_drop_calls = ($hold_sec_drop_calls / $dropsTODAY);
|
||||
$AVGhold_sec_drop_calls = round($AVGhold_sec_drop_calls, 0);
|
||||
}
|
||||
else
|
||||
{$AVGhold_sec_drop_calls=0;}
|
||||
|
||||
if ($answersTODAY > 0)
|
||||
{
|
||||
$PCThold_sec_stat_one = ( ($hold_sec_stat_one / $answersTODAY) * 100);
|
||||
$PCThold_sec_stat_one = round($PCThold_sec_stat_one, 2);
|
||||
$PCThold_sec_stat_one = sprintf("%01.2f", $PCThold_sec_stat_one);
|
||||
$PCThold_sec_stat_two = ( ($hold_sec_stat_two / $answersTODAY) * 100);
|
||||
$PCThold_sec_stat_two = round($PCThold_sec_stat_two, 2);
|
||||
$PCThold_sec_stat_two = sprintf("%01.2f", $PCThold_sec_stat_two);
|
||||
$AVGhold_sec_answer_calls = ($hold_sec_answer_calls / $answersTODAY);
|
||||
$AVGhold_sec_answer_calls = round($AVGhold_sec_answer_calls, 0);
|
||||
if ($agent_non_pause_sec > 0)
|
||||
{
|
||||
$AVG_ANSWERagent_non_pause_sec = ($agent_non_pause_sec / $answersTODAY);
|
||||
$AVG_ANSWERagent_non_pause_sec = round($AVG_ANSWERagent_non_pause_sec, 2);
|
||||
$AVG_ANSWERagent_non_pause_sec = sprintf("%01.2f", $AVG_ANSWERagent_non_pause_sec);
|
||||
}
|
||||
else
|
||||
{$AVG_ANSWERagent_non_pause_sec=0;}
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
|
||||
$stmtB="select dialable_leads,calls_today,drops_today,drops_answers_today_pct,differential_onemin,agents_average_onemin,balance_trunk_fill,answers_today,status_category_1,status_category_count_1,status_category_2,status_category_count_2,status_category_3,status_category_count_3,status_category_4,status_category_count_4 from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$PCThold_sec_stat_one=0;
|
||||
$PCThold_sec_stat_two=0;
|
||||
$AVGhold_sec_answer_calls=0;
|
||||
$AVG_ANSWERagent_non_pause_sec=0;
|
||||
}
|
||||
}
|
||||
if ($DB > 0) {echo "\n|$stmt|$stmtB|\n";}
|
||||
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$DIALlev = $row[0];
|
||||
$DIALstatusA = $row[1];
|
||||
$DIALstatusB = $row[2];
|
||||
$DIALstatusC = $row[3];
|
||||
$DIALstatusD = $row[4];
|
||||
$DIALstatusE = $row[5];
|
||||
$DIALorder = $row[6];
|
||||
$DIALfilter = $row[7];
|
||||
$HOPlev = $row[8];
|
||||
$DIALmethod = $row[9];
|
||||
$maxDIALlev = $row[10];
|
||||
$DROPmax = $row[11];
|
||||
$targetDIFF = $row[12];
|
||||
$ADAintense = $row[13];
|
||||
$ADAavailonly = $row[14];
|
||||
$TAPERtime = $row[15];
|
||||
$CALLtime = $row[16];
|
||||
$DIALtimeout = $row[17];
|
||||
$DIALstatuses = $row[18];
|
||||
$DIALstatuses = (preg_replace("/ -$|^ /","",$DIALstatuses));
|
||||
$DIALstatuses = (ereg_replace(' ',', ',$DIALstatuses));
|
||||
|
||||
$stmt="select count(*) from vicidial_hopper where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
if ($group=='XXXX-ALL-ACTIVE-XXXX')
|
||||
{
|
||||
$stmt="select count(*) from vicidial_hopper;";
|
||||
}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$VDhop = $row[0];
|
||||
|
||||
$rslt=mysql_query($stmtB, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$DAleads = $row[0];
|
||||
$callsTODAY = $row[1];
|
||||
$dropsTODAY = $row[2];
|
||||
$drpctTODAY = $row[3];
|
||||
$diffONEMIN = $row[4];
|
||||
$agentsONEMIN = $row[5];
|
||||
$balanceFILL = $row[6];
|
||||
$answersTODAY = $row[7];
|
||||
$VSCcat1 = $row[8];
|
||||
$VSCcat1tally = $row[9];
|
||||
$VSCcat2 = $row[10];
|
||||
$VSCcat2tally = $row[11];
|
||||
$VSCcat3 = $row[12];
|
||||
$VSCcat3tally = $row[13];
|
||||
$VSCcat4 = $row[14];
|
||||
$VSCcat4tally = $row[15];
|
||||
|
||||
if ( ($diffONEMIN != 0) and ($agentsONEMIN > 0) )
|
||||
{
|
||||
$diffpctONEMIN = ( ($diffONEMIN / $agentsONEMIN) * 100);
|
||||
$diffpctONEMIN = sprintf("%01.2f", $diffpctONEMIN);
|
||||
}
|
||||
else {$diffpctONEMIN = '0.00';}
|
||||
|
||||
$stmt="select sum(local_trunk_shortage) from vicidial_campaign_server_stats where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
if ($group=='XXXX-ALL-ACTIVE-XXXX')
|
||||
{
|
||||
$stmt="select sum(local_trunk_shortage) from vicidial_campaign_server_stats;";
|
||||
}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$balanceSHORT = $row[0];
|
||||
|
||||
echo "<BR><table cellpadding=0 cellspacing=0><TR>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>LIVELLO CHIAMATE:</B></TD><TD ALIGN=LEFT><font size=2> $DIALlev </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>TRUNK SHORT/FILL:</B></TD><TD ALIGN=LEFT><font size=2> $balanceSHORT / $balanceFILL </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>FILTRO:</B></TD><TD ALIGN=LEFT><font size=2> $DIALfilter </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B> DATA:</B> </TD><TD ALIGN=LEFT><font size=2> $NOW_TIME </TD>";
|
||||
echo "";
|
||||
echo "</TR>";
|
||||
|
||||
if ($adastats>1)
|
||||
{
|
||||
echo "<TR BGCOLOR=\"#CCCCCC\">";
|
||||
echo "<TD ALIGN=RIGHT><a href=\"$PHP_SELF?group=$group&RR=4&DB=$DB&adastats=1\"><font size=1>- min </font></a><font size=2> <B>LIVELLO MAX:</B></TD><TD ALIGN=LEFT><font size=2> $maxDIALlev </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>ABBATTIMENTO MAX:</B></TD><TD ALIGN=LEFT><font size=2> $DROPmax% </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>TARGET DIFF:</B></TD><TD ALIGN=LEFT><font size=2> $targetDIFF </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>INTENSITY:</B></TD><TD ALIGN=LEFT><font size=2> $ADAintense </TD>";
|
||||
echo "<BR><table cellpadding=0 cellspacing=0><TR>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>CHIAMATE OGGI:</B></TD><TD ALIGN=LEFT><font size=2> $callsTODAY </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>TMA 1:</B></TD><TD ALIGN=LEFT><font size=2> $PCThold_sec_stat_one% </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>Average Hold time for Answered Calls:</B></TD><TD ALIGN=LEFT><font size=2> $AVGhold_sec_answer_calls </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B> DATA:</B> </TD><TD ALIGN=LEFT><font size=2> $NOW_TIME </TD>";
|
||||
echo "";
|
||||
echo "</TR>";
|
||||
|
||||
echo "<TR BGCOLOR=\"#CCCCCC\">";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>TIMEOUT CHIAMATA:</B></TD><TD ALIGN=LEFT><font size=2> $DIALtimeout </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>TAPER TIME:</B></TD><TD ALIGN=LEFT><font size=2> $TAPERtime </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>LOCAL TIME:</B></TD><TD ALIGN=LEFT><font size=2> $CALLtime </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>AVAIL ONLY:</B></TD><TD ALIGN=LEFT><font size=2> $ADAavailonly </TD>";
|
||||
echo "<TR>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>DROPS TODAY:</B></TD><TD ALIGN=LEFT><font size=2> $dropsTODAY </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>TMA 2:</B></TD><TD ALIGN=LEFT><font size=2> $PCThold_sec_stat_two% </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>Average Hold time for Dropped Calls:</B></TD><TD ALIGN=LEFT><font size=2> $AVGhold_sec_drop_calls </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2> </TD><TD ALIGN=LEFT><font size=2> </TD>";
|
||||
echo "";
|
||||
echo "</TR>";
|
||||
echo "<TR>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>ANSWERS TODAY:</B></TD><TD ALIGN=LEFT><font size=2> $answersTODAY </TD>";
|
||||
echo "<TD ALIGN=RIGHT COLSPAN=2><font size=2><B>(Agent non-pause time / Answers)</B></TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>Average Hold time for All Calls:</B></TD><TD ALIGN=LEFT><font size=2> $AVGhold_sec_queue_calls </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2> </TD><TD ALIGN=LEFT><font size=2> </TD>";
|
||||
echo "";
|
||||
echo "</TR>";
|
||||
echo "<TR>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>DROP PERCENT:</B></TD><TD ALIGN=LEFT><font size=2> $drpctTODAY% </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>PRODUCTIVITY:</B></TD><TD ALIGN=LEFT><font size=2> $AVG_ANSWERagent_non_pause_sec </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2></TD><TD ALIGN=LEFT><font size=2></TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2></TD><TD ALIGN=LEFT><font size=2></TD>";
|
||||
echo "";
|
||||
echo "</TR>";
|
||||
}
|
||||
|
||||
echo "<TR>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>CONTATTI CHIAMABILI:</B></TD><TD ALIGN=LEFT><font size=2> $DAleads </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>CHIAMATE OGGI:</B></TD><TD ALIGN=LEFT><font size=2> $callsTODAY </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>MEDIA OPERATORI:</B></TD><TD ALIGN=LEFT><font size=2> $agentsONEMIN </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>METODO CHIAMATA:</B></TD><TD ALIGN=LEFT><font size=2> $DIALmethod </TD>";
|
||||
echo "</TR>";
|
||||
|
||||
echo "<TR>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>LIVELLO CODA CHIAMATE:</B></TD><TD ALIGN=LEFT><font size=2> $HOPlev </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>ABBATTUTE / RISPOSTE:</B></TD><TD ALIGN=LEFT><font size=2> $dropsTODAY / $answersTODAY </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>DL DIFF:</B></TD><TD ALIGN=LEFT><font size=2> $diffONEMIN </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>ESITI:</B></TD><TD ALIGN=LEFT><font size=2> $DIALstatuses </TD>";
|
||||
echo "</TR>";
|
||||
|
||||
echo "<TR>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>CONTATTI IN CODA:</B></TD><TD ALIGN=LEFT><font size=2> $VDhop </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>PERCENT ABBATTIMENTO:</B></TD><TD ALIGN=LEFT><font size=2> ";
|
||||
if ($drpctTODAY >= $DROPmax)
|
||||
{echo "<font color=red><B>$drpctTODAY%</B></font>";}
|
||||
##### NOT INBOUND ONLY ###
|
||||
else
|
||||
{echo "$drpctTODAY%";}
|
||||
echo " </TD>";
|
||||
{
|
||||
if ($group=='XXXX-ALL-ACTIVE-XXXX')
|
||||
{
|
||||
$multi_drop++;
|
||||
$stmt="select avg(auto_dial_level),min(dial_status_a),min(dial_status_b),min(dial_status_c),min(dial_status_d),min(dial_status_e),min(lead_order),min(lead_filter_id),sum(hopper_level),min(dial_method),avg(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),min(available_only_ratio_tally),min(adaptive_latest_server_time),min(local_call_time),avg(dial_timeout),min(dial_statuses),max(agent_pause_codes_active) from vicidial_campaigns;";
|
||||
|
||||
$stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),min(status_category_1),sum(status_category_count_1),min(status_category_2),sum(status_category_count_2),min(status_category_3),sum(status_category_count_3),min(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats;";
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($DB > 0) {echo "\n|$with_inbound|$campaign_allow_inbound|\n";}
|
||||
|
||||
if ( (ereg('Y',$with_inbound)) and ($campaign_allow_inbound > 0) )
|
||||
{
|
||||
$multi_drop++;
|
||||
$stmt = "select closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$closer_campaigns = $row[0];
|
||||
$closer_campaigns = preg_replace("/^ | -$/","",$closer_campaigns);
|
||||
$closer_campaigns = preg_replace("/ /","','",$closer_campaigns);
|
||||
$closer_campaignsSQL = "'$closer_campaigns'";
|
||||
if ($DB > 0) {echo "\n|$closer_campaigns|$closer_campaignsSQL|$stmt|\n";}
|
||||
|
||||
$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses,agent_pause_codes_active from vicidial_campaigns where campaign_id IN ('" . mysql_real_escape_string($group) . "',$closer_campaignsSQL);";
|
||||
|
||||
$stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),min(status_category_1),sum(status_category_count_1),min(status_category_2),sum(status_category_count_2),min(status_category_3),sum(status_category_count_3),min(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats where campaign_id IN ('" . mysql_real_escape_string($group) . "',$closer_campaignsSQL);";
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses,agent_pause_codes_active from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
|
||||
$stmtB="select dialable_leads,calls_today,drops_today,drops_answers_today_pct,differential_onemin,agents_average_onemin,balance_trunk_fill,answers_today,status_category_1,status_category_count_1,status_category_2,status_category_count_2,status_category_3,status_category_count_3,status_category_4,status_category_count_4 from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
}
|
||||
}
|
||||
if ($DB > 0) {echo "\n|$stmt|$stmtB|\n";}
|
||||
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$DIALlev = $row[0];
|
||||
$DIALstatusA = $row[1];
|
||||
$DIALstatusB = $row[2];
|
||||
$DIALstatusC = $row[3];
|
||||
$DIALstatusD = $row[4];
|
||||
$DIALstatusE = $row[5];
|
||||
$DIALorder = $row[6];
|
||||
$DIALfilter = $row[7];
|
||||
$HOPlev = $row[8];
|
||||
$DIALmethod = $row[9];
|
||||
$maxDIALlev = $row[10];
|
||||
$DROPmax = $row[11];
|
||||
$targetDIFF = $row[12];
|
||||
$ADAintense = $row[13];
|
||||
$ADAavailonly = $row[14];
|
||||
$TAPERtime = $row[15];
|
||||
$CALLtime = $row[16];
|
||||
$DIALtimeout = $row[17];
|
||||
$DIALstatuses = $row[18];
|
||||
$DIALstatuses = (preg_replace("/ -$|^ /","",$DIALstatuses));
|
||||
$DIALstatuses = (ereg_replace(' ',', ',$DIALstatuses));
|
||||
$agent_pause_codes_active = $row[19];
|
||||
|
||||
|
||||
$stmt="select count(*) from vicidial_hopper where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
if ($group=='XXXX-ALL-ACTIVE-XXXX')
|
||||
{
|
||||
$stmt="select count(*) from vicidial_hopper;";
|
||||
}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$VDhop = $row[0];
|
||||
|
||||
$rslt=mysql_query($stmtB, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$DAleads = $row[0];
|
||||
$callsTODAY = $row[1];
|
||||
$dropsTODAY = $row[2];
|
||||
$drpctTODAY = $row[3];
|
||||
$diffONEMIN = $row[4];
|
||||
$agentsONEMIN = $row[5];
|
||||
$balanceFILL = $row[6];
|
||||
$answersTODAY = $row[7];
|
||||
if ($multi_drop > 0)
|
||||
{
|
||||
if ( ($dropsTODAY > 0) and ($answersTODAY > 0) )
|
||||
{
|
||||
$drpctTODAY = ( ($dropsTODAY / $answersTODAY) * 100);
|
||||
$drpctTODAY = round($drpctTODAY, 2);
|
||||
$drpctTODAY = sprintf("%01.2f", $drpctTODAY);
|
||||
}
|
||||
else
|
||||
{$drpctTODAY=0;}
|
||||
}
|
||||
$VSCcat1 = $row[8];
|
||||
$VSCcat1tally = $row[9];
|
||||
$VSCcat2 = $row[10];
|
||||
$VSCcat2tally = $row[11];
|
||||
$VSCcat3 = $row[12];
|
||||
$VSCcat3tally = $row[13];
|
||||
$VSCcat4 = $row[14];
|
||||
$VSCcat4tally = $row[15];
|
||||
|
||||
if ( ($diffONEMIN != 0) and ($agentsONEMIN > 0) )
|
||||
{
|
||||
$diffpctONEMIN = ( ($diffONEMIN / $agentsONEMIN) * 100);
|
||||
$diffpctONEMIN = sprintf("%01.2f", $diffpctONEMIN);
|
||||
}
|
||||
else {$diffpctONEMIN = '0.00';}
|
||||
|
||||
$stmt="select sum(local_trunk_shortage) from vicidial_campaign_server_stats where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
if ($group=='XXXX-ALL-ACTIVE-XXXX')
|
||||
{
|
||||
$stmt="select sum(local_trunk_shortage) from vicidial_campaign_server_stats;";
|
||||
}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$balanceSHORT = $row[0];
|
||||
|
||||
echo "<BR><table cellpadding=0 cellspacing=0><TR>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>LIVELLO CHIAMATE:</B></TD><TD ALIGN=LEFT><font size=2> $DIALlev </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>TRUNK SHORT/FILL:</B></TD><TD ALIGN=LEFT><font size=2> $balanceSHORT / $balanceFILL </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>FILTRO:</B></TD><TD ALIGN=LEFT><font size=2> $DIALfilter </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B> DATA:</B> </TD><TD ALIGN=LEFT><font size=2> $NOW_TIME </TD>";
|
||||
echo "";
|
||||
echo "</TR>";
|
||||
|
||||
if ($adastats>1)
|
||||
{
|
||||
echo "<TR BGCOLOR=\"#CCCCCC\">";
|
||||
echo "<TD ALIGN=RIGHT><a href=\"$PHP_SELF?group=$group&RR=4&DB=$DB&adastats=1\"><font size=1>- min </font></a><font size=2> <B>LIVELLO MAX:</B></TD><TD ALIGN=LEFT><font size=2> $maxDIALlev </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>ABBATTIMENTO MAX:</B></TD><TD ALIGN=LEFT><font size=2> $DROPmax% </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>TARGET DIFF:</B></TD><TD ALIGN=LEFT><font size=2> $targetDIFF </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>INTENSITY:</B></TD><TD ALIGN=LEFT><font size=2> $ADAintense </TD>";
|
||||
echo "</TR>";
|
||||
|
||||
echo "<TR BGCOLOR=\"#CCCCCC\">";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>TIMEOUT CHIAMATA:</B></TD><TD ALIGN=LEFT><font size=2> $DIALtimeout </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>TAPER TIME:</B></TD><TD ALIGN=LEFT><font size=2> $TAPERtime </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>LOCAL TIME:</B></TD><TD ALIGN=LEFT><font size=2> $CALLtime </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>AVAIL ONLY:</B></TD><TD ALIGN=LEFT><font size=2> $ADAavailonly </TD>";
|
||||
echo "</TR>";
|
||||
}
|
||||
|
||||
echo "<TR>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>CONTATTI CHIAMABILI:</B></TD><TD ALIGN=LEFT><font size=2> $DAleads </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>CHIAMATE OGGI:</B></TD><TD ALIGN=LEFT><font size=2> $callsTODAY </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>MEDIA OPERATORI:</B></TD><TD ALIGN=LEFT><font size=2> $agentsONEMIN </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>METODO CHIAMATA:</B></TD><TD ALIGN=LEFT><font size=2> $DIALmethod </TD>";
|
||||
echo "</TR>";
|
||||
|
||||
echo "<TR>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>LIVELLO CODA CHIAMATE:</B></TD><TD ALIGN=LEFT><font size=2> $HOPlev </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>ABBATTUTE / RISPOSTE:</B></TD><TD ALIGN=LEFT><font size=2> $dropsTODAY / $answersTODAY </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>DL DIFF:</B></TD><TD ALIGN=LEFT><font size=2> $diffONEMIN </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>ESITI:</B></TD><TD ALIGN=LEFT><font size=2> $DIALstatuses </TD>";
|
||||
echo "</TR>";
|
||||
|
||||
echo "<TR>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>CONTATTI IN CODA:</B></TD><TD ALIGN=LEFT><font size=2> $VDhop </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>PERCENT ABBATTIMENTO:</B></TD><TD ALIGN=LEFT><font size=2> ";
|
||||
if ($drpctTODAY >= $DROPmax)
|
||||
{echo "<font color=red><B>$drpctTODAY%</B></font>";}
|
||||
else
|
||||
{echo "$drpctTODAY%";}
|
||||
echo " </TD>";
|
||||
|
||||
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>DIFF:</B></TD><TD ALIGN=LEFT><font size=2> $diffpctONEMIN% </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>ORDINE:</B></TD><TD ALIGN=LEFT><font size=2> $DIALorder </TD>";
|
||||
echo "</TR>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>DIFF:</B></TD><TD ALIGN=LEFT><font size=2> $diffpctONEMIN% </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>ORDINE:</B></TD><TD ALIGN=LEFT><font size=2> $DIALorder </TD>";
|
||||
echo "</TR>";
|
||||
}
|
||||
|
||||
echo "<TR>";
|
||||
echo "<TD ALIGN=LEFT COLSPAN=8>";
|
||||
@@ -505,9 +778,15 @@ echo "</TD></TR>";
|
||||
echo "<TR>";
|
||||
echo "<TD ALIGN=LEFT COLSPAN=8>";
|
||||
|
||||
echo "$ingroup_detail";
|
||||
|
||||
if ($adastats<2)
|
||||
{
|
||||
echo "<a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=2&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound\"><font size=1>+ VISUALIZZA PIU DATI</font></a>";
|
||||
echo "<a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=2&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound\"><font size=1>+ VIEW MORE</font></a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=1&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound\"><font size=1>+ VIEW LESS</font></a>";
|
||||
}
|
||||
if ($UGdisplay>0)
|
||||
{
|
||||
@@ -779,7 +1058,16 @@ $HDcampaign = "------------+";
|
||||
$HTcampaign = " <a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$campaignord&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound\">CAMPAGNA</a> |";
|
||||
$HDcalls = "-------+";
|
||||
$HTcalls = " CALLS |";
|
||||
$HDpause = '';
|
||||
$HTpause = '';
|
||||
|
||||
if (!ereg("N",$agent_pause_codes_active))
|
||||
{
|
||||
$HDstatus = "----------";
|
||||
$HTstatus = " STATUS ";
|
||||
$HDpause = "-------+";
|
||||
$HTpause = " PAUSE |";
|
||||
}
|
||||
if ($PHONEdisplay < 1)
|
||||
{
|
||||
$HDphone = '';
|
||||
@@ -815,8 +1103,8 @@ if ($SERVdisplay < 1)
|
||||
|
||||
|
||||
|
||||
$Aline = "$HDbegin$HDstation$HDphone$HDuser$HDusergroup$HDsessionid$HDbarge$HDstatus$HDcustphone$HDserver_ip$HDcall_server_ip$HDtime$HDcampaign$HDcalls\n";
|
||||
$Bline = "$HTbegin$HTstation$HTphone$HTuser$HTusergroup$HTsessionid$HTbarge$HTstatus$HTcustphone$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign$HTcalls\n";
|
||||
$Aline = "$HDbegin$HDstation$HDphone$HDuser$HDusergroup$HDsessionid$HDbarge$HDstatus$HDpause$HDcustphone$HDserver_ip$HDcall_server_ip$HDtime$HDcampaign$HDcalls\n";
|
||||
$Bline = "$HTbegin$HTstation$HTphone$HTuser$HTusergroup$HTsessionid$HTbarge$HTstatus$HTpause$HTcustphone$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign$HTcalls\n";
|
||||
$Aecho .= "$Aline";
|
||||
$Aecho .= "$Bline";
|
||||
$Aecho .= "$Aline";
|
||||
@@ -876,6 +1164,7 @@ $talking_to_print = mysql_num_rows($rslt);
|
||||
}
|
||||
|
||||
$callerids='';
|
||||
$pausecode='';
|
||||
$stmt="select callerid,lead_id,phone_number from vicidial_auto_calls;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
@@ -1013,6 +1302,11 @@ $calls_to_list = mysql_num_rows($rslt);
|
||||
$comments= $Acomments[$i];
|
||||
$calls_today = sprintf("%-5s", $Acalls_today[$i]);
|
||||
|
||||
if (!ereg("N",$agent_pause_codes_active))
|
||||
{$pausecode=' ';}
|
||||
else
|
||||
{$pausecode='';}
|
||||
|
||||
if (eregi("INCALL",$Lstatus))
|
||||
{
|
||||
### temporarily deactivate DEAD calls display until bug is fixed
|
||||
@@ -1109,6 +1403,17 @@ $calls_to_list = mysql_num_rows($rslt);
|
||||
}
|
||||
if ($Lstatus=='PAUSED')
|
||||
{
|
||||
if (!ereg("N",$agent_pause_codes_active))
|
||||
{
|
||||
$stmtC="select sub_status from vicidial_agent_log where user='$Luser' order by agent_log_id desc limit 1;";
|
||||
$rsltC=mysql_query($stmtC,$link);
|
||||
$rowC=mysql_fetch_row($rsltC);
|
||||
$pausecode = sprintf("%-6s", $rowC[0]);
|
||||
$pausecode = "$pausecode ";
|
||||
}
|
||||
else
|
||||
{$pausecode='';}
|
||||
|
||||
if ($call_time_M_int >= 360)
|
||||
{$j++; continue;}
|
||||
else
|
||||
@@ -1173,7 +1478,7 @@ $calls_to_list = mysql_num_rows($rslt);
|
||||
|
||||
$agentcount++;
|
||||
|
||||
$Aecho .= "| $G$extension$EG |$phoneD <a href=\"./user_status.php?user=$Luser\" target=\"_blank\">$G$user$EG</a> |$UGD $G$sessionid$EG$L$R | $G$status$EG $CM | $CP$SVD$G$call_time_MS$EG | $G$campaign_id$EG | $G$calls_today$EG |$INGRP\n";
|
||||
$Aecho .= "| $G$extension$EG |$phoneD <a href=\"./user_status.php?user=$Luser\" target=\"_blank\">$G$user$EG</a> |$UGD $G$sessionid$EG$L$R | $G$status$EG $CM $pausecode| $CP$SVD$G$call_time_MS$EG | $G$campaign_id$EG | $G$calls_today$EG |$INGRP\n";
|
||||
|
||||
$j++;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,447 @@
|
||||
<?
|
||||
# AST_timeonVDADallSUMMARY.php
|
||||
#
|
||||
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# Summary for all campaigns live real-time stats for the VICIDIAL Auto-Dialer all servers
|
||||
#
|
||||
# STOP=4000, SLOW=40, GO=4 seconds refresh interval
|
||||
#
|
||||
# changes:
|
||||
# 61102-1616 - first build
|
||||
# 61215-1131 - added answered calls and drop percent taken from answered calls
|
||||
# 70111-1600 - added ability to use BLEND/INBND/*_C/*_B/*_I as closer campaigns
|
||||
# 70619-1339 - Added Status Category tally display
|
||||
# 71029-1900 - Changed CLOSER-type to not require campaign_id restriction
|
||||
# 80525-1040 - Added IVR status summary display for inbound calls
|
||||
#
|
||||
|
||||
header ("Content-type: text/html; charset=utf-8");
|
||||
|
||||
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["RR"])) {$RR=$_GET["RR"];}
|
||||
elseif (isset($_POST["RR"])) {$RR=$_POST["RR"];}
|
||||
if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
|
||||
elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];}
|
||||
if (isset($_GET["adastats"])) {$adastats=$_GET["adastats"];}
|
||||
elseif (isset($_POST["adastats"])) {$adastats=$_POST["adastats"];}
|
||||
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($RR)) {$gRRroup=4;}
|
||||
|
||||
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
{
|
||||
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
echo "Username/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
$STARTtime = date("U");
|
||||
|
||||
$stmt="select campaign_id from vicidial_campaigns where active='Y';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if (!isset($DB)) {$DB=0;}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$groups_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $groups_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$groups[$i] =$row[0];
|
||||
$i++;
|
||||
}
|
||||
|
||||
if (!isset($RR)) {$RR=4;}
|
||||
|
||||
?>
|
||||
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<STYLE type="text/css">
|
||||
<!--
|
||||
.green {color: white; background-color: green}
|
||||
.red {color: white; background-color: red}
|
||||
.lightblue {color: black; background-color: #ADD8E6}
|
||||
.blue {color: white; background-color: blue}
|
||||
.midnightblue {color: white; background-color: #191970}
|
||||
.purple {color: white; background-color: purple}
|
||||
.violet {color: black; background-color: #EE82EE}
|
||||
.thistle {color: black; background-color: #D8BFD8}
|
||||
.olive {color: white; background-color: #808000}
|
||||
.yellow {color: black; background-color: yellow}
|
||||
.khaki {color: black; background-color: #F0E68C}
|
||||
.orange {color: black; background-color: orange}
|
||||
|
||||
.r1 {color: black; background-color: #FFCCCC}
|
||||
.r2 {color: black; background-color: #FF9999}
|
||||
.r3 {color: black; background-color: #FF6666}
|
||||
.r4 {color: white; background-color: #FF0000}
|
||||
.b1 {color: black; background-color: #CCCCFF}
|
||||
.b2 {color: black; background-color: #9999FF}
|
||||
.b3 {color: black; background-color: #6666FF}
|
||||
.b4 {color: white; background-color: #0000FF}
|
||||
-->
|
||||
</STYLE>
|
||||
|
||||
<?
|
||||
|
||||
echo"<META HTTP-EQUIV=Refresh CONTENT=\"$RR; URL=$PHP_SELF?RR=$RR&DB=$DB&adastats=$adastats\">\n";
|
||||
echo "<TITLE>VICIDIAL: Riepilogo Di Tutte Le Campagne Aggiornato In Tempo Reale/TITLE></HEAD><BODY BGCOLOR=WHITE>\n";
|
||||
echo "<b>VICIDIAL: Riepilogo Di Tutte Le Campagne Aggiornato In Tempo Reale/b> \n";
|
||||
echo "<a href=\"$PHP_SELF?group=$group&RR=4000&DB=$DB&adastats=$adastats\">STOP</a> | ";
|
||||
echo "<a href=\"$PHP_SELF?group=$group&RR=40&DB=$DB&adastats=$adastats\">PIU LENTO</a> | ";
|
||||
echo "<a href=\"$PHP_SELF?group=$group&RR=4&DB=$DB&adastats=$adastats\">INIZIA</a> ";
|
||||
echo " </FONT>\n";
|
||||
if ($adastats<2)
|
||||
{
|
||||
echo "<a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=2\"><font size=1>+ VISUALIZZA PIU DATI</font></a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=1\"><font size=1>- VISUALIZZA MENO DATI</font></a>";
|
||||
}
|
||||
echo " <a href=\"./admin.php?ADD=999999\">REPORT</a>";
|
||||
echo "<BR><BR>\n\n";
|
||||
|
||||
$k=0;
|
||||
while($k<$groups_to_print)
|
||||
{
|
||||
$NFB = '<b><font size=3 face="courier">';
|
||||
$NFE = '</font></b>';
|
||||
$F=''; $FG=''; $B=''; $BG='';
|
||||
|
||||
$group = $groups[$k];
|
||||
echo "<b><a href=\"./AST_timeonVDADall.php?group=$group&RR=$RR&DB=$DB&adastats=$adastats\">$group</a></b> - ";
|
||||
echo "<a href=\"./admin.php?ADD=34&campaign_id=$group\">Modifica</a>\n";
|
||||
|
||||
|
||||
$stmt = "select count(*) from vicidial_campaigns where campaign_id='$group' and campaign_allow_inbound='Y';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$campaign_allow_inbound = $row[0];
|
||||
|
||||
$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$DIALlev = $row[0];
|
||||
$DIALstatusA = $row[1];
|
||||
$DIALstatusB = $row[2];
|
||||
$DIALstatusC = $row[3];
|
||||
$DIALstatusD = $row[4];
|
||||
$DIALstatusE = $row[5];
|
||||
$DIALorder = $row[6];
|
||||
$DIALfilter = $row[7];
|
||||
$HOPlev = $row[8];
|
||||
$DIALmethod = $row[9];
|
||||
$maxDIALlev = $row[10];
|
||||
$DROPmax = $row[11];
|
||||
$targetDIFF = $row[12];
|
||||
$ADAintense = $row[13];
|
||||
$ADAavailonly = $row[14];
|
||||
$TAPERtime = $row[15];
|
||||
$CALLtime = $row[16];
|
||||
$DIALtimeout = $row[17];
|
||||
$DIALstatuses = $row[18];
|
||||
$DIALstatuses = (preg_replace("/ -$|^ /","",$DIALstatuses));
|
||||
$DIALstatuses = (ereg_replace(' ',', ',$DIALstatuses));
|
||||
|
||||
$stmt="select count(*) from vicidial_hopper where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$VDhop = $row[0];
|
||||
|
||||
$stmt="select dialable_leads,calls_today,drops_today,drops_answers_today_pct,differential_onemin,agents_average_onemin,balance_trunk_fill,answers_today,status_category_1,status_category_count_1,status_category_2,status_category_count_2,status_category_3,status_category_count_3,status_category_4,status_category_count_4 from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$DAleads = $row[0];
|
||||
$callsTODAY = $row[1];
|
||||
$dropsTODAY = $row[2];
|
||||
$drpctTODAY = $row[3];
|
||||
$diffONEMIN = $row[4];
|
||||
$agentsONEMIN = $row[5];
|
||||
$balanceFILL = $row[6];
|
||||
$answersTODAY = $row[7];
|
||||
$VSCcat1 = $row[8];
|
||||
$VSCcat1tally = $row[9];
|
||||
$VSCcat2 = $row[10];
|
||||
$VSCcat2tally = $row[11];
|
||||
$VSCcat3 = $row[12];
|
||||
$VSCcat3tally = $row[13];
|
||||
$VSCcat4 = $row[14];
|
||||
$VSCcat4tally = $row[15];
|
||||
|
||||
if ( ($diffONEMIN != 0) and ($agentsONEMIN > 0) )
|
||||
{
|
||||
$diffpctONEMIN = ( ($diffONEMIN / $agentsONEMIN) * 100);
|
||||
$diffpctONEMIN = sprintf("%01.2f", $diffpctONEMIN);
|
||||
}
|
||||
else {$diffpctONEMIN = '0.00';}
|
||||
|
||||
$stmt="select sum(local_trunk_shortage) from vicidial_campaign_server_stats where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$balanceSHORT = $row[0];
|
||||
|
||||
echo "<BR><table cellpadding=0 cellspacing=0><TR>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>LIVELLO CHIAMATE:</B></TD><TD ALIGN=LEFT><font size=2> $DIALlev </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>TRUNK SHORT/FILL:</B></TD><TD ALIGN=LEFT><font size=2> $balanceSHORT / $balanceFILL </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>FILTRO:</B></TD><TD ALIGN=LEFT><font size=2> $DIALfilter </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B> DATA:</B> </TD><TD ALIGN=LEFT><font size=2> $NOW_TIME </TD>";
|
||||
echo "";
|
||||
echo "</TR>";
|
||||
|
||||
if ($adastats>1)
|
||||
{
|
||||
echo "<TR BGCOLOR=\"#CCCCCC\">";
|
||||
echo "<TD ALIGN=RIGHT><font size=2> <B>LIVELLO MAX:</B></TD><TD ALIGN=LEFT><font size=2> $maxDIALlev </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>ABBATTIMENTO MAX:</B></TD><TD ALIGN=LEFT><font size=2> $DROPmax% </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>TARGET DIFF:</B></TD><TD ALIGN=LEFT><font size=2> $targetDIFF </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>INTENSITY:</B></TD><TD ALIGN=LEFT><font size=2> $ADAintense </TD>";
|
||||
echo "</TR>";
|
||||
|
||||
echo "<TR BGCOLOR=\"#CCCCCC\">";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>TIMEOUT CHIAMATA:</B></TD><TD ALIGN=LEFT><font size=2> $DIALtimeout </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>TAPER TIME:</B></TD><TD ALIGN=LEFT><font size=2> $TAPERtime </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>LOCAL TIME:</B></TD><TD ALIGN=LEFT><font size=2> $CALLtime </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>AVAIL ONLY:</B></TD><TD ALIGN=LEFT><font size=2> $ADAavailonly </TD>";
|
||||
echo "</TR>";
|
||||
}
|
||||
|
||||
echo "<TR>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>CONTATTI CHIAMABILI:</B></TD><TD ALIGN=LEFT><font size=2> $DAleads </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>CHIAMATE OGGI:</B></TD><TD ALIGN=LEFT><font size=2> $callsTODAY </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>MEDIA OPERATORI:</B></TD><TD ALIGN=LEFT><font size=2> $agentsONEMIN </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>METODO CHIAMATA:</B></TD><TD ALIGN=LEFT><font size=2> $DIALmethod </TD>";
|
||||
echo "</TR>";
|
||||
|
||||
echo "<TR>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>LIVELLO CODA CHIAMATE:</B></TD><TD ALIGN=LEFT><font size=2> $HOPlev </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>ABBATTUTE / RISPOSTE:</B></TD><TD ALIGN=LEFT><font size=2> $dropsTODAY / $answersTODAY </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>DL DIFF:</B></TD><TD ALIGN=LEFT><font size=2> $diffONEMIN </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>ESITI:</B></TD><TD ALIGN=LEFT><font size=2> $DIALstatuses </TD>";
|
||||
echo "</TR>";
|
||||
|
||||
echo "<TR>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>CONTATTI IN CODA:</B></TD><TD ALIGN=LEFT><font size=2> $VDhop </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>PERCENT ABBATTIMENTO:</B></TD><TD ALIGN=LEFT><font size=2> ";
|
||||
if ($drpctTODAY >= $DROPmax)
|
||||
{echo "<font color=red><B>$drpctTODAY%</B></font>";}
|
||||
else
|
||||
{echo "$drpctTODAY%";}
|
||||
echo " </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>DIFF:</B></TD><TD ALIGN=LEFT><font size=2> $diffpctONEMIN% </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>ORDINE:</B></TD><TD ALIGN=LEFT><font size=2> $DIALorder </TD>";
|
||||
echo "</TR>";
|
||||
|
||||
echo "<TR>";
|
||||
echo "<TD ALIGN=LEFT COLSPAN=8>";
|
||||
if ( (!eregi('NULL',$VSCcat1)) and (strlen($VSCcat1)>0) )
|
||||
{echo "<font size=2><B>$VSCcat1:</B> $VSCcat1tally \n";}
|
||||
if ( (!eregi('NULL',$VSCcat2)) and (strlen($VSCcat2)>0) )
|
||||
{echo "<font size=2><B>$VSCcat2:</B> $VSCcat2tally \n";}
|
||||
if ( (!eregi('NULL',$VSCcat3)) and (strlen($VSCcat3)>0) )
|
||||
{echo "<font size=2><B>$VSCcat3:</B> $VSCcat3tally \n";}
|
||||
if ( (!eregi('NULL',$VSCcat4)) and (strlen($VSCcat4)>0) )
|
||||
{echo "<font size=2><B>$VSCcat4:</B> $VSCcat4tally \n";}
|
||||
echo "</TD></TR>";
|
||||
echo "<TR>";
|
||||
echo "<TD ALIGN=LEFT COLSPAN=8>";
|
||||
|
||||
### Header finish
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
################################################################################
|
||||
### START calculating calls/agents
|
||||
################################################################################
|
||||
|
||||
################################################################################
|
||||
###### OUTBOUND CALLS
|
||||
################################################################################
|
||||
if ($campaign_allow_inbound > 0)
|
||||
{
|
||||
$stmt="select closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$closer_campaigns = preg_replace("/^ | -$/","",$row[0]);
|
||||
$closer_campaigns = preg_replace("/ /","','",$closer_campaigns);
|
||||
$closer_campaigns = "'$closer_campaigns'";
|
||||
|
||||
$stmt="select status from vicidial_auto_calls where status NOT IN('XFER') and ( (call_type='IN' and campaign_id IN($closer_campaigns)) or (campaign_id='" . mysql_real_escape_string($group) . "' and call_type='OUT') );";
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($group=='XXXX-ALL-ACTIVE-XXXX') {$groupSQL = '';}
|
||||
else {$groupSQL = " and campaign_id='" . mysql_real_escape_string($group) . "'";}
|
||||
|
||||
$stmt="select status from vicidial_auto_calls where status NOT IN('XFER') $groupSQL;";
|
||||
}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$parked_to_print = mysql_num_rows($rslt);
|
||||
if ($parked_to_print > 0)
|
||||
{
|
||||
$i=0;
|
||||
$out_total=0;
|
||||
$out_ring=0;
|
||||
$out_live=0;
|
||||
$in_ivr=0;
|
||||
while ($i < $parked_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
if (eregi("LIVE",$row[0]))
|
||||
{$out_live++;}
|
||||
else
|
||||
{
|
||||
if (eregi("IVR",$row[0]))
|
||||
{$in_ivr++;}
|
||||
if (eregi("CLOSER",$row[0]))
|
||||
{$nothing=1;}
|
||||
else
|
||||
{$out_ring++;}
|
||||
}
|
||||
$out_total++;
|
||||
$i++;
|
||||
}
|
||||
|
||||
if ($out_live > 0) {$F='<FONT class="r1">'; $FG='</FONT>';}
|
||||
if ($out_live > 4) {$F='<FONT class="r2">'; $FG='</FONT>';}
|
||||
if ($out_live > 9) {$F='<FONT class="r3">'; $FG='</FONT>';}
|
||||
if ($out_live > 14) {$F='<FONT class="r4">'; $FG='</FONT>';}
|
||||
|
||||
if ($campaign_allow_inbound > 0)
|
||||
{echo "$NFB$out_total$NFE current active calls \n";}
|
||||
else
|
||||
{echo "$NFB$out_total$NFE calls being placed \n";}
|
||||
|
||||
echo "$NFB$out_ring$NFE calls ringing \n";
|
||||
echo "$NFB$F $out_live $FG$NFE calls waiting for agents \n";
|
||||
echo "$NFB $in_ivr$NFE calls in IVR \n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo " NESSUNA CHIAMATA IN ATTESA\n";
|
||||
}
|
||||
|
||||
|
||||
###################################################################################
|
||||
###### TIME ON SYSTEM
|
||||
###################################################################################
|
||||
|
||||
$agent_incall=0;
|
||||
$agent_ready=0;
|
||||
$agent_paused=0;
|
||||
$agent_total=0;
|
||||
|
||||
$stmt="select extension,user,conf_exten,status,server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,campaign_id from vicidial_live_agents where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$talking_to_print = mysql_num_rows($rslt);
|
||||
if ($talking_to_print > 0)
|
||||
{
|
||||
$i=0;
|
||||
$agentcount=0;
|
||||
while ($i < $talking_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if (eregi("READY|PAUSED",$row[3]))
|
||||
{
|
||||
$row[5]=$row[6];
|
||||
}
|
||||
$Lstatus = $row[3];
|
||||
$status = sprintf("%-6s", $row[3]);
|
||||
if (!eregi("INCALL|QUEUE",$row[3]))
|
||||
{$call_time_S = ($STARTtime - $row[6]);}
|
||||
else
|
||||
{$call_time_S = ($STARTtime - $row[5]);}
|
||||
|
||||
$call_time_M = ($call_time_S / 60);
|
||||
$call_time_M = round($call_time_M, 2);
|
||||
$call_time_M_int = intval("$call_time_M");
|
||||
$call_time_SEC = ($call_time_M - $call_time_M_int);
|
||||
$call_time_SEC = ($call_time_SEC * 60);
|
||||
$call_time_SEC = round($call_time_SEC, 0);
|
||||
if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
|
||||
$call_time_MS = "$call_time_M_int:$call_time_SEC";
|
||||
$call_time_MS = sprintf("%7s", $call_time_MS);
|
||||
$G = ''; $EG = '';
|
||||
if (eregi("PAUSED",$row[3]))
|
||||
{
|
||||
if ($call_time_M_int >= 30)
|
||||
{$i++; continue;}
|
||||
else
|
||||
{
|
||||
$agent_paused++; $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++;}
|
||||
$agentcount++;
|
||||
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
if ($agent_ready > 0) {$B='<FONT class="b1">'; $BG='</FONT>';}
|
||||
if ($agent_ready > 4) {$B='<FONT class="b2">'; $BG='</FONT>';}
|
||||
if ($agent_ready > 9) {$B='<FONT class="b3">'; $BG='</FONT>';}
|
||||
if ($agent_ready > 14) {$B='<FONT class="b4">'; $BG='</FONT>';}
|
||||
|
||||
echo "\n<BR>\n";
|
||||
|
||||
echo "$NFB$agent_total$NFE agents logged in \n";
|
||||
echo "$NFB$agent_incall$NFE agents in calls \n";
|
||||
echo "$NFB$B $agent_ready $BG$NFE agents waiting \n";
|
||||
echo "$NFB$agent_paused$NFE paused agents \n";
|
||||
|
||||
echo "<PRE><FONT SIZE=2>";
|
||||
echo "";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo " NESSUN OPERATORE AL TELEFONO<BR>\n";
|
||||
}
|
||||
|
||||
################################################################################
|
||||
### END calculating calls/agents
|
||||
################################################################################
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
echo "</TD>";
|
||||
echo "</TR>";
|
||||
echo "</TABLE>";
|
||||
|
||||
echo "</FORM>\n\n";
|
||||
$k++;
|
||||
}
|
||||
|
||||
?>
|
||||
</PRE>
|
||||
|
||||
</BODY></HTML>
|
||||
@@ -845,6 +845,14 @@ if (isset($_GET["delete_inbound_dids"])) {$delete_inbound_dids=$_GET["delete_i
|
||||
elseif (isset($_POST["delete_inbound_dids"])) {$delete_inbound_dids=$_POST["delete_inbound_dids"];}
|
||||
if (isset($_GET["three_way_call_cid"])) {$three_way_call_cid=$_GET["three_way_call_cid"];}
|
||||
elseif (isset($_POST["three_way_call_cid"])) {$three_way_call_cid=$_POST["three_way_call_cid"];}
|
||||
if (isset($_GET["three_way_dial_prefix"])) {$three_way_dial_prefix=$_GET["three_way_dial_prefix"];}
|
||||
elseif (isset($_POST["three_way_dial_prefix"])) {$three_way_dial_prefix=$_POST["three_way_dial_prefix"];}
|
||||
if (isset($_GET["forced_timeclock_login"])) {$forced_timeclock_login=$_GET["forced_timeclock_login"];}
|
||||
elseif (isset($_POST["forced_timeclock_login"])) {$forced_timeclock_login=$_POST["forced_timeclock_login"];}
|
||||
if (isset($_GET["answer_sec_pct_rt_stat_one"])) {$answer_sec_pct_rt_stat_one=$_GET["answer_sec_pct_rt_stat_one"];}
|
||||
elseif (isset($_POST["answer_sec_pct_rt_stat_one"])) {$answer_sec_pct_rt_stat_one=$_POST["answer_sec_pct_rt_stat_one"];}
|
||||
if (isset($_GET["answer_sec_pct_rt_stat_two"])) {$answer_sec_pct_rt_stat_two=$_GET["answer_sec_pct_rt_stat_two"];}
|
||||
elseif (isset($_POST["answer_sec_pct_rt_stat_two"])) {$answer_sec_pct_rt_stat_two=$_POST["answer_sec_pct_rt_stat_two"];}
|
||||
|
||||
|
||||
if (isset($script_id)) {$script_id= strtoupper($script_id);}
|
||||
@@ -1015,6 +1023,8 @@ $did_id = ereg_replace("[^0-9]","",$did_id);
|
||||
$source_did = ereg_replace("[^0-9]","",$source_did);
|
||||
$modify_inbound_dids = ereg_replace("[^0-9]","",$modify_inbound_dids);
|
||||
$delete_inbound_dids = ereg_replace("[^0-9]","",$delete_inbound_dids);
|
||||
$answer_sec_pct_rt_stat_one = ereg_replace("[^0-9]","",$answer_sec_pct_rt_stat_one);
|
||||
$answer_sec_pct_rt_stat_two = ereg_replace("[^0-9]","",$answer_sec_pct_rt_stat_two);
|
||||
|
||||
### DIGITS and COLONS
|
||||
$shift_length = ereg_replace("[^\:0-9]","",$shift_length);
|
||||
@@ -1047,7 +1057,6 @@ $available_only_ratio_tally = ereg_replace("[^NY]","",$available_only_ratio_tall
|
||||
$sys_perf_log = ereg_replace("[^NY]","",$sys_perf_log);
|
||||
$vicidial_balance_active = ereg_replace("[^NY]","",$vicidial_balance_active);
|
||||
$vd_server_logs = ereg_replace("[^NY]","",$vd_server_logs);
|
||||
$agent_pause_codes_active = ereg_replace("[^NY]","",$agent_pause_codes_active);
|
||||
$campaign_stats_refresh = ereg_replace("[^NY]","",$campaign_stats_refresh);
|
||||
$disable_alter_custdata = ereg_replace("[^NY]","",$disable_alter_custdata);
|
||||
$no_hopper_leads_logins = ereg_replace("[^NY]","",$no_hopper_leads_logins);
|
||||
@@ -1093,6 +1102,8 @@ $code = ereg_replace("[^0-9a-zA-Z]","",$code);
|
||||
$survey_no_response_action = ereg_replace("[^0-9a-zA-Z]","",$survey_no_response_action);
|
||||
$survey_ni_status = ereg_replace("[^0-9a-zA-Z]","",$survey_ni_status);
|
||||
$qc_get_record_launch = ereg_replace("[^0-9a-zA-Z]","",$qc_get_record_launch);
|
||||
$agent_pause_codes_active = ereg_replace("[^0-9a-zA-Z]","",$agent_pause_codes_active);
|
||||
$three_way_dial_prefix = ereg_replace("[^0-9a-zA-Z]","",$three_way_dial_prefix);
|
||||
|
||||
### DIGITS and Dots
|
||||
$server_ip = ereg_replace("[^\.0-9]","",$server_ip);
|
||||
@@ -1208,6 +1219,7 @@ $three_way_call_cid = ereg_replace("[^-\_0-9a-zA-Z]","",$three_way_call_cid);
|
||||
|
||||
### ALPHA-NUMERIC and underscore and dash and comma
|
||||
$logins_list = ereg_replace("[^-\,\_0-9a-zA-Z]","",$logins_list);
|
||||
$forced_timeclock_login = ereg_replace("[^-\,\_0-9a-zA-Z]","",$forced_timeclock_login);
|
||||
|
||||
### ALPHA-NUMERIC and spaces
|
||||
$lead_order = ereg_replace("[^ 0-9a-zA-Z]","",$lead_order);
|
||||
@@ -1459,11 +1471,15 @@ $survey_camp_record_dir = ereg_replace(";","",$survey_camp_record_dir);
|
||||
# 81002-1101 - Added more in-group options and new DID section and user options
|
||||
# 81007-0936 - Added three_way_call_cid option to campaigns
|
||||
# 81012-1725 - Added INBOUND_MAN dial method allowing for manual list dialing with inbound calls
|
||||
# 81030-0348 - Added campaign pause code force option
|
||||
# 81030-2228 - Fixed DIDs creation issue
|
||||
# 81103-1408 - Added 3way call dial prefix option
|
||||
# 81107-1551 - Added Stats Percent of Calls Answered Within X seconds fields to in-groups
|
||||
#
|
||||
# make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time
|
||||
|
||||
$admin_version = '2.0.5-145';
|
||||
$build = '81012-1725';
|
||||
$admin_version = '2.0.5-149';
|
||||
$build = '81107-1551';
|
||||
|
||||
$STARTtime = date("U");
|
||||
$SQLdate = date("Y-m-d H:i:s");
|
||||
@@ -2867,7 +2883,7 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN
|
||||
<BR>
|
||||
<A NAME="vicidial_campaigns-agent_pause_codes_active">
|
||||
<BR>
|
||||
<B>La pausa del agente cifra activo -</B> permite que los agentes seleccionenun co`digo de la pausa cuando chascan encendido el boton de PAUSA envicidial.php. Los co`digos de la pausa son definibles por campaña enel fondo de la pantalla del detalle de la opinio`n de la campaña y sealmacenan en la tabla del vicidial_agent_log. El defecto es N.
|
||||
<B>La pausa del agente cifra activo -</B> permite que los agentes seleccionenun co`digo de la pausa cuando chascan encendido el boton de PAUSA envicidial.php. Los co`digos de la pausa son definibles por campaña enel fondo de la pantalla del detalle de la opinio`n de la campaña y sealmacenan en la tabla del vicidial_agent_log. El defecto es N. FORCE will force the agents to choose a PAUSE code if they click on the PAUSE button.
|
||||
|
||||
<BR>
|
||||
<A NAME="vicidial_campaigns-disable_alter_custdata">
|
||||
@@ -2939,6 +2955,11 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN
|
||||
<BR>
|
||||
<B>3-Way Call CallerID De salida -</B> This defines what is sent out as the outbound callerID number from 3-way calls placed by the agent, CAMPAIGN uses the custom campaign callerID, CUSTOMER uses the number of the customer that is active on the agents screen and AGENT_PHONE uses the callerID for the phone that the agent is logged into.
|
||||
|
||||
<BR>
|
||||
<A NAME="vicidial_campaigns-three_way_dial_prefix">
|
||||
<BR>
|
||||
<B>3-Way Call Prefisso Chiamata -</B> This defines what is used as the dial prefix for 3-way calls, default is empty so the campaign dial prefix is used, passthru so you can hear ringing is 88.
|
||||
|
||||
<BR>
|
||||
<A NAME="vicidial_campaigns-qc_enabled">
|
||||
<BR>
|
||||
@@ -3344,6 +3365,11 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN
|
||||
<BR>
|
||||
<B>No Delay Call Route -</B> Setting this to Y will remove all wait times and audio prompts and attempt to send the call right to an agent. Does not override welcome message or on hold prompt settings. Default is N.
|
||||
|
||||
<BR>
|
||||
<A NAME="vicidial_inbound_groups-answer_sec_pct_rt_stat_one">
|
||||
<BR>
|
||||
<B>Stats Percent of Calls Answered Within X seconds -</B> This field allows you to set the number of hold seconds that the realtime stats display will use to calculate the percentage of answered calls that were answered within X number of seconds on hold.
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -3554,6 +3580,11 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN
|
||||
<BR>
|
||||
<B>Nombre de grupo -</B> esta es la descripcio`n del máximo vicidial del grupo de usuario de 40 caracteres.
|
||||
|
||||
<BR>
|
||||
<A NAME="vicidial_user_groups-forced_timeclock_login">
|
||||
<BR>
|
||||
<B>Force Timeclock Login -</B> This option allows you to not let an agent log in to the VICIDIAL agent interface if they have not logged into the timeclock. Default is N. There is an option to exempt admin users, levels 8 and 9.
|
||||
|
||||
<BR>
|
||||
<A NAME="vicidial_user_groups-group_shifts">
|
||||
<BR>
|
||||
@@ -6252,7 +6283,7 @@ if ($ADD==20)
|
||||
{
|
||||
echo "<br><B>CAMPAIGN COPIED: $campaign_id copied from $source_campaign_id</B>\n";
|
||||
|
||||
$stmt="INSERT INTO vicidial_campaigns (campaign_name,campaign_id,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid) SELECT \"$campaign_name\",\"$campaign_id\",\"N\",dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,\"DISABLED\",campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid from vicidial_campaigns where campaign_id='$source_campaign_id';";
|
||||
$stmt="INSERT INTO vicidial_campaigns (campaign_name,campaign_id,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix) SELECT \"$campaign_name\",\"$campaign_id\",\"N\",dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,\"DISABLED\",campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix from vicidial_campaigns where campaign_id='$source_campaign_id';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
$stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$campaign_id');";
|
||||
@@ -6672,7 +6703,7 @@ if ($ADD==2011)
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="INSERT INTO vicidial_inbound_groups (group_id,group_name,group_color,active,web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,drop_call_seconds,drop_action,drop_exten,call_time_id,after_hours_action,after_hours_message_filename,after_hours_exten,after_hours_voicemail,welcome_message_filename,moh_context,onhold_prompt_filename,prompt_interval,agent_alert_exten,agent_alert_delay,default_xfer_group,queue_priority,drop_inbound_group,ingroup_recording_override,ingroup_rec_filename,afterhours_xfer_group,qc_enabled,qc_statuses,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,play_place_in_line,play_estimate_hold_time,hold_time_option,hold_time_option_seconds,hold_time_option_exten,hold_time_option_voicemail,hold_time_option_xfer_group,hold_time_option_callback_filename,hold_time_option_callback_list_id,hold_recall_xfer_group,no_delay_call_route,play_welcome_message) SELECT \"$group_id\",\"$group_name\",group_color,\"N\",web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,drop_call_seconds,drop_action,drop_exten,call_time_id,after_hours_action,after_hours_message_filename,after_hours_exten,after_hours_voicemail,welcome_message_filename,moh_context,onhold_prompt_filename,prompt_interval,agent_alert_exten,agent_alert_delay,default_xfer_group,queue_priority,drop_inbound_group,ingroup_recording_override,ingroup_rec_filename,afterhours_xfer_group,qc_enabled,qc_statuses,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,play_place_in_line,play_estimate_hold_time,hold_time_option,hold_time_option_seconds,hold_time_option_exten,hold_time_option_voicemail,hold_time_option_xfer_group,hold_time_option_callback_filename,hold_time_option_callback_list_id,hold_recall_xfer_group,no_delay_call_route,play_welcome_message from vicidial_inbound_groups where group_id=\"$source_group_id\";";
|
||||
$stmt="INSERT INTO vicidial_inbound_groups (group_id,group_name,group_color,active,web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,drop_call_seconds,drop_action,drop_exten,call_time_id,after_hours_action,after_hours_message_filename,after_hours_exten,after_hours_voicemail,welcome_message_filename,moh_context,onhold_prompt_filename,prompt_interval,agent_alert_exten,agent_alert_delay,default_xfer_group,queue_priority,drop_inbound_group,ingroup_recording_override,ingroup_rec_filename,afterhours_xfer_group,qc_enabled,qc_statuses,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,play_place_in_line,play_estimate_hold_time,hold_time_option,hold_time_option_seconds,hold_time_option_exten,hold_time_option_voicemail,hold_time_option_xfer_group,hold_time_option_callback_filename,hold_time_option_callback_list_id,hold_recall_xfer_group,no_delay_call_route,play_welcome_message,answer_sec_pct_rt_stat_one,answer_sec_pct_rt_stat_two) SELECT \"$group_id\",\"$group_name\",group_color,\"N\",web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,drop_call_seconds,drop_action,drop_exten,call_time_id,after_hours_action,after_hours_message_filename,after_hours_exten,after_hours_voicemail,welcome_message_filename,moh_context,onhold_prompt_filename,prompt_interval,agent_alert_exten,agent_alert_delay,default_xfer_group,queue_priority,drop_inbound_group,ingroup_recording_override,ingroup_rec_filename,afterhours_xfer_group,qc_enabled,qc_statuses,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,play_place_in_line,play_estimate_hold_time,hold_time_option,hold_time_option_seconds,hold_time_option_exten,hold_time_option_voicemail,hold_time_option_xfer_group,hold_time_option_callback_filename,hold_time_option_callback_list_id,hold_recall_xfer_group,no_delay_call_route,play_welcome_message,answer_sec_pct_rt_stat_one,answer_sec_pct_rt_stat_two from vicidial_inbound_groups where group_id=\"$source_group_id\";";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
echo "<br><B>GRUPPO AGGIUNTO: $group_id</B>\n";
|
||||
@@ -6697,7 +6728,7 @@ $ADD=3111;
|
||||
if ($ADD==2311)
|
||||
{
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
$stmt="SELECT count(*) from vicidial_inbound_dids where did_id='$did_id';";
|
||||
$stmt="SELECT count(*) from vicidial_inbound_dids where did_pattern='$did_pattern';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ($row[0] > 0)
|
||||
@@ -6711,7 +6742,7 @@ if ($ADD==2311)
|
||||
{echo "<br>DID NOT ADDED - there is already a DID in the system with this extension\n";}
|
||||
else
|
||||
{
|
||||
if ( (strlen($source_did) < 1) or (strlen($did_pattern) < 1) or (eregi(' ',$source_did)) or (eregi(' ',$did_pattern)) or (eregi("\+",$source_did)) )
|
||||
if ( (strlen($did_pattern) < 2) or (eregi(' ',$did_pattern)) or (eregi('-',$did_pattern)) or (eregi("\+",$did_pattern)) )
|
||||
{
|
||||
echo "<br>DID NOT ADDED - Per favore torna indietro e ricontrolla i dati inseriti\n";
|
||||
echo "<br>DID Extension must be between 2 and 20 characters in length and contain no ' -+'.\n";
|
||||
@@ -6756,7 +6787,7 @@ if ($ADD==2411)
|
||||
{echo "<br>DID NOT ADDED - there is already a DID in the system with this extension\n";}
|
||||
else
|
||||
{
|
||||
if ( (strlen($did_id) < 1) or (strlen($did_pattern) < 1) or (eregi(' ',$did_id)) or (eregi(' ',$did_pattern)) or (eregi("\+",$did_id)) )
|
||||
if ( (strlen($source_did) < 1) or (strlen($did_pattern) < 1) or (eregi(' ',$source_did)) or (eregi(' ',$did_pattern)) or (eregi("\+",$source_did)) )
|
||||
{
|
||||
echo "<br>DID NOT ADDED - Per favore torna indietro e ricontrolla i dati inseriti\n";
|
||||
echo "<br>DID Extension must be between 2 and 20 characters in length and contain no ' -+'.\n";
|
||||
@@ -7641,7 +7672,7 @@ if ($ADD==41)
|
||||
if ( (!ereg("DISABLED",$list_order_mix)) and ($hopper_level < 100) )
|
||||
{$hopper_level='100';}
|
||||
|
||||
$stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', $adlSQL next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number',xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns='$groups_value',use_internal_dnc='$use_internal_dnc',allcalls_delay='$allcalls_delay',omit_phone_code='$omit_phone_code',dial_method='$dial_method',available_only_ratio_tally='$available_only_ratio_tally',adaptive_dropped_percentage='$adaptive_dropped_percentage',adaptive_maximum_level='$adaptive_maximum_level',adaptive_latest_server_time='$adaptive_latest_server_time',adaptive_intensity='$adaptive_intensity',adaptive_dl_diff_target='$adaptive_dl_diff_target',concurrent_transfers='$concurrent_transfers',auto_alt_dial='$auto_alt_dial',agent_pause_codes_active='$agent_pause_codes_active',campaign_description='$campaign_description',campaign_changedate='$SQLdate',campaign_stats_refresh='$campaign_stats_refresh',disable_alter_custdata='$disable_alter_custdata',no_hopper_leads_logins='$no_hopper_leads_logins',list_order_mix='$list_order_mix',campaign_allow_inbound='$campaign_allow_inbound',manual_dial_list_id='$manual_dial_list_id',default_xfer_group='$default_xfer_group',xfer_groups='$XFERgroups_value',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',disable_alter_custphone='$disable_alter_custphone',display_queue_count='$display_queue_count',manual_dial_filter='$manual_dial_filter',agent_clipboard_copy='$agent_clipboard_copy',agent_extended_alt_dial='$agent_extended_alt_dial',use_campaign_dnc='$use_campaign_dnc',three_way_call_cid='$three_way_call_cid' where campaign_id='$campaign_id';";
|
||||
$stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', $adlSQL next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number',xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns='$groups_value',use_internal_dnc='$use_internal_dnc',allcalls_delay='$allcalls_delay',omit_phone_code='$omit_phone_code',dial_method='$dial_method',available_only_ratio_tally='$available_only_ratio_tally',adaptive_dropped_percentage='$adaptive_dropped_percentage',adaptive_maximum_level='$adaptive_maximum_level',adaptive_latest_server_time='$adaptive_latest_server_time',adaptive_intensity='$adaptive_intensity',adaptive_dl_diff_target='$adaptive_dl_diff_target',concurrent_transfers='$concurrent_transfers',auto_alt_dial='$auto_alt_dial',agent_pause_codes_active='$agent_pause_codes_active',campaign_description='$campaign_description',campaign_changedate='$SQLdate',campaign_stats_refresh='$campaign_stats_refresh',disable_alter_custdata='$disable_alter_custdata',no_hopper_leads_logins='$no_hopper_leads_logins',list_order_mix='$list_order_mix',campaign_allow_inbound='$campaign_allow_inbound',manual_dial_list_id='$manual_dial_list_id',default_xfer_group='$default_xfer_group',xfer_groups='$XFERgroups_value',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',disable_alter_custphone='$disable_alter_custphone',display_queue_count='$display_queue_count',manual_dial_filter='$manual_dial_filter',agent_clipboard_copy='$agent_clipboard_copy',agent_extended_alt_dial='$agent_extended_alt_dial',use_campaign_dnc='$use_campaign_dnc',three_way_call_cid='$three_way_call_cid',three_way_dial_prefix='$three_way_dial_prefix' where campaign_id='$campaign_id';";
|
||||
$rslt=mysql_query($stmtA, $link);
|
||||
|
||||
if ($reset_hopper == 'Y')
|
||||
@@ -8406,7 +8437,7 @@ if ($ADD==4111)
|
||||
|
||||
echo "<br><B>GRUPPO MODIFICATO: $group_id</B>\n";
|
||||
|
||||
$stmt="UPDATE vicidial_inbound_groups set group_name='$group_name', group_color='$group_color', active='$active', web_form_address='" . mysql_real_escape_string($web_form_address) . "', voicemail_ext='$voicemail_ext', next_agent_call='$next_agent_call', fronter_display='$fronter_display', ingroup_script='$script_id', get_call_launch='$get_call_launch', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',drop_exten='$drop_exten',call_time_id='$call_time_id',after_hours_action='$after_hours_action',after_hours_message_filename='$after_hours_message_filename',after_hours_exten='$after_hours_exten',after_hours_voicemail='$after_hours_voicemail',welcome_message_filename='$welcome_message_filename',moh_context='$moh_context',onhold_prompt_filename='$onhold_prompt_filename',prompt_interval='$prompt_interval',agent_alert_exten='$agent_alert_exten',agent_alert_delay='$agent_alert_delay',default_xfer_group='$default_xfer_group',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',ingroup_recording_override='$ingroup_recording_override',ingroup_rec_filename='$ingroup_rec_filename',afterhours_xfer_group='$afterhours_xfer_group',qc_enabled='$qc_enabled',qc_statuses='$QC_statuses',qc_shift_id='$qc_shift_id',qc_get_record_launch='$qc_get_record_launch',qc_show_recording='$qc_show_recording',qc_web_form_address='$qc_web_form_address',qc_script='$qc_script',play_place_in_line='$play_place_in_line',play_estimate_hold_time='$play_estimate_hold_time',hold_time_option='$hold_time_option',hold_time_option_seconds='$hold_time_option_seconds',hold_time_option_exten='$hold_time_option_exten',hold_time_option_voicemail='$hold_time_option_voicemail',hold_time_option_xfer_group='$hold_time_option_xfer_group',hold_time_option_callback_filename='$hold_time_option_callback_filename',hold_time_option_callback_list_id='$hold_time_option_callback_list_id',hold_recall_xfer_group='$hold_recall_xfer_group',no_delay_call_route='$no_delay_call_route',play_welcome_message='$play_welcome_message' where group_id='$group_id';";
|
||||
$stmt="UPDATE vicidial_inbound_groups set group_name='$group_name', group_color='$group_color', active='$active', web_form_address='" . mysql_real_escape_string($web_form_address) . "', voicemail_ext='$voicemail_ext', next_agent_call='$next_agent_call', fronter_display='$fronter_display', ingroup_script='$script_id', get_call_launch='$get_call_launch', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',drop_exten='$drop_exten',call_time_id='$call_time_id',after_hours_action='$after_hours_action',after_hours_message_filename='$after_hours_message_filename',after_hours_exten='$after_hours_exten',after_hours_voicemail='$after_hours_voicemail',welcome_message_filename='$welcome_message_filename',moh_context='$moh_context',onhold_prompt_filename='$onhold_prompt_filename',prompt_interval='$prompt_interval',agent_alert_exten='$agent_alert_exten',agent_alert_delay='$agent_alert_delay',default_xfer_group='$default_xfer_group',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',ingroup_recording_override='$ingroup_recording_override',ingroup_rec_filename='$ingroup_rec_filename',afterhours_xfer_group='$afterhours_xfer_group',qc_enabled='$qc_enabled',qc_statuses='$QC_statuses',qc_shift_id='$qc_shift_id',qc_get_record_launch='$qc_get_record_launch',qc_show_recording='$qc_show_recording',qc_web_form_address='$qc_web_form_address',qc_script='$qc_script',play_place_in_line='$play_place_in_line',play_estimate_hold_time='$play_estimate_hold_time',hold_time_option='$hold_time_option',hold_time_option_seconds='$hold_time_option_seconds',hold_time_option_exten='$hold_time_option_exten',hold_time_option_voicemail='$hold_time_option_voicemail',hold_time_option_xfer_group='$hold_time_option_xfer_group',hold_time_option_callback_filename='$hold_time_option_callback_filename',hold_time_option_callback_list_id='$hold_time_option_callback_list_id',hold_recall_xfer_group='$hold_recall_xfer_group',no_delay_call_route='$no_delay_call_route',play_welcome_message='$play_welcome_message',answer_sec_pct_rt_stat_one='$answer_sec_pct_rt_stat_one',answer_sec_pct_rt_stat_two='$answer_sec_pct_rt_stat_two' where group_id='$group_id';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
### LOG CHANGES TO LOG FILE ###
|
||||
@@ -8535,7 +8566,7 @@ if ($ADD==411111)
|
||||
$GROUP_shifts .= "$group_shifts[$p] ";
|
||||
$p++;
|
||||
}
|
||||
$stmt="UPDATE vicidial_user_groups set user_group='$user_group', group_name='$group_name',allowed_campaigns='$campaigns_value',qc_allowed_campaigns='$qc_campaigns_value',qc_allowed_inbound_groups='$qc_groups_value',group_shifts='$GROUP_shifts' where user_group='$OLDuser_group';";
|
||||
$stmt="UPDATE vicidial_user_groups set user_group='$user_group', group_name='$group_name',allowed_campaigns='$campaigns_value',qc_allowed_campaigns='$qc_campaigns_value',qc_allowed_inbound_groups='$qc_groups_value',group_shifts='$GROUP_shifts',forced_timeclock_login='$forced_timeclock_login' where user_group='$OLDuser_group';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
echo "<br><B>GRUPPO UTENTI MODIFICATO</B>\n";
|
||||
@@ -11059,6 +11090,7 @@ if ($ADD==31)
|
||||
$agent_extended_alt_dial = $row[94];
|
||||
$use_campaign_dnc = $row[95];
|
||||
$three_way_call_cid = $row[96];
|
||||
$three_way_dial_prefix = $row[97];
|
||||
|
||||
if (ereg("DISABLED",$list_order_mix))
|
||||
{$DEFlistDISABLE = ''; $DEFstatusDISABLED=0;}
|
||||
@@ -11469,7 +11501,7 @@ if ($ADD==31)
|
||||
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Use Campagna DNC List: </td><td align=left><select size=1 name=use_campaign_dnc><option>Y</option><option>N</option><option SELECTED>$use_campaign_dnc</option></select>$NWB#vicidial_campaigns-use_campaign_dnc$NWE</td></tr>\n";
|
||||
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>AgentCodici PausaAttivo: </td><td align=left><select size=1 name=agent_pause_codes_active><option>Y</option><option>N</option><option SELECTED>$agent_pause_codes_active</option></select>$NWB#vicidial_campaigns-agent_pause_codes_active$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>AgentCodici PausaAttivo: </td><td align=left><select size=1 name=agent_pause_codes_active><option>FORCE</option><option>Y</option><option>N</option><option SELECTED>$agent_pause_codes_active</option></select>$NWB#vicidial_campaigns-agent_pause_codes_active$NWE</td></tr>\n";
|
||||
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Aggiornamento Statistiche Campagna: </td><td align=left><select size=1 name=campaign_stats_refresh><option>Y</option><option>N</option><option SELECTED>$campaign_stats_refresh</option></select>$NWB#vicidial_campaigns-campaign_stats_refresh$NWE</td></tr>\n";
|
||||
|
||||
@@ -11490,6 +11522,9 @@ if ($ADD==31)
|
||||
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>3-Way Call CallerID De salida: </td><td align=left><select size=1 name=three_way_call_cid><option>CAMPAGNA</option><option>CUSTOMER</option><option>AGENT_PHONE</option><option SELECTED>$three_way_call_cid</option></select>$NWB#vicidial_campaigns-three_way_call_cid$NWE</td></tr>\n";
|
||||
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>3-Way Call Prefisso Chiamata: </td><td align=left><input type=text name=three_way_dial_prefix size=15 maxlength=20 value=\"$three_way_dial_prefix\">$NWB#vicidial_campaigns-three_way_dial_prefix$NWE</td></tr>\n";
|
||||
|
||||
|
||||
if ($campaign_allow_inbound == 'Y')
|
||||
{
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Grupos De entrada Permitidos: <BR>";
|
||||
@@ -13393,6 +13428,8 @@ if ($ADD==3111)
|
||||
$hold_recall_xfer_group = $row[50];
|
||||
$no_delay_call_route = $row[51];
|
||||
$play_welcome_message = $row[52];
|
||||
$answer_sec_pct_rt_stat_one = $row[53];
|
||||
$answer_sec_pct_rt_stat_two = $row[54];
|
||||
|
||||
##### get in-groups listings for dynamic pulldown
|
||||
$stmt="SELECT group_id,group_name from vicidial_inbound_groups where group_id NOT IN('AGENTDIRECT') order by group_id";
|
||||
@@ -13592,6 +13629,10 @@ if ($ADD==3111)
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>In-Group Recording Override: </td><td align=left><select size=1 name=ingroup_recording_override><option>DISABLED</option><option>NEVER</option><option>ONDEMAND</option><option>ALLCALLS</option><option>ALLFORCE</option><option SELECTED>$ingroup_recording_override</option></select>$NWB#vicidial_inbound_groups-ingroup_recording_override$NWE</td></tr>\n";
|
||||
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>In-Group Recording Filename: </td><td align=left><input type=text name=ingroup_rec_filename size=50 maxlength=50 value=\"$ingroup_rec_filename\">$NWB#vicidial_inbound_groups-ingroup_rec_filename$NWE</td></tr>\n";
|
||||
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Stats Percent of Calls Answered Within X seconds 1: </td><td align=left><input type=text name=answer_sec_pct_rt_stat_one size=5 maxlength=5 value=\"$answer_sec_pct_rt_stat_one\">$NWB#vicidial_inbound_groups-answer_sec_pct_rt_stat_one$NWE</td></tr>\n";
|
||||
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Stats Percent of Calls Answered Within X seconds 2: </td><td align=left><input type=text name=answer_sec_pct_rt_stat_two size=5 maxlength=5 value=\"$answer_sec_pct_rt_stat_two\">$NWB#vicidial_inbound_groups-answer_sec_pct_rt_stat_one$NWE</td></tr>\n";
|
||||
|
||||
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=INVIA value=INVIA></td></tr>\n";
|
||||
|
||||
@@ -13727,7 +13768,7 @@ if ($ADD==3111)
|
||||
|
||||
echo "</table></center><br>\n";
|
||||
|
||||
echo "<a href=\"./AST_CLOSERstats.php?group=$group_id\">Clicca qui per visualizzare un report per questo gruppo inbound</a><BR><BR>\n";
|
||||
echo "<a href=\"./AST_CLOSERstats.php?group[]=$group_id\">Clicca qui per visualizzare un report per questo gruppo inbound</a><BR><BR>\n";
|
||||
|
||||
echo "<center><b>\n";
|
||||
|
||||
@@ -13969,9 +14010,10 @@ if ($ADD==311111)
|
||||
$stmt="SELECT * from vicidial_user_groups where user_group='$user_group';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$user_group = $row[0];
|
||||
$group_name = $row[1];
|
||||
$GROUP_shifts = $row[5];
|
||||
$user_group = $row[0];
|
||||
$group_name = $row[1];
|
||||
$GROUP_shifts = $row[5];
|
||||
$forced_timeclock_login = $row[6];
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
|
||||
echo "<br>MODIFICA UN GRUPPO UTENTI<form action=$PHP_SELF method=POST>\n";
|
||||
@@ -13980,6 +14022,9 @@ if ($ADD==311111)
|
||||
echo "<center><TABLE width=$section_width cellspacing=3>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Gruppo: </td><td align=left><input type=text name=user_group size=15 maxlength=20 value=\"$user_group\"> (senza spazi e punteggiatura)$NWB#vicidial_user_groups-user_group$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Descrizione: </td><td align=left><input type=text name=group_name size=40 maxlength=40 value=\"$group_name\"> (Descrizione del gruppo)$NWB#vicidial_user_groups-group_name$NWE</td></tr>\n";
|
||||
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Force Timeclock Login: </td><td align=left><select size=1 name=forced_timeclock_login><option SELECTED>N</option><option>Y</option><option>ADMIN_EXEMPT</option><option SELECTED>$forced_timeclock_login</option></select>$NWB#vicidial_user_groups-forced_timeclock_login$NWE</td></tr>\n";
|
||||
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Campagne Permesse: <BR>$NWB#vicidial_user_groups-allowed_campaigns$NWE</td><td align=left>\n";
|
||||
echo "$campaigns_list <BR> ";
|
||||
echo "</td></tr>\n";
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
<?
|
||||
# welcome.php - VICIDIAL welcome page
|
||||
#
|
||||
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
|
||||
echo "<title>VICIDIAL Benvenuto</title>\n";
|
||||
echo "</head>\n";
|
||||
echo "<BODY BGCOLOR=WHITE MARGINHEIGHT=0 MARGINWIDTH=0>\n";
|
||||
echo "<BR><BR><BR><BR><BR><CENTER><TABLE WIDTH=300 CELLPADDING=0 CELLSPACING=0 BGCOLOR=\"#E0C2D6\"><TR BGCOLOR=WHITE>";
|
||||
echo "<TD ALIGN=LEFT VALIGN=BOTTOM><IMG SRC=\"../agc/images/vdc_tab_vicidial.gif\" Border=0></TD>";
|
||||
echo "<TD ALIGN=CENTER VALIGN=MIDDLE> Benvenuti </TD>";
|
||||
echo "</TR>\n";
|
||||
echo "<TR><TD ALIGN=CENTER COLSPAN=2><font size=1> </TD></TR>\n";
|
||||
echo "<TR><TD ALIGN=CENTER COLSPAN=2><font size=3><b> <a href=\"../agc/vicidial.php\">Agent Login</a> </TD></TR>\n";
|
||||
echo "<TR><TD ALIGN=CENTER COLSPAN=2><font size=1> </TD></TR>\n";
|
||||
echo "<TR><TD ALIGN=CENTER COLSPAN=2><font size=3><b> <a href=\"../agc/timeclock.php?referrer=welcome\"> Timeclock</a> </TD></TR>\n";
|
||||
echo "<TR><TD ALIGN=CENTER COLSPAN=2><font size=1> </TD></TR>\n";
|
||||
echo "<TR><TD ALIGN=CENTER COLSPAN=2><font size=3><b> <a href=\"../vicidial/admin.php\">Administration</a> </TD></TR>\n";
|
||||
echo "<TR><TD ALIGN=CENTER COLSPAN=2><font size=1> </TD></TR>\n";
|
||||
echo "</TABLE>\n";
|
||||
echo "</FORM>\n\n";
|
||||
echo "</body>\n\n";
|
||||
echo "</html>\n\n";
|
||||
|
||||
?>
|
||||
@@ -213,6 +213,10 @@ NOTE: Upgrading from 1.1.12-3 to 2.0.1 is at the bottom
|
||||
47. Added full MySQL error logging to vicidial agent web interface. Logs are
|
||||
written to the webserver.
|
||||
|
||||
48. Added new inbound-only reporting to Real-time report as well as many new
|
||||
features to existing inbound report. Created IVR stats report to show stats
|
||||
on Asterisk IVRs
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+141
-52
@@ -26,6 +26,7 @@
|
||||
# 71029-1906 - Changed CLOSER-type campaign_id restriction
|
||||
# 81021-2201 - Deactivated queue_log QUEUESTART event
|
||||
# 81022-0713 - Added gathering of vicidial_inbound_groups stats(day only)
|
||||
# 81108-0808 - Added more inbound stats with some debug output and added campaign agent non-pause time
|
||||
#
|
||||
|
||||
# constants
|
||||
@@ -510,57 +511,17 @@ foreach(@campaign_id)
|
||||
$i++;
|
||||
}
|
||||
|
||||
if ( ($stat_count =~ /00$|50$/) || ($stat_count==1) )
|
||||
{
|
||||
&launch_inbound_gather;
|
||||
}
|
||||
|
||||
if ($RESETdiff_ratio_updater>0) {$RESETdiff_ratio_updater=0; $diff_ratio_updater=0;}
|
||||
if ($RESETdrop_count_updater>0) {$RESETdrop_count_updater=0; $drop_count_updater=0;}
|
||||
$diff_ratio_updater = ($diff_ratio_updater + $CLIdelay);
|
||||
$drop_count_updater = ($drop_count_updater + $CLIdelay);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
################################################################################
|
||||
#### BEGIN gather stats for inbound groups for the real-time display
|
||||
################################################################################
|
||||
$stmtA = "SELECT group_id from vicidial_inbound_groups where active='Y';";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
$ibg_count=0;
|
||||
while ($sthArows > $ibg_count)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$group_id[$ibg_count] = $aryA[0];
|
||||
$ibg_count++;
|
||||
}
|
||||
$sthA->finish();
|
||||
if ($DB) {print "$now_date INBOUND GROUPS TO GET STATS FOR: $ibg_count|$#group_id IT: $master_loop\n";}
|
||||
|
||||
|
||||
##### LOOP THROUGH EACH INBOUND GROUP AND GATHER STATS #####
|
||||
$p=0;
|
||||
foreach(@group_id)
|
||||
{
|
||||
&calculate_drops_inbound;
|
||||
|
||||
$p++;
|
||||
}
|
||||
|
||||
################################################################################
|
||||
#### END gather stats for inbound groups for the real-time display
|
||||
################################################################################
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
sleep($CLIdelay);
|
||||
|
||||
$stat_count++;
|
||||
@@ -764,6 +725,9 @@ if ($DB) {print " $event_string\n";}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
sub calculate_drops
|
||||
{
|
||||
$camp_ANS_STAT_SQL='';
|
||||
@@ -819,6 +783,7 @@ $VCScalls_one[$i]=0;
|
||||
$VCSanswers_one[$i]=0;
|
||||
$VCSdrops_one[$i]=0;
|
||||
$VCSdrops_one_pct[$i]=0;
|
||||
$VCSagent_nonpause_time[$i]=0;
|
||||
|
||||
# LAST ONE MINUTE CALL AND DROP STATS
|
||||
$stmtA = "SELECT count(*) from $vicidial_log where campaign_id='$campaign_id[$i]' and call_date > '$VDL_one';";
|
||||
@@ -1020,14 +985,13 @@ $stmtA = "SELECT count(*) from $vicidial_log where campaign_id='$campaign_id[$i]
|
||||
$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)
|
||||
if ($sthArows > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$VCScalls_five[$i] = "$aryA[0]";
|
||||
$rec_count++;
|
||||
}
|
||||
$sthA->finish();
|
||||
|
||||
if ($VCScalls_five[$i] > 0)
|
||||
{
|
||||
# ANSWERS FIVEMINUTE
|
||||
@@ -1138,15 +1102,78 @@ while ($g < 4)
|
||||
}
|
||||
chop($VSCupdateSQL);
|
||||
|
||||
$stmtA = "UPDATE vicidial_campaign_stats SET calls_today='$VCScalls_today[$i]',answers_today='$VCSanswers_today[$i]',drops_today='$VCSdrops_today[$i]',drops_today_pct='$VCSdrops_today_pct[$i]',drops_answers_today_pct='$VCSdrops_answers_today_pct[$i]',calls_hour='$VCScalls_hour[$i]',answers_hour='$VCSanswers_hour[$i]',drops_hour='$VCSdrops_hour[$i]',drops_hour_pct='$VCSdrops_hour_pct[$i]',calls_halfhour='$VCScalls_halfhour[$i]',answers_halfhour='$VCSanswers_halfhour[$i]',drops_halfhour='$VCSdrops_halfhour[$i]',drops_halfhour_pct='$VCSdrops_halfhour_pct[$i]',calls_fivemin='$VCScalls_five[$i]',answers_fivemin='$VCSanswers_five[$i]',drops_fivemin='$VCSdrops_five[$i]',drops_fivemin_pct='$VCSdrops_five_pct[$i]',calls_onemin='$VCScalls_one[$i]',answers_onemin='$VCSanswers_one[$i]',drops_onemin='$VCSdrops_one[$i]',drops_onemin_pct='$VCSdrops_one_pct[$i]',$VSCupdateSQL where campaign_id='$campaign_id[$i]';";
|
||||
# AGENT NON-PAUSE TIME PULL
|
||||
$stmtA = "SELECT sum(wait_sec + talk_sec + dispo_sec) from vicidial_agent_log where campaign_id='$campaign_id[$i]' and event_time > '$VDL_date';";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
if ($sthArows > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
if ($aryA[0] > 0)
|
||||
{$VCSagent_nonpause_time[$i] = $aryA[0];}
|
||||
}
|
||||
$sthA->finish();
|
||||
|
||||
|
||||
$stmtA = "UPDATE vicidial_campaign_stats SET calls_today='$VCScalls_today[$i]',answers_today='$VCSanswers_today[$i]',drops_today='$VCSdrops_today[$i]',drops_today_pct='$VCSdrops_today_pct[$i]',drops_answers_today_pct='$VCSdrops_answers_today_pct[$i]',calls_hour='$VCScalls_hour[$i]',answers_hour='$VCSanswers_hour[$i]',drops_hour='$VCSdrops_hour[$i]',drops_hour_pct='$VCSdrops_hour_pct[$i]',calls_halfhour='$VCScalls_halfhour[$i]',answers_halfhour='$VCSanswers_halfhour[$i]',drops_halfhour='$VCSdrops_halfhour[$i]',drops_halfhour_pct='$VCSdrops_halfhour_pct[$i]',calls_fivemin='$VCScalls_five[$i]',answers_fivemin='$VCSanswers_five[$i]',drops_fivemin='$VCSdrops_five[$i]',drops_fivemin_pct='$VCSdrops_five_pct[$i]',calls_onemin='$VCScalls_one[$i]',answers_onemin='$VCSanswers_one[$i]',drops_onemin='$VCSdrops_one[$i]',drops_onemin_pct='$VCSdrops_one_pct[$i]',agent_non_pause_sec='$VCSagent_nonpause_time[$i]',$VSCupdateSQL where campaign_id='$campaign_id[$i]';";
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
if ($DBX) {print "$campaign_id[$i]|$stmtA|\n";}
|
||||
}
|
||||
|
||||
|
||||
|
||||
sub launch_inbound_gather
|
||||
{
|
||||
################################################################################
|
||||
#### BEGIN gather stats for inbound groups for the real-time display
|
||||
################################################################################
|
||||
$stmtA = "SELECT group_id from vicidial_inbound_groups where active='Y';";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
$ibg_count=0;
|
||||
while ($sthArows > $ibg_count)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$group_id[$ibg_count] = $aryA[0];
|
||||
$ibg_count++;
|
||||
}
|
||||
$sthA->finish();
|
||||
if ($DB) {print "$now_date INBOUND GROUPS TO GET STATS FOR: $ibg_count|$#group_id IT: $master_loop\n";}
|
||||
|
||||
|
||||
##### LOOP THROUGH EACH INBOUND GROUP AND GATHER STATS #####
|
||||
$p=0;
|
||||
foreach(@group_id)
|
||||
{
|
||||
&calculate_drops_inbound;
|
||||
|
||||
$p++;
|
||||
}
|
||||
|
||||
################################################################################
|
||||
#### END gather stats for inbound groups for the real-time display
|
||||
################################################################################
|
||||
}
|
||||
|
||||
|
||||
|
||||
sub calculate_drops_inbound
|
||||
{
|
||||
# GET inbound group hold stat seconds settings
|
||||
$stmtA = "SELECT answer_sec_pct_rt_stat_one,answer_sec_pct_rt_stat_two from vicidial_inbound_groups where group_id='$group_id[$p]';";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
if ($sthArows > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$answer_sec_pct_rt_stat_one = $aryA[0];
|
||||
$answer_sec_pct_rt_stat_two = $aryA[1];
|
||||
}
|
||||
$sthA->finish();
|
||||
|
||||
$camp_ANS_STAT_SQL='';
|
||||
# GET LIST OF HUMAN-ANSWERED STATUSES
|
||||
$stmtA = "SELECT status from vicidial_statuses where human_answered='Y';";
|
||||
@@ -1184,7 +1211,11 @@ $VCSanswers_today[$p]=0;
|
||||
$VCSdrops_today[$p]=0;
|
||||
$VCSdrops_today_pct[$p]=0;
|
||||
$VCSdrops_answers_today_pct[$p]=0;
|
||||
|
||||
$answer_sec_pct_rt_stat_one_PCT[$p]=0;
|
||||
$answer_sec_pct_rt_stat_two_PCT[$p]=0;
|
||||
$hold_sec_answer_calls[$p]=0;
|
||||
$hold_sec_drop_calls[$p]=0;
|
||||
$hold_sec_queue_calls[$p]=0;
|
||||
|
||||
# TODAY CALL AND DROP STATS
|
||||
$stmtA = "SELECT count(*) from $vicidial_closer_log where campaign_id='$group_id[$p]' and call_date > '$VDL_date';";
|
||||
@@ -1202,7 +1233,7 @@ $sthA->finish();
|
||||
if ($VCScalls_today[$p] > 0)
|
||||
{
|
||||
# TODAY ANSWERS
|
||||
$stmtA = "SELECT count(*) from $vicidial_closer_log where campaign_id='$group_id[$p]' and call_date > '$VDL_date' and status IN($camp_ANS_STAT_SQL);";
|
||||
$stmtA = "SELECT count(*) from $vicidial_closer_log where campaign_id='$group_id[$p]' and call_date > '$VDL_date' and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE');";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
@@ -1235,6 +1266,61 @@ if ($VCScalls_today[$p] > 0)
|
||||
$rec_count++;
|
||||
}
|
||||
$sthA->finish();
|
||||
|
||||
# TODAY ANSWER PERCENT OF HOLD SECONDS one and two
|
||||
$stmtA = "SELECT count(*) from $vicidial_closer_log where campaign_id='$group_id[$p]' and call_date > '$VDL_date' and queue_seconds <= $answer_sec_pct_rt_stat_one;";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
if ($sthArows > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$answer_sec_pct_rt_stat_one_PCT[$p] = $aryA[0];
|
||||
}
|
||||
$sthA->finish();
|
||||
$stmtA = "SELECT count(*) from $vicidial_closer_log where campaign_id='$group_id[$p]' and call_date > '$VDL_date' and queue_seconds <= $answer_sec_pct_rt_stat_two;";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
if ($sthArows > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$answer_sec_pct_rt_stat_two_PCT[$p] = $aryA[0];
|
||||
}
|
||||
|
||||
# TODAY TOTAL HOLD TIME FOR ANSWERED CALLS
|
||||
$stmtA = "SELECT sum(queue_seconds) from $vicidial_closer_log where campaign_id='$group_id[$p]' and call_date > '$VDL_date' and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE');";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
if ($sthArows > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
if ($aryA[0] > 0)
|
||||
{$hold_sec_answer_calls[$p] = $aryA[0];}
|
||||
}
|
||||
# TODAY TOTAL HOLD TIME FOR DROP CALLS
|
||||
$stmtA = "SELECT sum(queue_seconds) from $vicidial_closer_log where campaign_id='$group_id[$p]' and call_date > '$VDL_date' and status IN('DROP','XDROP');";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
if ($sthArows > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
if ($aryA[0] > 0)
|
||||
{$hold_sec_drop_calls[$p] = $aryA[0];}
|
||||
}
|
||||
# TODAY TOTAL QUEUE TIME FOR QUEUE CALLS
|
||||
$stmtA = "SELECT sum(queue_seconds) from $vicidial_closer_log where campaign_id='$group_id[$p]' and call_date > '$VDL_date';";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
if ($sthArows > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
if ($aryA[0] > 0)
|
||||
{$hold_sec_queue_calls[$p] = $aryA[0];}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1333,9 +1419,12 @@ if ($vcs_exists < 1)
|
||||
if ($DBX) {print "$group_id[$p]|$stmtA|\n";}
|
||||
}
|
||||
|
||||
$stmtA = "UPDATE vicidial_campaign_stats SET calls_today='$VCScalls_today[$p]',answers_today='$VCSanswers_today[$p]',drops_today='$VCSdrops_today[$p]',drops_today_pct='$VCSdrops_today_pct[$p]',drops_answers_today_pct='$VCSdrops_answers_today_pct[$p]',$VSCupdateSQL where campaign_id='$group_id[$p]';";
|
||||
$stmtA = "UPDATE vicidial_campaign_stats SET calls_today='$VCScalls_today[$p]',answers_today='$VCSanswers_today[$p]',drops_today='$VCSdrops_today[$p]',drops_today_pct='$VCSdrops_today_pct[$p]',drops_answers_today_pct='$VCSdrops_answers_today_pct[$p]',hold_sec_stat_one='$answer_sec_pct_rt_stat_one_PCT[$p]',hold_sec_stat_two='$answer_sec_pct_rt_stat_two_PCT[$p]',hold_sec_answer_calls='$hold_sec_answer_calls[$p]',hold_sec_drop_calls='$hold_sec_drop_calls[$p]',hold_sec_queue_calls='$hold_sec_queue_calls[$p]',$VSCupdateSQL where campaign_id='$group_id[$p]';";
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
if ($DBX) {print "$group_id[$p]|$stmtA|\n";}
|
||||
|
||||
print " IN-GROUP: $group_id[$p] CALLS: $VCScalls_today[$p] ANSWER: $VCSanswers_today[$p] DROPS: $VCSdrops_today[$p]\n";
|
||||
print " Stat1: $answer_sec_pct_rt_stat_one_PCT[$p] Stat2: $answer_sec_pct_rt_stat_two_PCT[$p] Hold: $hold_sec_queue_calls[$p]|$hold_sec_answer_calls[$p]|$hold_sec_drop_calls[$p]\n";
|
||||
}
|
||||
##### END calculate_drops_inbound
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ cd ../asterisk-1.2.30.2
|
||||
- File to patch: cli.c
|
||||
|
||||
*OPTIONAL*(1.2.14 thru 1.2.30.2) rewrite of waitforsilence
|
||||
wget http://www.eflo.net/files/app_waitforsilence.c
|
||||
wget http://downloads.vicidial.com/asterisk-patches/app_waitforsilence.c
|
||||
mv -f app_waitforsilence.c apps/app_waitforsilence.c
|
||||
|
||||
* REQUIRED for gcc 4.2 systems*
|
||||
|
||||
@@ -406,7 +406,7 @@ patch -p1 < ./cli_chan_concise_delimiter.patch
|
||||
wget http://downloads.vicidial.com/asterisk-patches/1.2-gsm-gcc4.2.patch
|
||||
patch -p1 ./codecs/gsm/Makefile 1.2-gsm-gcc4.2.patch
|
||||
|
||||
wget http://www.eflo.net/files/app_waitforsilence.c
|
||||
wget http://downloads.vicidial.com/asterisk-patches/app_waitforsilence.c
|
||||
mv -f app_waitforsilence.c apps/app_waitforsilence.c
|
||||
wget http://www.eflo.net/files/enter.h
|
||||
wget http://www.eflo.net/files/leave.h
|
||||
|
||||
@@ -710,7 +710,9 @@ hold_time_option_callback_filename VARCHAR(50) default 'vm-hangup',
|
||||
hold_time_option_callback_list_id BIGINT(14) UNSIGNED default '999',
|
||||
hold_recall_xfer_group VARCHAR(20) default '---NONE---',
|
||||
no_delay_call_route ENUM('Y','N') default 'N',
|
||||
play_welcome_message ENUM('ALWAYS','NEVER','IF_WAIT_ONLY','YES_UNLESS_NODELAY') default 'ALWAYS'
|
||||
play_welcome_message ENUM('ALWAYS','NEVER','IF_WAIT_ONLY','YES_UNLESS_NODELAY') default 'ALWAYS',
|
||||
answer_sec_pct_rt_stat_one SMALLINT(5) UNSIGNED default '20',
|
||||
answer_sec_pct_rt_stat_two SMALLINT(5) UNSIGNED default '30'
|
||||
);
|
||||
|
||||
CREATE TABLE vicidial_stations (
|
||||
@@ -941,7 +943,13 @@ status_category_count_2 INT(9) UNSIGNED default '0',
|
||||
status_category_3 VARCHAR(20),
|
||||
status_category_count_3 INT(9) UNSIGNED default '0',
|
||||
status_category_4 VARCHAR(20),
|
||||
status_category_count_4 INT(9) UNSIGNED default '0'
|
||||
status_category_count_4 INT(9) UNSIGNED default '0',
|
||||
hold_sec_stat_one MEDIUMINT(8) UNSIGNED default '0',
|
||||
hold_sec_stat_two MEDIUMINT(8) UNSIGNED default '0',
|
||||
agent_non_pause_sec MEDIUMINT(8) UNSIGNED default '0',
|
||||
hold_sec_answer_calls MEDIUMINT(8) UNSIGNED default '0',
|
||||
hold_sec_drop_calls MEDIUMINT(8) UNSIGNED default '0',
|
||||
hold_sec_queue_calls MEDIUMINT(8) UNSIGNED default '0'
|
||||
);
|
||||
|
||||
CREATE TABLE vicidial_dnc (
|
||||
@@ -1346,8 +1354,9 @@ CREATE INDEX date_closer on vicidial_xfer_log (call_date,closer);
|
||||
CREATE INDEX phone_number on vicidial_xfer_log (phone_number);
|
||||
CREATE INDEX phone_number on vicidial_closer_log (phone_number);
|
||||
CREATE INDEX date_user on vicidial_closer_log (call_date,user);
|
||||
CREATE INDEX comment_a on live_inbound_log (comment_a);
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1117';
|
||||
UPDATE system_settings SET db_schema_version='1118';
|
||||
|
||||
GRANT RELOAD ON *.* TO cron@'%';
|
||||
GRANT RELOAD ON *.* TO cron@localhost;
|
||||
|
||||
@@ -530,3 +530,17 @@ UPDATE system_settings SET db_schema_version='1116';
|
||||
ALTER TABLE vicidial_user_groups ADD forced_timeclock_login ENUM('Y','N','ADMIN_EXEMPT') default 'N';
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1117';
|
||||
|
||||
ALTER TABLE vicidial_inbound_groups ADD answer_sec_pct_rt_stat_one SMALLINT(5) UNSIGNED default '20';
|
||||
ALTER TABLE vicidial_inbound_groups ADD answer_sec_pct_rt_stat_two SMALLINT(5) UNSIGNED default '30';
|
||||
|
||||
ALTER TABLE vicidial_campaign_stats ADD hold_sec_stat_one MEDIUMINT(8) UNSIGNED default '0';
|
||||
ALTER TABLE vicidial_campaign_stats ADD hold_sec_stat_two MEDIUMINT(8) UNSIGNED default '0';
|
||||
ALTER TABLE vicidial_campaign_stats ADD agent_non_pause_sec MEDIUMINT(8) UNSIGNED default '0';
|
||||
ALTER TABLE vicidial_campaign_stats ADD hold_sec_answer_calls MEDIUMINT(8) UNSIGNED default '0';
|
||||
ALTER TABLE vicidial_campaign_stats ADD hold_sec_drop_calls MEDIUMINT(8) UNSIGNED default '0';
|
||||
ALTER TABLE vicidial_campaign_stats ADD hold_sec_queue_calls MEDIUMINT(8) UNSIGNED default '0';
|
||||
|
||||
CREATE INDEX comment_a on live_inbound_log (comment_a);
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1118';
|
||||
|
||||
@@ -338,6 +338,8 @@ FORCE will force the agents to choose a PAUSE code if they click on the PAUSE bu
|
||||
3-Way Call Dial Prefix||
|
||||
Force Timeclock Login -<\/B> This option allows you to not let an agent log in to the VICIDIAL agent interface if they have not logged into the timeclock. Default is N. There is an option to exempt admin users, levels 8 and 9||
|
||||
Force Timeclock Login||
|
||||
Stats Percent of Calls Answered Within X seconds -</B> This field allows you to set the number of hold seconds that the realtime stats display will use to calculate the percentage of answered calls that were answered within X number of seconds on hold||
|
||||
Stats Percent of Calls Answered Within X seconds||
|
||||
|
||||
|
||||
############################################################ CLIENT
|
||||
|
||||
@@ -271,7 +271,7 @@ if ($group_ct > 1)
|
||||
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);";
|
||||
$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 <= 49999 or length_in_sec is null);";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rowy=mysql_fetch_row($rslt);
|
||||
@@ -355,7 +355,7 @@ echo "Calls taken into the IVR for this In-Group: $IVRcalls\n";
|
||||
echo "\n";
|
||||
echo "---------- DROPS\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 IN($group_SQL) and status IN('DROP','XDROP') and (length_in_sec <= 9999 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 <= 49999 or length_in_sec is null);";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
#
|
||||
# 81026-2026 - First build
|
||||
# 81107-0341 - Added time range and option and 15-minute increment graph
|
||||
# 81107-1148 - Added average times and totals
|
||||
# 81108-0922 - Added no-callerID and unique caller counts
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -254,9 +256,14 @@ echo "VICIDIAL: IVR Stats: $group_string $NOW_TIME\n";
|
||||
|
||||
|
||||
|
||||
$TOTALcalls=0;
|
||||
$NOCALLERIDcalls=0;
|
||||
$UNIQUEcallers=0;
|
||||
$totFLOWivr_time=0;
|
||||
$totFLOWtotal_time=0;
|
||||
|
||||
##### Grab all records for the IVR for the specified time period
|
||||
$stmt="select uniqueid,extension,start_time,comment_a,comment_b,comment_d from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a IN($group_SQL) order by uniqueid,start_time;";
|
||||
$stmt="select uniqueid,extension,start_time,comment_a,comment_b,comment_d,UNIX_TIMESTAMP(start_time),phone_ext from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a IN($group_SQL) order by uniqueid,start_time;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$logs_to_print = mysql_num_rows($rslt);
|
||||
@@ -270,11 +277,15 @@ while ($p < $logs_to_print)
|
||||
$comment_a[$p] = $row[3];
|
||||
$comment_b[$p] = $row[4];
|
||||
$comment_d[$p] = $row[5];
|
||||
$epoch[$p] = $row[6];
|
||||
$phone_ext[$p] = $row[7];
|
||||
$p++;
|
||||
}
|
||||
|
||||
### create the call flow of all calls by uniqueid
|
||||
$last_uniqueid='';
|
||||
$first_epoch='';
|
||||
$last_epoch='';
|
||||
$p=0;
|
||||
$r=-1;
|
||||
while ($p < $logs_to_print)
|
||||
@@ -284,10 +295,24 @@ while ($p < $logs_to_print)
|
||||
{
|
||||
$unique_calls[$r] .= "----------$comment_b[$p]";
|
||||
if ($DB > 0) {echo " $r|$unique_calls[$r]\n";}
|
||||
$last_epoch[$r]=$epoch[$p];
|
||||
}
|
||||
else
|
||||
{
|
||||
$r++;
|
||||
$caller_id[$r]=$phone_ext[$p];
|
||||
if (strlen($phone_ext[$p])<2)
|
||||
{$NOCALLERIDcalls++;}
|
||||
else
|
||||
{
|
||||
if (!ereg("_$phone_ext[$p]_",$unique_callerIDs))
|
||||
{
|
||||
$unique_callerIDs .= "_$phone_ext[$p]_";
|
||||
$UNIQUEcallers++;
|
||||
}
|
||||
}
|
||||
$first_epoch[$r]=$epoch[$p];
|
||||
$last_epoch[$r]=$epoch[$p];
|
||||
$unique_calls[$r] = $comment_b[$p];
|
||||
$FLOWuniqueid[$r] = "$uniqueid[$p]";
|
||||
$last_uniqueid = "$uniqueid[$p]";
|
||||
@@ -336,8 +361,11 @@ while ($s <= $p)
|
||||
}
|
||||
|
||||
#### PRINT TOTAL CALLS INTO THIS IVR
|
||||
echo "\nCalls taken into this IVR: $TOTALcalls\n\n";
|
||||
|
||||
echo "\n";
|
||||
echo "Calls taken into this IVR: $TOTALcalls\n";
|
||||
echo "Calls with no CallerID: $NOCALLERIDcalls\n";
|
||||
echo "Unique Callers: $UNIQUEcallers\n";
|
||||
echo "\n";
|
||||
|
||||
### sort call flows for counting
|
||||
if ($p > 0)
|
||||
@@ -358,6 +386,9 @@ while ($s <= $p)
|
||||
if ($FLOWsummary[1] === "$RAWunique_calls[$t]")
|
||||
{
|
||||
$FLOWunique_calls_list[$s] .= "'$FLOWuniqueid[$t]',";
|
||||
if ($last_epoch[$t] <= $first_epoch[$t]) {$last_epoch[$t] = ($first_epoch[$t] + 5);}
|
||||
else {$last_epoch[$t] = ($last_epoch[$t] + 10);}
|
||||
$FLOWivr_time[$s] = ($FLOWivr_time[$s] + ($last_epoch[$t] - $first_epoch[$t]));
|
||||
}
|
||||
$t++;
|
||||
}
|
||||
@@ -369,9 +400,11 @@ while ($s <= $p)
|
||||
### put call flows and counts together for sorting again
|
||||
$s=0;
|
||||
|
||||
echo "+--------+--------+--------+--------+\n";
|
||||
echo "| IVR | QUEUE | QDROP | QDROP% | CALL PATH\n";
|
||||
echo "+--------+--------+--------+--------+------------\n";
|
||||
echo "+--------+--------+--------+--------+------+------+\n";
|
||||
echo "| | | QUEUE | QUEUE | IVR | TOTAL|\n";
|
||||
echo "| IVR | QUEUE | DROP | DROP | AVG | AVG |\n";
|
||||
echo "| CALLS | CALLS | CALLS | PERCENT| TIME | TIME | CALL PATH\n";
|
||||
echo "+--------+--------+--------+--------+------+------+------------\n";
|
||||
|
||||
while ($s <= $p)
|
||||
{
|
||||
@@ -386,7 +419,7 @@ while ($s <= $p)
|
||||
|
||||
|
||||
##### Grab all records for the IVR for the specified time period
|
||||
$stmt="select status from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and uniqueid IN($FLOWunique_calls_list[$s]);";
|
||||
$stmt="select status,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 uniqueid IN($FLOWunique_calls_list[$s]);";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$vcl_statuses_to_print = mysql_num_rows($rslt);
|
||||
@@ -395,8 +428,9 @@ while ($s <= $p)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$vcl_statuses[$w] = $row[0];
|
||||
if (ereg("DROP",$vcl_statuses[$w]))
|
||||
if ( (ereg("DROP",$vcl_statuses[$w])) or (ereg("XDROP",$vcl_statuses[$w])) )
|
||||
{$FLOWdrop[$s]++;}
|
||||
$FLOWclose_time[$s] = ($FLOWclose_time[$s] + $row[1]);
|
||||
$FLOWtotal[$s]++;
|
||||
$w++;
|
||||
}
|
||||
@@ -410,14 +444,47 @@ while ($s <= $p)
|
||||
$FLOWdrop[$s] = sprintf("%6s", $FLOWdrop[$s]);
|
||||
$FLOWdropPCT[$s] = sprintf("%6s", $FLOWdropPCT[$s]);
|
||||
$FLOWsummary[1] = ereg_replace('----------',' / ',$FLOWsummary[1]);
|
||||
$FLOWtotal_time[$s] = ($FLOWivr_time[$s] + $FLOWclose_time[$s]);
|
||||
|
||||
echo "| $FLOWsummary[0] | $FLOWtotal[$s] | $FLOWdrop[$s] | $FLOWdropPCT[$s]%| $FLOWsummary[1]\n";
|
||||
$avgFLOWivr_time[$s] = ($FLOWivr_time[$s] / $FLOWsummary[0]);
|
||||
$avgFLOWivr_time[$s] = round($avgFLOWivr_time[$s], 0);
|
||||
$avgFLOWivr_time[$s] = sprintf("%4s", $avgFLOWivr_time[$s]);
|
||||
$avgFLOWtotal_time[$s] = ($FLOWtotal_time[$s] / $FLOWsummary[0]);
|
||||
$avgFLOWtotal_time[$s] = round($avgFLOWtotal_time[$s], 0);
|
||||
$avgFLOWtotal_time[$s] = sprintf("%4s", $avgFLOWtotal_time[$s]);
|
||||
|
||||
$totFLOWtotal_time = ($totFLOWtotal_time + $FLOWtotal_time[$s]);
|
||||
$totFLOWivr_time = ($totFLOWivr_time + $FLOWivr_time[$s]);
|
||||
$totFLOWtotal = ($totFLOWtotal + $FLOWtotal[$s]);
|
||||
$totFLOWdrop = ($totFLOWdrop + $FLOWdrop[$s]);
|
||||
|
||||
echo "| $FLOWsummary[0] | $FLOWtotal[$s] | $FLOWdrop[$s] | $FLOWdropPCT[$s]%| $avgFLOWivr_time[$s] | $avgFLOWtotal_time[$s] | $FLOWsummary[1]\n";
|
||||
|
||||
$s++;
|
||||
}
|
||||
$TOTALcalls = sprintf("%6s", $TOTALcalls);
|
||||
$totFLOWtotal = sprintf("%6s", $totFLOWtotal);
|
||||
$totFLOWdrop = sprintf("%6s", $totFLOWdrop);
|
||||
if ( ($totFLOWivr_time > 0) and ($TOTALcalls > 0) )
|
||||
{$TavgFLOWivr_time = ($totFLOWivr_time / $TOTALcalls);}
|
||||
$TavgFLOWivr_time = round($TavgFLOWivr_time, 0);
|
||||
$TavgFLOWivr_time = sprintf("%4s", $TavgFLOWivr_time);
|
||||
if ( ($totFLOWtotal_time > 0) and ($TOTALcalls > 0) )
|
||||
{$TavgFLOWtotal_time = ($totFLOWtotal_time / $TOTALcalls);}
|
||||
$TavgFLOWtotal_time = round($TavgFLOWtotal_time, 0);
|
||||
$TavgFLOWtotal_time = sprintf("%4s", $TavgFLOWtotal_time);
|
||||
if ( ($totFLOWtotal < 1) or ($totFLOWdrop < 1) )
|
||||
{$totFLOWdropPCT = '0';}
|
||||
else
|
||||
{
|
||||
$totFLOWdropPCT = (($totFLOWdrop / $totFLOWtotal) * 100);
|
||||
$totFLOWdropPCT = round($totFLOWdropPCT, 0);
|
||||
}
|
||||
$totFLOWdropPCT = sprintf("%5s", $totFLOWdropPCT);
|
||||
|
||||
echo "+--------+--------+--------+--------+\n";
|
||||
|
||||
echo "+--------+--------+--------+--------+------+------+------------\n";
|
||||
echo "| $TOTALcalls | $totFLOWtotal | $totFLOWdrop | $totFLOWdropPCT% | $TavgFLOWivr_time | $TavgFLOWtotal_time |\n";
|
||||
echo "+--------+--------+--------+--------+------+------+\n";
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
# 80712-1007 - tally bug fixes and time display change
|
||||
# 81030-0346 - Added pause code stats
|
||||
# 81030-1924 - Added total non-pause and total logged-in time to pause code section
|
||||
# 81108-0716 - fixed user same-name bug
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -210,7 +211,7 @@ $usersARY[0]='';
|
||||
$user_namesARY[0]='';
|
||||
$k=0;
|
||||
|
||||
$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,sum(pause_sec),sum(wait_sec),sum(dispo_sec),status from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and campaign_id='" . mysql_real_escape_string($group) . "' and pause_sec<36000 and wait_sec<36000 and talk_sec<36000 and dispo_sec<36000 $ugSQL group by full_name,status order by full_name,status desc limit 500000;";
|
||||
$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,sum(pause_sec),sum(wait_sec),sum(dispo_sec),status from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and campaign_id='" . mysql_real_escape_string($group) . "' and pause_sec<36000 and wait_sec<36000 and talk_sec<36000 and dispo_sec<36000 $ugSQL group by user,full_name,status order by full_name,user,status desc limit 500000;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rows_to_print = mysql_num_rows($rslt);
|
||||
@@ -600,7 +601,7 @@ $PCusers='-';
|
||||
$PCusersARY=$MT;
|
||||
$PCuser_namesARY=$MT;
|
||||
$k=0;
|
||||
$stmt="select full_name,vicidial_users.user,sum(pause_sec),sub_status,sum(wait_sec + talk_sec + dispo_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and campaign_id='" . mysql_real_escape_string($group) . "' and pause_sec<36000 $ugSQL group by full_name,sub_status order by full_name,sub_status desc limit 100000;";
|
||||
$stmt="select full_name,vicidial_users.user,sum(pause_sec),sub_status,sum(wait_sec + talk_sec + dispo_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and campaign_id='" . mysql_real_escape_string($group) . "' and pause_sec<36000 $ugSQL group by user,full_name,sub_status order by user,full_name,sub_status desc limit 100000;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$subs_to_print = mysql_num_rows($rslt);
|
||||
|
||||
+400
-142
@@ -41,6 +41,7 @@
|
||||
# 81022-1500 - Added inbound call stats display option
|
||||
# 81029-1023 - Changed drop percent calculation for multi-stat reports
|
||||
# 81029-1706 - Added pause code display if enabled per campaign
|
||||
# 81108-2337 - Added inbound-only section
|
||||
#
|
||||
|
||||
header ("Content-type: text/html; charset=utf-8");
|
||||
@@ -117,7 +118,7 @@ if (!isset($PHONEdisplay)) {$PHONEdisplay=0;} # 0=no, 1=yes
|
||||
if (!isset($CUSTPHONEdisplay)) {$CUSTPHONEdisplay=0;} # 0=no, 1=yes
|
||||
if (!isset($with_inbound)) {$with_inbound='N';} # 0=no, 1=yes
|
||||
if (!isset($PAUSEcodes)) {$PAUSEcodes='N';} # 0=no, 1=yes
|
||||
|
||||
$ingroup_detail='';
|
||||
|
||||
function get_server_load($windows = false) {
|
||||
$os = strtolower(PHP_OS);
|
||||
@@ -314,9 +315,15 @@ if ($UGdisplay > 0)
|
||||
if (!eregi('XXXX-ALL-ACTIVE-XXXX', $group))
|
||||
{
|
||||
echo " Inbound: <SELECT SIZE=1 NAME=with_inbound>\n";
|
||||
echo "<option value=\"N\">No</option>\n";
|
||||
echo "<option value=\"Y\">Yes</option>\n";
|
||||
echo "<option selected>$with_inbound</option>\n";
|
||||
echo "<option value=\"N\"";
|
||||
if ($with_inbound=='N') {echo " selected";}
|
||||
echo ">No</option>\n";
|
||||
echo "<option value=\"Y\"";
|
||||
if ($with_inbound=='Y') {echo " selected";}
|
||||
echo ">Yes</option>\n";
|
||||
echo "<option value=\"O\"";
|
||||
if ($with_inbound=='O') {echo " selected";}
|
||||
echo ">Only</option>\n";
|
||||
}
|
||||
echo "<INPUT type=submit NAME=SUBMIT VALUE=SUBMIT><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> \n";
|
||||
echo "<a href=\"$PHP_SELF?group=$group&RR=4000&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound\">STOP</a> | ";
|
||||
@@ -340,89 +347,167 @@ else
|
||||
{
|
||||
$multi_drop=0;
|
||||
|
||||
if ($group=='XXXX-ALL-ACTIVE-XXXX')
|
||||
##### INBOUND ONLY ###
|
||||
if (ereg('O',$with_inbound))
|
||||
{
|
||||
$multi_drop++;
|
||||
$stmt="select avg(auto_dial_level),min(dial_status_a),min(dial_status_b),min(dial_status_c),min(dial_status_d),min(dial_status_e),min(lead_order),min(lead_filter_id),sum(hopper_level),min(dial_method),avg(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),min(available_only_ratio_tally),min(adaptive_latest_server_time),min(local_call_time),avg(dial_timeout),min(dial_statuses),max(agent_pause_codes_active) from vicidial_campaigns;";
|
||||
$stmt = "select closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$closer_campaigns = $row[0];
|
||||
$closer_campaigns = preg_replace("/^ | -$/","",$closer_campaigns);
|
||||
$closer_campaigns = preg_replace("/ /","','",$closer_campaigns);
|
||||
$closer_campaignsSQL = "'$closer_campaigns'";
|
||||
if ($DB > 0) {echo "\n|$closer_campaigns|$closer_campaignsSQL|$stmt|\n";}
|
||||
|
||||
$stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),min(status_category_1),sum(status_category_count_1),min(status_category_2),sum(status_category_count_2),min(status_category_3),sum(status_category_count_3),min(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats;";
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($DB > 0) {echo "\n|$with_inbound|$campaign_allow_inbound|\n";}
|
||||
|
||||
if ( (ereg('Y',$with_inbound)) and ($campaign_allow_inbound > 0) )
|
||||
if ($adastats>1)
|
||||
{
|
||||
$multi_drop++;
|
||||
$stmt = "select closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$stmtB="select calls_today,drops_today,answers_today,status_category_1,status_category_count_1,status_category_2,status_category_count_2,status_category_3,status_category_count_3,status_category_4,status_category_count_4,hold_sec_stat_one,hold_sec_stat_two,hold_sec_answer_calls,hold_sec_drop_calls,hold_sec_queue_calls,campaign_id from vicidial_campaign_stats where campaign_id IN ($closer_campaignsSQL);";
|
||||
|
||||
if ($DB > 0) {echo "\n|$stmtB|\n";}
|
||||
|
||||
$r=0;
|
||||
$rslt=mysql_query($stmtB, $link);
|
||||
$ingroups_to_print = mysql_num_rows($rslt);
|
||||
if ($ingroups_to_print > 0)
|
||||
{$ingroup_detail .= "<table cellpadding=0 cellspacing=0>";}
|
||||
while ($ingroups_to_print > $r)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$closer_campaigns = $row[0];
|
||||
$closer_campaigns = preg_replace("/^ | -$/","",$closer_campaigns);
|
||||
$closer_campaigns = preg_replace("/ /","','",$closer_campaigns);
|
||||
$closer_campaignsSQL = "'$closer_campaigns'";
|
||||
if ($DB > 0) {echo "\n|$closer_campaigns|$closer_campaignsSQL|$stmt|\n";}
|
||||
$callsTODAY = $row[0];
|
||||
$dropsTODAY = $row[1];
|
||||
$answersTODAY = $row[2];
|
||||
$VSCcat1 = $row[3];
|
||||
$VSCcat1tally = $row[4];
|
||||
$VSCcat2 = $row[5];
|
||||
$VSCcat2tally = $row[6];
|
||||
$VSCcat3 = $row[7];
|
||||
$VSCcat3tally = $row[8];
|
||||
$VSCcat4 = $row[9];
|
||||
$VSCcat4tally = $row[10];
|
||||
$hold_sec_stat_one = $row[11];
|
||||
$hold_sec_stat_two = $row[12];
|
||||
$hold_sec_answer_calls = $row[13];
|
||||
$hold_sec_drop_calls = $row[14];
|
||||
$hold_sec_queue_calls = $row[15];
|
||||
$ingroupdetail = $row[16];
|
||||
if ( ($dropsTODAY > 0) and ($answersTODAY > 0) )
|
||||
{
|
||||
$drpctTODAY = ( ($dropsTODAY / $answersTODAY) * 100);
|
||||
$drpctTODAY = round($drpctTODAY, 2);
|
||||
$drpctTODAY = sprintf("%01.2f", $drpctTODAY);
|
||||
}
|
||||
else
|
||||
{$drpctTODAY=0;}
|
||||
|
||||
$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses,agent_pause_codes_active from vicidial_campaigns where campaign_id IN ('" . mysql_real_escape_string($group) . "',$closer_campaignsSQL);";
|
||||
if ($callsTODAY > 0)
|
||||
{
|
||||
$AVGhold_sec_queue_calls = ($hold_sec_queue_calls / $callsTODAY);
|
||||
$AVGhold_sec_queue_calls = round($AVGhold_sec_queue_calls, 0);
|
||||
}
|
||||
else
|
||||
{$AVGhold_sec_queue_calls=0;}
|
||||
|
||||
if ($dropsTODAY > 0)
|
||||
{
|
||||
$AVGhold_sec_drop_calls = ($hold_sec_drop_calls / $dropsTODAY);
|
||||
$AVGhold_sec_drop_calls = round($AVGhold_sec_drop_calls, 0);
|
||||
}
|
||||
else
|
||||
{$AVGhold_sec_drop_calls=0;}
|
||||
|
||||
if ($answersTODAY > 0)
|
||||
{
|
||||
$PCThold_sec_stat_one = ( ($hold_sec_stat_one / $answersTODAY) * 100);
|
||||
$PCThold_sec_stat_one = round($PCThold_sec_stat_one, 2);
|
||||
$PCThold_sec_stat_one = sprintf("%01.2f", $PCThold_sec_stat_one);
|
||||
$PCThold_sec_stat_two = ( ($hold_sec_stat_two / $answersTODAY) * 100);
|
||||
$PCThold_sec_stat_two = round($PCThold_sec_stat_two, 2);
|
||||
$PCThold_sec_stat_two = sprintf("%01.2f", $PCThold_sec_stat_two);
|
||||
$AVGhold_sec_answer_calls = ($hold_sec_answer_calls / $answersTODAY);
|
||||
$AVGhold_sec_answer_calls = round($AVGhold_sec_answer_calls, 0);
|
||||
if ($agent_non_pause_sec > 0)
|
||||
{
|
||||
$AVG_ANSWERagent_non_pause_sec = ($agent_non_pause_sec / $answersTODAY);
|
||||
$AVG_ANSWERagent_non_pause_sec = round($AVG_ANSWERagent_non_pause_sec, 2);
|
||||
$AVG_ANSWERagent_non_pause_sec = sprintf("%01.2f", $AVG_ANSWERagent_non_pause_sec);
|
||||
}
|
||||
else
|
||||
{$AVG_ANSWERagent_non_pause_sec=0;}
|
||||
}
|
||||
else
|
||||
{
|
||||
$PCThold_sec_stat_one=0;
|
||||
$PCThold_sec_stat_two=0;
|
||||
$AVGhold_sec_answer_calls=0;
|
||||
$AVG_ANSWERagent_non_pause_sec=0;
|
||||
}
|
||||
|
||||
if (ereg("0$|2$|4$|6$|8$",$r)) {$bgcolor='#E6E6E6';}
|
||||
else {$bgcolor='white';}
|
||||
$ingroup_detail .= "<TR bgcolor=\"$bgcolor\">";
|
||||
$ingroup_detail .= "<TD ALIGN=RIGHT bgcolor=white><font size=2> </TD>";
|
||||
$ingroup_detail .= "<TD ALIGN=RIGHT><font size=2><B>$ingroupdetail </B></TD>";
|
||||
$ingroup_detail .= "<TD ALIGN=RIGHT><font size=2><B>CALLS TODAY:</B></TD><TD ALIGN=LEFT><font size=2> $callsTODAY </TD>";
|
||||
$ingroup_detail .= "<TD ALIGN=RIGHT><font size=2><B>TMA 1:</B></TD><TD ALIGN=LEFT><font size=2> $PCThold_sec_stat_one% </TD>";
|
||||
$ingroup_detail .= "<TD ALIGN=RIGHT><font size=2><B>Average Hold time for Answered Calls:</B></TD><TD ALIGN=LEFT><font size=2> $AVGhold_sec_answer_calls </TD>";
|
||||
$ingroup_detail .= "</TR>";
|
||||
$ingroup_detail .= "<TR bgcolor=\"$bgcolor\">";
|
||||
$ingroup_detail .= "<TD ALIGN=RIGHT bgcolor=white><font size=2></TD><TD ALIGN=LEFT><font size=2></TD>";
|
||||
$ingroup_detail .= "<TD ALIGN=RIGHT><font size=2><B>DROPS TODAY:</B></TD><TD ALIGN=LEFT><font size=2> $dropsTODAY </TD>";
|
||||
$ingroup_detail .= "<TD ALIGN=RIGHT><font size=2><B>TMA 2:</B></TD><TD ALIGN=LEFT><font size=2> $PCThold_sec_stat_two% </TD>";
|
||||
$ingroup_detail .= "<TD ALIGN=RIGHT><font size=2><B>Average Hold time for Dropped Calls:</B></TD><TD ALIGN=LEFT><font size=2> $AVGhold_sec_drop_calls </TD>";
|
||||
$ingroup_detail .= "</TR>";
|
||||
$ingroup_detail .= "<TR bgcolor=\"$bgcolor\">";
|
||||
$ingroup_detail .= "<TD ALIGN=RIGHT bgcolor=white><font size=2></TD><TD ALIGN=LEFT><font size=2></TD>";
|
||||
$ingroup_detail .= "<TD ALIGN=RIGHT><font size=2><B>ANSWERS TODAY:</B></TD><TD ALIGN=LEFT><font size=2> $answersTODAY </TD>";
|
||||
$ingroup_detail .= "<TD ALIGN=RIGHT><font size=2><B>DROP PERCENT:</B></TD><TD ALIGN=LEFT><font size=2> $drpctTODAY% </TD>";
|
||||
$ingroup_detail .= "<TD ALIGN=RIGHT><font size=2><B>Average Hold time for All Calls:</B></TD><TD ALIGN=LEFT><font size=2> $AVGhold_sec_queue_calls </TD>";
|
||||
$ingroup_detail .= "</TR>";
|
||||
|
||||
$r++;
|
||||
}
|
||||
|
||||
if ($ingroups_to_print > 0)
|
||||
{$ingroup_detail .= "</table>";}
|
||||
|
||||
$stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),min(status_category_1),sum(status_category_count_1),min(status_category_2),sum(status_category_count_2),min(status_category_3),sum(status_category_count_3),min(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats where campaign_id IN ('" . mysql_real_escape_string($group) . "',$closer_campaignsSQL);";
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses,agent_pause_codes_active from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
|
||||
$stmtB="select dialable_leads,calls_today,drops_today,drops_answers_today_pct,differential_onemin,agents_average_onemin,balance_trunk_fill,answers_today,status_category_1,status_category_count_1,status_category_2,status_category_count_2,status_category_3,status_category_count_3,status_category_4,status_category_count_4 from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
}
|
||||
}
|
||||
if ($DB > 0) {echo "\n|$stmt|$stmtB|\n";}
|
||||
$stmt="select agent_pause_codes_active from vicidial_campaigns where campaign_id IN ('" . mysql_real_escape_string($group) . "',$closer_campaignsSQL);";
|
||||
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$DIALlev = $row[0];
|
||||
$DIALstatusA = $row[1];
|
||||
$DIALstatusB = $row[2];
|
||||
$DIALstatusC = $row[3];
|
||||
$DIALstatusD = $row[4];
|
||||
$DIALstatusE = $row[5];
|
||||
$DIALorder = $row[6];
|
||||
$DIALfilter = $row[7];
|
||||
$HOPlev = $row[8];
|
||||
$DIALmethod = $row[9];
|
||||
$maxDIALlev = $row[10];
|
||||
$DROPmax = $row[11];
|
||||
$targetDIFF = $row[12];
|
||||
$ADAintense = $row[13];
|
||||
$ADAavailonly = $row[14];
|
||||
$TAPERtime = $row[15];
|
||||
$CALLtime = $row[16];
|
||||
$DIALtimeout = $row[17];
|
||||
$DIALstatuses = $row[18];
|
||||
$DIALstatuses = (preg_replace("/ -$|^ /","",$DIALstatuses));
|
||||
$DIALstatuses = (ereg_replace(' ',', ',$DIALstatuses));
|
||||
$agent_pause_codes_active = $row[19];
|
||||
$stmtB="select sum(calls_today),sum(drops_today),sum(answers_today),min(status_category_1),sum(status_category_count_1),min(status_category_2),sum(status_category_count_2),min(status_category_3),sum(status_category_count_3),min(status_category_4),sum(status_category_count_4),sum(hold_sec_stat_one),sum(hold_sec_stat_two),sum(hold_sec_answer_calls),sum(hold_sec_drop_calls),sum(hold_sec_queue_calls) from vicidial_campaign_stats where campaign_id IN ($closer_campaignsSQL);";
|
||||
|
||||
$stmtC="select agent_non_pause_sec from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
|
||||
|
||||
$stmt="select count(*) from vicidial_hopper where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
if ($group=='XXXX-ALL-ACTIVE-XXXX')
|
||||
{
|
||||
$stmt="select count(*) from vicidial_hopper;";
|
||||
}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$VDhop = $row[0];
|
||||
if ($DB > 0) {echo "\n|$stmt|$stmtB|$stmtC|\n";}
|
||||
|
||||
$rslt=mysql_query($stmtB, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$DAleads = $row[0];
|
||||
$callsTODAY = $row[1];
|
||||
$dropsTODAY = $row[2];
|
||||
$drpctTODAY = $row[3];
|
||||
$diffONEMIN = $row[4];
|
||||
$agentsONEMIN = $row[5];
|
||||
$balanceFILL = $row[6];
|
||||
$answersTODAY = $row[7];
|
||||
if ($multi_drop > 0)
|
||||
{
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$agent_pause_codes_active = $row[0];
|
||||
|
||||
$rslt=mysql_query($stmtC, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$agent_non_pause_sec = $row[0];
|
||||
|
||||
$rslt=mysql_query($stmtB, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$callsTODAY = $row[0];
|
||||
$dropsTODAY = $row[1];
|
||||
$answersTODAY = $row[2];
|
||||
$VSCcat1 = $row[3];
|
||||
$VSCcat1tally = $row[4];
|
||||
$VSCcat2 = $row[5];
|
||||
$VSCcat2tally = $row[6];
|
||||
$VSCcat3 = $row[7];
|
||||
$VSCcat3tally = $row[8];
|
||||
$VSCcat4 = $row[9];
|
||||
$VSCcat4tally = $row[10];
|
||||
$hold_sec_stat_one = $row[11];
|
||||
$hold_sec_stat_two = $row[12];
|
||||
$hold_sec_answer_calls = $row[13];
|
||||
$hold_sec_drop_calls = $row[14];
|
||||
$hold_sec_queue_calls = $row[15];
|
||||
if ( ($dropsTODAY > 0) and ($answersTODAY > 0) )
|
||||
{
|
||||
$drpctTODAY = ( ($dropsTODAY / $answersTODAY) * 100);
|
||||
@@ -431,86 +516,253 @@ if ($multi_drop > 0)
|
||||
}
|
||||
else
|
||||
{$drpctTODAY=0;}
|
||||
}
|
||||
$VSCcat1 = $row[8];
|
||||
$VSCcat1tally = $row[9];
|
||||
$VSCcat2 = $row[10];
|
||||
$VSCcat2tally = $row[11];
|
||||
$VSCcat3 = $row[12];
|
||||
$VSCcat3tally = $row[13];
|
||||
$VSCcat4 = $row[14];
|
||||
$VSCcat4tally = $row[15];
|
||||
|
||||
if ( ($diffONEMIN != 0) and ($agentsONEMIN > 0) )
|
||||
{
|
||||
$diffpctONEMIN = ( ($diffONEMIN / $agentsONEMIN) * 100);
|
||||
$diffpctONEMIN = sprintf("%01.2f", $diffpctONEMIN);
|
||||
}
|
||||
else {$diffpctONEMIN = '0.00';}
|
||||
if ($callsTODAY > 0)
|
||||
{
|
||||
$AVGhold_sec_queue_calls = ($hold_sec_queue_calls / $callsTODAY);
|
||||
$AVGhold_sec_queue_calls = round($AVGhold_sec_queue_calls, 0);
|
||||
}
|
||||
else
|
||||
{$AVGhold_sec_queue_calls=0;}
|
||||
|
||||
$stmt="select sum(local_trunk_shortage) from vicidial_campaign_server_stats where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
if ($group=='XXXX-ALL-ACTIVE-XXXX')
|
||||
{
|
||||
$stmt="select sum(local_trunk_shortage) from vicidial_campaign_server_stats;";
|
||||
}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$balanceSHORT = $row[0];
|
||||
if ($dropsTODAY > 0)
|
||||
{
|
||||
$AVGhold_sec_drop_calls = ($hold_sec_drop_calls / $dropsTODAY);
|
||||
$AVGhold_sec_drop_calls = round($AVGhold_sec_drop_calls, 0);
|
||||
}
|
||||
else
|
||||
{$AVGhold_sec_drop_calls=0;}
|
||||
|
||||
echo "<BR><table cellpadding=0 cellspacing=0><TR>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>DIAL LEVEL:</B></TD><TD ALIGN=LEFT><font size=2> $DIALlev </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>TRUNK SHORT/FILL:</B></TD><TD ALIGN=LEFT><font size=2> $balanceSHORT / $balanceFILL </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>FILTER:</B></TD><TD ALIGN=LEFT><font size=2> $DIALfilter </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B> TIME:</B> </TD><TD ALIGN=LEFT><font size=2> $NOW_TIME </TD>";
|
||||
echo "";
|
||||
echo "</TR>";
|
||||
if ($answersTODAY > 0)
|
||||
{
|
||||
$PCThold_sec_stat_one = ( ($hold_sec_stat_one / $answersTODAY) * 100);
|
||||
$PCThold_sec_stat_one = round($PCThold_sec_stat_one, 2);
|
||||
$PCThold_sec_stat_one = sprintf("%01.2f", $PCThold_sec_stat_one);
|
||||
$PCThold_sec_stat_two = ( ($hold_sec_stat_two / $answersTODAY) * 100);
|
||||
$PCThold_sec_stat_two = round($PCThold_sec_stat_two, 2);
|
||||
$PCThold_sec_stat_two = sprintf("%01.2f", $PCThold_sec_stat_two);
|
||||
$AVGhold_sec_answer_calls = ($hold_sec_answer_calls / $answersTODAY);
|
||||
$AVGhold_sec_answer_calls = round($AVGhold_sec_answer_calls, 0);
|
||||
if ($agent_non_pause_sec > 0)
|
||||
{
|
||||
$AVG_ANSWERagent_non_pause_sec = ($agent_non_pause_sec / $answersTODAY);
|
||||
$AVG_ANSWERagent_non_pause_sec = round($AVG_ANSWERagent_non_pause_sec, 2);
|
||||
$AVG_ANSWERagent_non_pause_sec = sprintf("%01.2f", $AVG_ANSWERagent_non_pause_sec);
|
||||
}
|
||||
else
|
||||
{$AVG_ANSWERagent_non_pause_sec=0;}
|
||||
}
|
||||
else
|
||||
{
|
||||
$PCThold_sec_stat_one=0;
|
||||
$PCThold_sec_stat_two=0;
|
||||
$AVGhold_sec_answer_calls=0;
|
||||
$AVG_ANSWERagent_non_pause_sec=0;
|
||||
}
|
||||
|
||||
if ($adastats>1)
|
||||
{
|
||||
echo "<TR BGCOLOR=\"#CCCCCC\">";
|
||||
echo "<TD ALIGN=RIGHT><a href=\"$PHP_SELF?group=$group&RR=4&DB=$DB&adastats=1\"><font size=1>- min </font></a><font size=2> <B>MAX LEVEL:</B></TD><TD ALIGN=LEFT><font size=2> $maxDIALlev </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>DROPPED MAX:</B></TD><TD ALIGN=LEFT><font size=2> $DROPmax% </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>TARGET DIFF:</B></TD><TD ALIGN=LEFT><font size=2> $targetDIFF </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>INTENSITY:</B></TD><TD ALIGN=LEFT><font size=2> $ADAintense </TD>";
|
||||
echo "<BR><table cellpadding=0 cellspacing=0><TR>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>CALLS TODAY:</B></TD><TD ALIGN=LEFT><font size=2> $callsTODAY </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>TMA 1:</B></TD><TD ALIGN=LEFT><font size=2> $PCThold_sec_stat_one% </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>Average Hold time for Answered Calls:</B></TD><TD ALIGN=LEFT><font size=2> $AVGhold_sec_answer_calls </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B> TIME:</B> </TD><TD ALIGN=LEFT><font size=2> $NOW_TIME </TD>";
|
||||
echo "";
|
||||
echo "</TR>";
|
||||
|
||||
echo "<TR BGCOLOR=\"#CCCCCC\">";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>DIAL TIMEOUT:</B></TD><TD ALIGN=LEFT><font size=2> $DIALtimeout </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>TAPER TIME:</B></TD><TD ALIGN=LEFT><font size=2> $TAPERtime </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>LOCAL TIME:</B></TD><TD ALIGN=LEFT><font size=2> $CALLtime </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>AVAIL ONLY:</B></TD><TD ALIGN=LEFT><font size=2> $ADAavailonly </TD>";
|
||||
echo "<TR>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>DROPS TODAY:</B></TD><TD ALIGN=LEFT><font size=2> $dropsTODAY </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>TMA 2:</B></TD><TD ALIGN=LEFT><font size=2> $PCThold_sec_stat_two% </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>Average Hold time for Dropped Calls:</B></TD><TD ALIGN=LEFT><font size=2> $AVGhold_sec_drop_calls </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2> </TD><TD ALIGN=LEFT><font size=2> </TD>";
|
||||
echo "";
|
||||
echo "</TR>";
|
||||
echo "<TR>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>ANSWERS TODAY:</B></TD><TD ALIGN=LEFT><font size=2> $answersTODAY </TD>";
|
||||
echo "<TD ALIGN=RIGHT COLSPAN=2><font size=2><B>(Agent non-pause time / Answers)</B></TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>Average Hold time for All Calls:</B></TD><TD ALIGN=LEFT><font size=2> $AVGhold_sec_queue_calls </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2> </TD><TD ALIGN=LEFT><font size=2> </TD>";
|
||||
echo "";
|
||||
echo "</TR>";
|
||||
echo "<TR>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>DROP PERCENT:</B></TD><TD ALIGN=LEFT><font size=2> $drpctTODAY% </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>PRODUCTIVITY:</B></TD><TD ALIGN=LEFT><font size=2> $AVG_ANSWERagent_non_pause_sec </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2></TD><TD ALIGN=LEFT><font size=2></TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2></TD><TD ALIGN=LEFT><font size=2></TD>";
|
||||
echo "";
|
||||
echo "</TR>";
|
||||
}
|
||||
|
||||
echo "<TR>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>DIALABLE LEADS:</B></TD><TD ALIGN=LEFT><font size=2> $DAleads </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>CALLS TODAY:</B></TD><TD ALIGN=LEFT><font size=2> $callsTODAY </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>AVG AGENTS:</B></TD><TD ALIGN=LEFT><font size=2> $agentsONEMIN </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>DIAL METHOD:</B></TD><TD ALIGN=LEFT><font size=2> $DIALmethod </TD>";
|
||||
echo "</TR>";
|
||||
|
||||
echo "<TR>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>HOPPER LEVEL:</B></TD><TD ALIGN=LEFT><font size=2> $HOPlev </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>DROPPED / ANSWERED:</B></TD><TD ALIGN=LEFT><font size=2> $dropsTODAY / $answersTODAY </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>DL DIFF:</B></TD><TD ALIGN=LEFT><font size=2> $diffONEMIN </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>STATUSES:</B></TD><TD ALIGN=LEFT><font size=2> $DIALstatuses </TD>";
|
||||
echo "</TR>";
|
||||
|
||||
echo "<TR>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>LEADS IN HOPPER:</B></TD><TD ALIGN=LEFT><font size=2> $VDhop </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>DROPPED PERCENT:</B></TD><TD ALIGN=LEFT><font size=2> ";
|
||||
if ($drpctTODAY >= $DROPmax)
|
||||
{echo "<font color=red><B>$drpctTODAY%</B></font>";}
|
||||
##### NOT INBOUND ONLY ###
|
||||
else
|
||||
{echo "$drpctTODAY%";}
|
||||
echo " </TD>";
|
||||
{
|
||||
if ($group=='XXXX-ALL-ACTIVE-XXXX')
|
||||
{
|
||||
$multi_drop++;
|
||||
$stmt="select avg(auto_dial_level),min(dial_status_a),min(dial_status_b),min(dial_status_c),min(dial_status_d),min(dial_status_e),min(lead_order),min(lead_filter_id),sum(hopper_level),min(dial_method),avg(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),min(available_only_ratio_tally),min(adaptive_latest_server_time),min(local_call_time),avg(dial_timeout),min(dial_statuses),max(agent_pause_codes_active) from vicidial_campaigns;";
|
||||
|
||||
$stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),min(status_category_1),sum(status_category_count_1),min(status_category_2),sum(status_category_count_2),min(status_category_3),sum(status_category_count_3),min(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats;";
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($DB > 0) {echo "\n|$with_inbound|$campaign_allow_inbound|\n";}
|
||||
|
||||
if ( (ereg('Y',$with_inbound)) and ($campaign_allow_inbound > 0) )
|
||||
{
|
||||
$multi_drop++;
|
||||
$stmt = "select closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$closer_campaigns = $row[0];
|
||||
$closer_campaigns = preg_replace("/^ | -$/","",$closer_campaigns);
|
||||
$closer_campaigns = preg_replace("/ /","','",$closer_campaigns);
|
||||
$closer_campaignsSQL = "'$closer_campaigns'";
|
||||
if ($DB > 0) {echo "\n|$closer_campaigns|$closer_campaignsSQL|$stmt|\n";}
|
||||
|
||||
$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses,agent_pause_codes_active from vicidial_campaigns where campaign_id IN ('" . mysql_real_escape_string($group) . "',$closer_campaignsSQL);";
|
||||
|
||||
$stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),min(status_category_1),sum(status_category_count_1),min(status_category_2),sum(status_category_count_2),min(status_category_3),sum(status_category_count_3),min(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats where campaign_id IN ('" . mysql_real_escape_string($group) . "',$closer_campaignsSQL);";
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses,agent_pause_codes_active from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
|
||||
$stmtB="select dialable_leads,calls_today,drops_today,drops_answers_today_pct,differential_onemin,agents_average_onemin,balance_trunk_fill,answers_today,status_category_1,status_category_count_1,status_category_2,status_category_count_2,status_category_3,status_category_count_3,status_category_4,status_category_count_4 from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
}
|
||||
}
|
||||
if ($DB > 0) {echo "\n|$stmt|$stmtB|\n";}
|
||||
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$DIALlev = $row[0];
|
||||
$DIALstatusA = $row[1];
|
||||
$DIALstatusB = $row[2];
|
||||
$DIALstatusC = $row[3];
|
||||
$DIALstatusD = $row[4];
|
||||
$DIALstatusE = $row[5];
|
||||
$DIALorder = $row[6];
|
||||
$DIALfilter = $row[7];
|
||||
$HOPlev = $row[8];
|
||||
$DIALmethod = $row[9];
|
||||
$maxDIALlev = $row[10];
|
||||
$DROPmax = $row[11];
|
||||
$targetDIFF = $row[12];
|
||||
$ADAintense = $row[13];
|
||||
$ADAavailonly = $row[14];
|
||||
$TAPERtime = $row[15];
|
||||
$CALLtime = $row[16];
|
||||
$DIALtimeout = $row[17];
|
||||
$DIALstatuses = $row[18];
|
||||
$DIALstatuses = (preg_replace("/ -$|^ /","",$DIALstatuses));
|
||||
$DIALstatuses = (ereg_replace(' ',', ',$DIALstatuses));
|
||||
$agent_pause_codes_active = $row[19];
|
||||
|
||||
|
||||
$stmt="select count(*) from vicidial_hopper where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
if ($group=='XXXX-ALL-ACTIVE-XXXX')
|
||||
{
|
||||
$stmt="select count(*) from vicidial_hopper;";
|
||||
}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$VDhop = $row[0];
|
||||
|
||||
$rslt=mysql_query($stmtB, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$DAleads = $row[0];
|
||||
$callsTODAY = $row[1];
|
||||
$dropsTODAY = $row[2];
|
||||
$drpctTODAY = $row[3];
|
||||
$diffONEMIN = $row[4];
|
||||
$agentsONEMIN = $row[5];
|
||||
$balanceFILL = $row[6];
|
||||
$answersTODAY = $row[7];
|
||||
if ($multi_drop > 0)
|
||||
{
|
||||
if ( ($dropsTODAY > 0) and ($answersTODAY > 0) )
|
||||
{
|
||||
$drpctTODAY = ( ($dropsTODAY / $answersTODAY) * 100);
|
||||
$drpctTODAY = round($drpctTODAY, 2);
|
||||
$drpctTODAY = sprintf("%01.2f", $drpctTODAY);
|
||||
}
|
||||
else
|
||||
{$drpctTODAY=0;}
|
||||
}
|
||||
$VSCcat1 = $row[8];
|
||||
$VSCcat1tally = $row[9];
|
||||
$VSCcat2 = $row[10];
|
||||
$VSCcat2tally = $row[11];
|
||||
$VSCcat3 = $row[12];
|
||||
$VSCcat3tally = $row[13];
|
||||
$VSCcat4 = $row[14];
|
||||
$VSCcat4tally = $row[15];
|
||||
|
||||
if ( ($diffONEMIN != 0) and ($agentsONEMIN > 0) )
|
||||
{
|
||||
$diffpctONEMIN = ( ($diffONEMIN / $agentsONEMIN) * 100);
|
||||
$diffpctONEMIN = sprintf("%01.2f", $diffpctONEMIN);
|
||||
}
|
||||
else {$diffpctONEMIN = '0.00';}
|
||||
|
||||
$stmt="select sum(local_trunk_shortage) from vicidial_campaign_server_stats where campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
if ($group=='XXXX-ALL-ACTIVE-XXXX')
|
||||
{
|
||||
$stmt="select sum(local_trunk_shortage) from vicidial_campaign_server_stats;";
|
||||
}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$balanceSHORT = $row[0];
|
||||
|
||||
echo "<BR><table cellpadding=0 cellspacing=0><TR>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>DIAL LEVEL:</B></TD><TD ALIGN=LEFT><font size=2> $DIALlev </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>TRUNK SHORT/FILL:</B></TD><TD ALIGN=LEFT><font size=2> $balanceSHORT / $balanceFILL </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>FILTER:</B></TD><TD ALIGN=LEFT><font size=2> $DIALfilter </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B> TIME:</B> </TD><TD ALIGN=LEFT><font size=2> $NOW_TIME </TD>";
|
||||
echo "";
|
||||
echo "</TR>";
|
||||
|
||||
if ($adastats>1)
|
||||
{
|
||||
echo "<TR BGCOLOR=\"#CCCCCC\">";
|
||||
echo "<TD ALIGN=RIGHT><a href=\"$PHP_SELF?group=$group&RR=4&DB=$DB&adastats=1\"><font size=1>- min </font></a><font size=2> <B>MAX LEVEL:</B></TD><TD ALIGN=LEFT><font size=2> $maxDIALlev </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>DROPPED MAX:</B></TD><TD ALIGN=LEFT><font size=2> $DROPmax% </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>TARGET DIFF:</B></TD><TD ALIGN=LEFT><font size=2> $targetDIFF </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>INTENSITY:</B></TD><TD ALIGN=LEFT><font size=2> $ADAintense </TD>";
|
||||
echo "</TR>";
|
||||
|
||||
echo "<TR BGCOLOR=\"#CCCCCC\">";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>DIAL TIMEOUT:</B></TD><TD ALIGN=LEFT><font size=2> $DIALtimeout </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>TAPER TIME:</B></TD><TD ALIGN=LEFT><font size=2> $TAPERtime </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>LOCAL TIME:</B></TD><TD ALIGN=LEFT><font size=2> $CALLtime </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>AVAIL ONLY:</B></TD><TD ALIGN=LEFT><font size=2> $ADAavailonly </TD>";
|
||||
echo "</TR>";
|
||||
}
|
||||
|
||||
echo "<TR>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>DIALABLE LEADS:</B></TD><TD ALIGN=LEFT><font size=2> $DAleads </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>CALLS TODAY:</B></TD><TD ALIGN=LEFT><font size=2> $callsTODAY </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>AVG AGENTS:</B></TD><TD ALIGN=LEFT><font size=2> $agentsONEMIN </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>DIAL METHOD:</B></TD><TD ALIGN=LEFT><font size=2> $DIALmethod </TD>";
|
||||
echo "</TR>";
|
||||
|
||||
echo "<TR>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>HOPPER LEVEL:</B></TD><TD ALIGN=LEFT><font size=2> $HOPlev </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>DROPPED / ANSWERED:</B></TD><TD ALIGN=LEFT><font size=2> $dropsTODAY / $answersTODAY </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>DL DIFF:</B></TD><TD ALIGN=LEFT><font size=2> $diffONEMIN </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>STATUSES:</B></TD><TD ALIGN=LEFT><font size=2> $DIALstatuses </TD>";
|
||||
echo "</TR>";
|
||||
|
||||
echo "<TR>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>LEADS IN HOPPER:</B></TD><TD ALIGN=LEFT><font size=2> $VDhop </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>DROPPED PERCENT:</B></TD><TD ALIGN=LEFT><font size=2> ";
|
||||
if ($drpctTODAY >= $DROPmax)
|
||||
{echo "<font color=red><B>$drpctTODAY%</B></font>";}
|
||||
else
|
||||
{echo "$drpctTODAY%";}
|
||||
echo " </TD>";
|
||||
|
||||
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>DIFF:</B></TD><TD ALIGN=LEFT><font size=2> $diffpctONEMIN% </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>ORDER:</B></TD><TD ALIGN=LEFT><font size=2> $DIALorder </TD>";
|
||||
echo "</TR>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>DIFF:</B></TD><TD ALIGN=LEFT><font size=2> $diffpctONEMIN% </TD>";
|
||||
echo "<TD ALIGN=RIGHT><font size=2><B>ORDER:</B></TD><TD ALIGN=LEFT><font size=2> $DIALorder </TD>";
|
||||
echo "</TR>";
|
||||
}
|
||||
|
||||
echo "<TR>";
|
||||
echo "<TD ALIGN=LEFT COLSPAN=8>";
|
||||
@@ -526,9 +778,15 @@ echo "</TD></TR>";
|
||||
echo "<TR>";
|
||||
echo "<TD ALIGN=LEFT COLSPAN=8>";
|
||||
|
||||
echo "$ingroup_detail";
|
||||
|
||||
if ($adastats<2)
|
||||
{
|
||||
echo "<a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=2&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound\"><font size=1>+ VIEW MORE SETTINGS</font></a>";
|
||||
echo "<a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=2&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound\"><font size=1>+ VIEW MORE</font></a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<a href=\"$PHP_SELF?group=$group&RR=$RR&DB=$DB&adastats=1&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound\"><font size=1>+ VIEW LESS</font></a>";
|
||||
}
|
||||
if ($UGdisplay>0)
|
||||
{
|
||||
|
||||
+22
-4
@@ -849,6 +849,10 @@ if (isset($_GET["three_way_dial_prefix"])) {$three_way_dial_prefix=$_GET["thre
|
||||
elseif (isset($_POST["three_way_dial_prefix"])) {$three_way_dial_prefix=$_POST["three_way_dial_prefix"];}
|
||||
if (isset($_GET["forced_timeclock_login"])) {$forced_timeclock_login=$_GET["forced_timeclock_login"];}
|
||||
elseif (isset($_POST["forced_timeclock_login"])) {$forced_timeclock_login=$_POST["forced_timeclock_login"];}
|
||||
if (isset($_GET["answer_sec_pct_rt_stat_one"])) {$answer_sec_pct_rt_stat_one=$_GET["answer_sec_pct_rt_stat_one"];}
|
||||
elseif (isset($_POST["answer_sec_pct_rt_stat_one"])) {$answer_sec_pct_rt_stat_one=$_POST["answer_sec_pct_rt_stat_one"];}
|
||||
if (isset($_GET["answer_sec_pct_rt_stat_two"])) {$answer_sec_pct_rt_stat_two=$_GET["answer_sec_pct_rt_stat_two"];}
|
||||
elseif (isset($_POST["answer_sec_pct_rt_stat_two"])) {$answer_sec_pct_rt_stat_two=$_POST["answer_sec_pct_rt_stat_two"];}
|
||||
|
||||
|
||||
if (isset($script_id)) {$script_id= strtoupper($script_id);}
|
||||
@@ -1019,6 +1023,8 @@ $did_id = ereg_replace("[^0-9]","",$did_id);
|
||||
$source_did = ereg_replace("[^0-9]","",$source_did);
|
||||
$modify_inbound_dids = ereg_replace("[^0-9]","",$modify_inbound_dids);
|
||||
$delete_inbound_dids = ereg_replace("[^0-9]","",$delete_inbound_dids);
|
||||
$answer_sec_pct_rt_stat_one = ereg_replace("[^0-9]","",$answer_sec_pct_rt_stat_one);
|
||||
$answer_sec_pct_rt_stat_two = ereg_replace("[^0-9]","",$answer_sec_pct_rt_stat_two);
|
||||
|
||||
### DIGITS and COLONS
|
||||
$shift_length = ereg_replace("[^\:0-9]","",$shift_length);
|
||||
@@ -1468,11 +1474,12 @@ $survey_camp_record_dir = ereg_replace(";","",$survey_camp_record_dir);
|
||||
# 81030-0348 - Added campaign pause code force option
|
||||
# 81030-2228 - Fixed DIDs creation issue
|
||||
# 81103-1408 - Added 3way call dial prefix option
|
||||
# 81107-1551 - Added Stats Percent of Calls Answered Within X seconds fields to in-groups
|
||||
#
|
||||
# make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time
|
||||
|
||||
$admin_version = '2.0.5-148';
|
||||
$build = '81103-1408';
|
||||
$admin_version = '2.0.5-149';
|
||||
$build = '81107-1551';
|
||||
|
||||
$STARTtime = date("U");
|
||||
$SQLdate = date("Y-m-d H:i:s");
|
||||
@@ -3358,6 +3365,11 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN
|
||||
<BR>
|
||||
<B>No Delay Call Route -</B> Setting this to Y will remove all wait times and audio prompts and attempt to send the call right to an agent. Does not override welcome message or on hold prompt settings. Default is N.
|
||||
|
||||
<BR>
|
||||
<A NAME="vicidial_inbound_groups-answer_sec_pct_rt_stat_one">
|
||||
<BR>
|
||||
<B>Stats Percent of Calls Answered Within X seconds -</B> This field allows you to set the number of hold seconds that the realtime stats display will use to calculate the percentage of answered calls that were answered within X number of seconds on hold.
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -6691,7 +6703,7 @@ if ($ADD==2011)
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="INSERT INTO vicidial_inbound_groups (group_id,group_name,group_color,active,web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,drop_call_seconds,drop_action,drop_exten,call_time_id,after_hours_action,after_hours_message_filename,after_hours_exten,after_hours_voicemail,welcome_message_filename,moh_context,onhold_prompt_filename,prompt_interval,agent_alert_exten,agent_alert_delay,default_xfer_group,queue_priority,drop_inbound_group,ingroup_recording_override,ingroup_rec_filename,afterhours_xfer_group,qc_enabled,qc_statuses,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,play_place_in_line,play_estimate_hold_time,hold_time_option,hold_time_option_seconds,hold_time_option_exten,hold_time_option_voicemail,hold_time_option_xfer_group,hold_time_option_callback_filename,hold_time_option_callback_list_id,hold_recall_xfer_group,no_delay_call_route,play_welcome_message) SELECT \"$group_id\",\"$group_name\",group_color,\"N\",web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,drop_call_seconds,drop_action,drop_exten,call_time_id,after_hours_action,after_hours_message_filename,after_hours_exten,after_hours_voicemail,welcome_message_filename,moh_context,onhold_prompt_filename,prompt_interval,agent_alert_exten,agent_alert_delay,default_xfer_group,queue_priority,drop_inbound_group,ingroup_recording_override,ingroup_rec_filename,afterhours_xfer_group,qc_enabled,qc_statuses,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,play_place_in_line,play_estimate_hold_time,hold_time_option,hold_time_option_seconds,hold_time_option_exten,hold_time_option_voicemail,hold_time_option_xfer_group,hold_time_option_callback_filename,hold_time_option_callback_list_id,hold_recall_xfer_group,no_delay_call_route,play_welcome_message from vicidial_inbound_groups where group_id=\"$source_group_id\";";
|
||||
$stmt="INSERT INTO vicidial_inbound_groups (group_id,group_name,group_color,active,web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,drop_call_seconds,drop_action,drop_exten,call_time_id,after_hours_action,after_hours_message_filename,after_hours_exten,after_hours_voicemail,welcome_message_filename,moh_context,onhold_prompt_filename,prompt_interval,agent_alert_exten,agent_alert_delay,default_xfer_group,queue_priority,drop_inbound_group,ingroup_recording_override,ingroup_rec_filename,afterhours_xfer_group,qc_enabled,qc_statuses,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,play_place_in_line,play_estimate_hold_time,hold_time_option,hold_time_option_seconds,hold_time_option_exten,hold_time_option_voicemail,hold_time_option_xfer_group,hold_time_option_callback_filename,hold_time_option_callback_list_id,hold_recall_xfer_group,no_delay_call_route,play_welcome_message,answer_sec_pct_rt_stat_one,answer_sec_pct_rt_stat_two) SELECT \"$group_id\",\"$group_name\",group_color,\"N\",web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,drop_call_seconds,drop_action,drop_exten,call_time_id,after_hours_action,after_hours_message_filename,after_hours_exten,after_hours_voicemail,welcome_message_filename,moh_context,onhold_prompt_filename,prompt_interval,agent_alert_exten,agent_alert_delay,default_xfer_group,queue_priority,drop_inbound_group,ingroup_recording_override,ingroup_rec_filename,afterhours_xfer_group,qc_enabled,qc_statuses,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,play_place_in_line,play_estimate_hold_time,hold_time_option,hold_time_option_seconds,hold_time_option_exten,hold_time_option_voicemail,hold_time_option_xfer_group,hold_time_option_callback_filename,hold_time_option_callback_list_id,hold_recall_xfer_group,no_delay_call_route,play_welcome_message,answer_sec_pct_rt_stat_one,answer_sec_pct_rt_stat_two from vicidial_inbound_groups where group_id=\"$source_group_id\";";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
echo "<br><B>GROUP ADDED: $group_id</B>\n";
|
||||
@@ -8425,7 +8437,7 @@ if ($ADD==4111)
|
||||
|
||||
echo "<br><B>GROUP MODIFIED: $group_id</B>\n";
|
||||
|
||||
$stmt="UPDATE vicidial_inbound_groups set group_name='$group_name', group_color='$group_color', active='$active', web_form_address='" . mysql_real_escape_string($web_form_address) . "', voicemail_ext='$voicemail_ext', next_agent_call='$next_agent_call', fronter_display='$fronter_display', ingroup_script='$script_id', get_call_launch='$get_call_launch', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',drop_exten='$drop_exten',call_time_id='$call_time_id',after_hours_action='$after_hours_action',after_hours_message_filename='$after_hours_message_filename',after_hours_exten='$after_hours_exten',after_hours_voicemail='$after_hours_voicemail',welcome_message_filename='$welcome_message_filename',moh_context='$moh_context',onhold_prompt_filename='$onhold_prompt_filename',prompt_interval='$prompt_interval',agent_alert_exten='$agent_alert_exten',agent_alert_delay='$agent_alert_delay',default_xfer_group='$default_xfer_group',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',ingroup_recording_override='$ingroup_recording_override',ingroup_rec_filename='$ingroup_rec_filename',afterhours_xfer_group='$afterhours_xfer_group',qc_enabled='$qc_enabled',qc_statuses='$QC_statuses',qc_shift_id='$qc_shift_id',qc_get_record_launch='$qc_get_record_launch',qc_show_recording='$qc_show_recording',qc_web_form_address='$qc_web_form_address',qc_script='$qc_script',play_place_in_line='$play_place_in_line',play_estimate_hold_time='$play_estimate_hold_time',hold_time_option='$hold_time_option',hold_time_option_seconds='$hold_time_option_seconds',hold_time_option_exten='$hold_time_option_exten',hold_time_option_voicemail='$hold_time_option_voicemail',hold_time_option_xfer_group='$hold_time_option_xfer_group',hold_time_option_callback_filename='$hold_time_option_callback_filename',hold_time_option_callback_list_id='$hold_time_option_callback_list_id',hold_recall_xfer_group='$hold_recall_xfer_group',no_delay_call_route='$no_delay_call_route',play_welcome_message='$play_welcome_message' where group_id='$group_id';";
|
||||
$stmt="UPDATE vicidial_inbound_groups set group_name='$group_name', group_color='$group_color', active='$active', web_form_address='" . mysql_real_escape_string($web_form_address) . "', voicemail_ext='$voicemail_ext', next_agent_call='$next_agent_call', fronter_display='$fronter_display', ingroup_script='$script_id', get_call_launch='$get_call_launch', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',drop_exten='$drop_exten',call_time_id='$call_time_id',after_hours_action='$after_hours_action',after_hours_message_filename='$after_hours_message_filename',after_hours_exten='$after_hours_exten',after_hours_voicemail='$after_hours_voicemail',welcome_message_filename='$welcome_message_filename',moh_context='$moh_context',onhold_prompt_filename='$onhold_prompt_filename',prompt_interval='$prompt_interval',agent_alert_exten='$agent_alert_exten',agent_alert_delay='$agent_alert_delay',default_xfer_group='$default_xfer_group',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',ingroup_recording_override='$ingroup_recording_override',ingroup_rec_filename='$ingroup_rec_filename',afterhours_xfer_group='$afterhours_xfer_group',qc_enabled='$qc_enabled',qc_statuses='$QC_statuses',qc_shift_id='$qc_shift_id',qc_get_record_launch='$qc_get_record_launch',qc_show_recording='$qc_show_recording',qc_web_form_address='$qc_web_form_address',qc_script='$qc_script',play_place_in_line='$play_place_in_line',play_estimate_hold_time='$play_estimate_hold_time',hold_time_option='$hold_time_option',hold_time_option_seconds='$hold_time_option_seconds',hold_time_option_exten='$hold_time_option_exten',hold_time_option_voicemail='$hold_time_option_voicemail',hold_time_option_xfer_group='$hold_time_option_xfer_group',hold_time_option_callback_filename='$hold_time_option_callback_filename',hold_time_option_callback_list_id='$hold_time_option_callback_list_id',hold_recall_xfer_group='$hold_recall_xfer_group',no_delay_call_route='$no_delay_call_route',play_welcome_message='$play_welcome_message',answer_sec_pct_rt_stat_one='$answer_sec_pct_rt_stat_one',answer_sec_pct_rt_stat_two='$answer_sec_pct_rt_stat_two' where group_id='$group_id';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
### LOG CHANGES TO LOG FILE ###
|
||||
@@ -13416,6 +13428,8 @@ if ($ADD==3111)
|
||||
$hold_recall_xfer_group = $row[50];
|
||||
$no_delay_call_route = $row[51];
|
||||
$play_welcome_message = $row[52];
|
||||
$answer_sec_pct_rt_stat_one = $row[53];
|
||||
$answer_sec_pct_rt_stat_two = $row[54];
|
||||
|
||||
##### get in-groups listings for dynamic pulldown
|
||||
$stmt="SELECT group_id,group_name from vicidial_inbound_groups where group_id NOT IN('AGENTDIRECT') order by group_id";
|
||||
@@ -13615,6 +13629,10 @@ if ($ADD==3111)
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>In-Group Recording Override: </td><td align=left><select size=1 name=ingroup_recording_override><option>DISABLED</option><option>NEVER</option><option>ONDEMAND</option><option>ALLCALLS</option><option>ALLFORCE</option><option SELECTED>$ingroup_recording_override</option></select>$NWB#vicidial_inbound_groups-ingroup_recording_override$NWE</td></tr>\n";
|
||||
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>In-Group Recording Filename: </td><td align=left><input type=text name=ingroup_rec_filename size=50 maxlength=50 value=\"$ingroup_rec_filename\">$NWB#vicidial_inbound_groups-ingroup_rec_filename$NWE</td></tr>\n";
|
||||
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Stats Percent of Calls Answered Within X seconds 1: </td><td align=left><input type=text name=answer_sec_pct_rt_stat_one size=5 maxlength=5 value=\"$answer_sec_pct_rt_stat_one\">$NWB#vicidial_inbound_groups-answer_sec_pct_rt_stat_one$NWE</td></tr>\n";
|
||||
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Stats Percent of Calls Answered Within X seconds 2: </td><td align=left><input type=text name=answer_sec_pct_rt_stat_two size=5 maxlength=5 value=\"$answer_sec_pct_rt_stat_two\">$NWB#vicidial_inbound_groups-answer_sec_pct_rt_stat_one$NWE</td></tr>\n";
|
||||
|
||||
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user