Added DIAL status for manual dial agent calls that have not been answered in Real-Time Report and Non-Agent API functions

git-svn-id: svn://192.168.202.10@2780 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2017-06-15 04:37:47 +00:00
parent 77dd548873
commit 99cd88a561
5 changed files with 158 additions and 34 deletions
+3
View File
@@ -169,6 +169,9 @@ OTHER CHANGES:
information to pass from one VICIdial system to another with a call.
See the CROSS_CLUSTER_COMMUNICATION.txt document for more information.
38. Added Real-Time agent status of "DIAL" for agent manual dial calls after
they have been placed but before they have been answered.
+35 -8
View File
@@ -1,8 +1,8 @@
#!/usr/bin/perl
#
# ADMIN_area_code_populate.pl version 2.12
# ADMIN_area_code_populate.pl version 2.14
#
# Copyright (C) 2016 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2017 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# Description:
# server application that allows load areacodes into to asterisk list database
@@ -23,6 +23,7 @@
# 150203-1751 - code cleanup
# 151228-1043 - Added ISO-TLD table and import
# 160611-0933 - Added more documentation
# 170614-2146 - Added some dirty input filtering and more debug output
#
@@ -51,6 +52,7 @@ if (length($ARGV[0])>1)
print " [-q] = quiet\n";
print " [--test] = test\n";
print " [--debug] = debug output\n";
print " [--debugX] = extra debug output\n";
print " [--use-local-files] = Do not download files, use local copies\n";
print " [--load-NANPA-prefix] = Only loads the special NANPA list into the database\n";
print " NOTE: NANPA data must be purchased from 'http://vicidial.org/store.php'\n";
@@ -176,7 +178,7 @@ $dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VA
if ($nanpa_load > 0)
{
#### load special North American phone code prefix table ####
# LONG # NPA,NXX,,,,LTYPE,,STATE,COUNTRY,,,,,RC,TZ,DST,ZIP,,,,,,,,,,,LATITUDE,LONGITUDE,,,,,,,
# LONG # NPA,NXX,,,,LTYPE,,STATE,COUNTRY,,,,,RC,TZ,DST,ZIP,,,,,,,,,,,LATITUDE,LONGITUDE,,,,,,,TZ
# SHORT # NPA,NXX,TZ,DST,LATITUDE,LONGITUDE,CITY,STATE,POSTAL_CODE,COUNTRY,LTYPE
#### BEGIN vicidial_nanpa_prefix_codes population from NANPA_prefix-latest.txt file ####
@@ -194,7 +196,8 @@ if ($nanpa_load > 0)
if($DB){print STDERR "\n|$stmtA|\n";}
$affected_rows = $dbhA->do($stmtA);
}
$pc=0; $full_file=0; $dup_count=0; $ins_count=0; $dup_list='';
if ($DB > 0) {print "LINES IN NANPA FILE: $#prefixfile\n";}
$pc=0; $full_file=0; $dup_count=0; $ins_count=0; $dup_list=''; $skp_count=0;
$ins_stmt="insert into vicidial_nanpa_prefix_codes VALUES ";
foreach (@prefixfile)
{
@@ -227,6 +230,24 @@ if ($nanpa_load > 0)
$row[15] =~ s/X/N/gi;
$temp_insert="('$row[0]', '$row[1]', '$row[14]', '$row[15]', '$row[27]', '$row[28]', '$row[13]', '$row[7]', '$row[16]', '$row[8]', '$row[5]'), ";
}
else
{
$row[13] =~ s/\(.*//gi;
$row[13] =~ s/ $//gi;
$row[13] =~ s/\'/\\\'/gi;
$row[15] =~ s/X/N/gi;
$row[35] =~ s/-0/-/gi;
$row[35] =~ s/:/./gi;
$row[35] =~ s/\r|\n|\t| //gi;
if ( ($row[7] =~ /XX/) || (length($row[35]) < 3) )
{
$skp_count++;
}
else
{
$temp_insert="('$row[0]', '$row[1]', '$row[35]', '$row[15]', '$row[27]', '$row[28]', '', '$row[7]', '$row[16]', '$row[8]', '$row[5]'), ";
}
}
}
else
{
@@ -254,31 +275,37 @@ if ($nanpa_load > 0)
{
$dup_list .= "$row[0]$row[1]|";
$ins_stmt .= "$temp_insert";
if ($DBX > 0) {print "DEBUG: $pc|$ins_count|$ins_stmt|\n\n";}
$ins_count++;
}
}
else
{$dup_count++;}
if ($pc =~ /000$/)
if ( ($pc =~ /000$/) && (length($ins_stmt) > 60) )
{
chop($ins_stmt);
chop($ins_stmt);
$affected_rows = $dbhA->do($ins_stmt) || die "can't execute query: |$ins_stmt| $!\n";
if ($DBX > 0) {print "DEBUG INSERTING: $pc|$ins_count|$to_insert_ct|$ins_stmt|\n\n";}
$ins_stmt="insert into vicidial_nanpa_prefix_codes VALUES ";
print STDERR "$pc Lines $ins_count Inserted $dup_count Duplicates\r";
$dup_list='';
}
}
else
{$pc++;}
if ($pc =~ /000$/)
{
print STDERR "$pc Lines $ins_count Inserted ($skp_count skipped) $dup_count Duplicates\r";
}
}
chop($ins_stmt);
chop($ins_stmt);
$affected_rows = $dbhA->do($ins_stmt);
if (length($ins_stmt) > 60)
{$affected_rows = $dbhA->do($ins_stmt);}
$ins_stmt="insert into vicidial_nanpa_prefix_codes VALUES ";
print STDERR "$pc Lines $ins_count Inserted $dup_count Duplicates\n";
print STDERR "$pc Lines $ins_count Inserted ($skp_count skipped) $dup_count Duplicates\n";
#### END vicidial_nanpa_prefix_codes population ####
}
else
+8 -7
View File
@@ -1,4 +1,4 @@
NON-AGENT API DOCUMENT Started: 2008-07-24 Updated: 2017-06-09
NON-AGENT API DOCUMENT Started: 2008-07-24 Updated: 2017-06-14
This document describes the functions of an API(Application Programming
Interface) for all functions NOT directly relating to the VICIDIAL Agent screen.
@@ -128,6 +128,7 @@ Changes:
170527-2254 - Fix for rare inbound logging issue #1017
170601-0747 - Added add_to_hopper options to update_lead function
170609-1107 - Added ccc_lead_info function
170615-0006 - Added DIAL status for manual dial agent calls that have not been answered, to 4 functions
API Functions use the 'function' variable
@@ -442,8 +443,8 @@ ERROR: user_group_status USER DOES NOT HAVE PERMISSION TO GET USER GROUP INFO -
ERROR: user_group_status INVALID SEARCH PARAMETERS - 6666||
A SUCCESS response will not show "SUCCESS", but instead will just print the results in the following format:
usergroups|calls_waiting|agents_logged_in|agents_in_calls|agents_waiting|agents_paused|agents_in_dead_calls|agents_in_dispo
ADMIN AGENT|0|1|0|1|0|0|0
usergroups|calls_waiting|agents_logged_in|agents_in_calls|agents_waiting|agents_paused|agents_in_dead_calls|agents_in_dispo|agents_in_dial
ADMIN AGENT|0|1|0|1|0|0|0|0
@@ -473,8 +474,8 @@ ERROR: in_group_status USER DOES NOT HAVE PERMISSION TO GET IN-GROUP INFO - 6666
ERROR: in_group_status INVALID SEARCH PARAMETERS - 6666||
A SUCCESS response will not show "SUCCESS", but instead will just print the results in the following format:
ingroups,total_calls,calls_waiting,agents_logged_in,agents_in_calls,agents_waiting,agents_paused,agents_in_dispo
SALESLINE SUPPORT,31,0,75,54,0,20,1
ingroups,total_calls,calls_waiting,agents_logged_in,agents_in_calls,agents_waiting,agents_paused,agents_in_dispo,agents_in_dial
SALESLINE SUPPORT,31,0,75,54,0,20,1,0
@@ -507,7 +508,7 @@ INCALL,M4050908070000012345,12345,TESTCAMP,1,Test Agent,AGENTS,3,LOGIN,,72755512
INCALL|M4181606420000000104|104|TESTBLND|1|Admin|ADMIN|9|BRK2|DEAD|3125551212|123457|8600051
PAUSED||105|TESTBLND|1|Admin|ADMIN|9||PREVIEW|9545551212|123458|8600052
NOTE: real_time_sub_status field can consist of: DEAD, DISPO, 3-WAY, PARK, RING, PREVIEW or it can be empty
NOTE: real_time_sub_status field can consist of: DEAD, DISPO, 3-WAY, PARK, RING, PREVIEW, DIAL or it can be empty
@@ -1436,7 +1437,7 @@ user,campaign_id,session_id,status,lead_id,callerid,calls_today,full_name,user_g
6666,TESTCAMP,8600051,INCALL,1079409,M2260919190001079409,1,Admin,ADMIN,9,LOGIN,DEAD
4545,TESTCAMP,8600052,PAUSED,0,,0,4545,MIKESGROUP,8,LOGIN,
NOTE: real_time_sub_status field can consist of: DEAD, DISPO, 3-WAY, PARK, RING, PREVIEW or it can be empty
NOTE: real_time_sub_status field can consist of: DEAD, DISPO, 3-WAY, PARK, RING, PREVIEW, DIAL or it can be empty
+43 -11
View File
@@ -106,10 +106,11 @@
# 160803-1901 - Fixed issue with ERROR in campaign/ingroup name
# 170321-1145 - Added pause code time limits colors
# 170409-1556 - Added IP List validation code
# 170615-0023 - Added DIAL status for manual dial agent calls that have not been answered
#
$version = '2.14-94';
$build = '170409-1556';
$version = '2.14-95';
$build = '170615-0023';
header ("Content-type: text/html; charset=utf-8");
@@ -2517,6 +2518,7 @@ if ($p<1)
###################################################################################
$agent_incall=0;
$agent_indial=0;
$agent_ready=0;
$agent_paused=0;
$agent_dispo=0;
@@ -3069,6 +3071,26 @@ if ($talking_to_print > 0)
$Lstatus = 'DEAD';
$status = ' DEAD ';
}
else
{
if ($Acomments[$i] == 'MANUAL')
{
$stmt="SELECT uniqueid,channel from vicidial_auto_calls where callerid='$Acallerid[$i]' LIMIT 1;";
$rslt=mysql_to_mysqli($stmt, $link);
if ($DB) {echo "$stmt\n";}
$mandial_to_check = mysqli_num_rows($rslt);
if ($mandial_to_check > 0)
{
$row=mysqli_fetch_row($rslt);
if ( (strlen($row[0])<5) and (strlen($row[1])<5) )
{
$Astatus[$i] = 'DIAL';
$Lstatus = 'DIAL';
$status = ' DIAL ';
}
}
}
}
if (preg_match("/CHAT/i",$comments))
{
$stmtCT="SELECT chat_id from vicidial_live_chats where chat_creator='$Auser[$i]' and lead_id='$Alead_id[$i]' order by chat_start_time desc limit 1;";
@@ -3150,7 +3172,7 @@ if ($talking_to_print > 0)
}
}
}
if (!preg_match("/INCALL|QUEUE|PARK|3-WAY/i",$Astatus[$i]))
if (!preg_match("/INCALL|DIAL|QUEUE|PARK|3-WAY/i",$Astatus[$i]))
{$call_time_S = ($STARTtime - $Astate_change[$i]);}
else if (preg_match("/3-WAY/i",$Astatus[$i]))
{$call_time_S = ($STARTtime - $Acall_mostrecent[$i]);}
@@ -3246,7 +3268,8 @@ if ($talking_to_print > 0)
# if ( (strlen($Acall_server_ip[$i])> 4) and ($Acall_server_ip[$i] != "$Aserver_ip[$i]") )
# {$G='<SPAN class="orange"><B>'; $EG='</B></SPAN>';}
if ( (preg_match("/INCALL/i",$status)) or (preg_match("/QUEUE/i",$status)) or (preg_match("/3-WAY/i",$status)) or (preg_match('/PARK/i',$status))) {$agent_incall++; $agent_total++;}
if ( (preg_match("/INCALL|DIAL/i",$status)) or (preg_match("/QUEUE/i",$status)) or (preg_match("/3-WAY/i",$status)) or (preg_match('/PARK/i',$status))) {$agent_incall++; $agent_total++;}
if (preg_match("/DIAL/i",$status)) {$agent_indial++;}
if ( (preg_match("/READY/i",$status)) or (preg_match("/CLOSER/i",$status)) ) {$agent_ready++; $agent_total++;}
if ( (preg_match("/READY/i",$status)) or (preg_match("/CLOSER/i",$status)) )
{
@@ -3435,13 +3458,15 @@ if ($talking_to_print > 0)
if ($agent_ready > 9) {$B='<FONT class="b3">'; $BG='</FONT>';}
if ($agent_ready > 14) {$B='<FONT class="b4">'; $BG='</FONT>';}
$AIDct=''; $AIDtx='';
if ($agent_indial > 0) {$AIDct = "/$agent_indial"; $AIDtx = ' / '._QXZ("dials");}
echo "\n<BR>\n";
if ( ($report_display_type=='TEXT') or ($report_display_type=='WALL_1') )
{
echo "$NFB$agent_total$NFE "._QXZ("agents logged in")." &nbsp; &nbsp; &nbsp; &nbsp; \n";
echo "$NFB$agent_incall$NFE "._QXZ("agents in calls")." &nbsp; &nbsp; &nbsp; \n";
echo "$NFB$agent_incall$AIDct$NFE "._QXZ("agents in calls")."$AIDtx &nbsp; &nbsp; &nbsp; \n";
echo "$NFB$B &nbsp;$agent_ready $BG$NFE "._QXZ("agents waiting")." &nbsp; &nbsp; &nbsp; \n";
echo "$NFB$agent_paused$NFE "._QXZ("paused agents")." &nbsp; &nbsp; &nbsp; \n";
echo "$NFB$agent_dead$NFE "._QXZ("agents in dead calls")."&nbsp; &nbsp; &nbsp; \n";
@@ -3474,6 +3499,9 @@ if ( ($report_display_type!='HTML') and ($report_display_type!='WALL_2') and ($r
##### BEGIN HTML output for agents summary #####
if ( ($report_display_type=='HTML') or ($report_display_type=='WALL_2') )
{
$AIDct=''; $AIDtx='';
if ($agent_indial > 0) {$AIDct = " / $agent_indial"; $AIDtx = ' / '._QXZ("dials");}
# echo "<TABLE width=$section_width cellpadding=3 cellspacing=0>\n";
echo "<tr>";
# echo "<td width=5 rowspan=2> &nbsp; </td>";
@@ -3481,7 +3509,7 @@ if ( ($report_display_type=='HTML') or ($report_display_type=='WALL_2') )
echo "<td align='center' valign='middle' bgcolor='#015b91'><font style=\"font-family:HELVETICA;font-size:11;color:white;font-weight:bold;\">"._QXZ("agents logged in")."</font></td>";
echo "<td width=6 rowspan=2> &nbsp; </td>";
echo "<td align='center' valign='middle' bgcolor='#015b91' rowspan=2><img src=\"images/icon_agentsincalls.png\" width=42 height=42></td>";
echo "<td align='center' valign='middle' bgcolor='#015b91'><font style=\"font-family:HELVETICA;font-size:11;color:white;font-weight:bold;\">"._QXZ("agents in calls")."</font></td>";
echo "<td align='center' valign='middle' bgcolor='#015b91'><font style=\"font-family:HELVETICA;font-size:11;color:white;font-weight:bold;\">"._QXZ("agents in calls")."$AIDtx</font></td>";
echo "<td width=6 rowspan=2> &nbsp; </td>";
echo "<td align='center' valign='middle' bgcolor='#015b91' rowspan=2><img src=\"images/icon_agentswaiting.png\" width=42 height=42></td>";
echo "<td align='center' valign='middle' bgcolor='#015b91'><font style=\"font-family:HELVETICA;font-size:11;color:white;font-weight:bold;\">"._QXZ("agents waiting")."</font></td>";
@@ -3497,7 +3525,7 @@ if ( ($report_display_type=='HTML') or ($report_display_type=='WALL_2') )
echo "</tr>";
echo "<tr>";
echo "<td align='center' valign='middle' bgcolor='#015b91'><font style=\"font-family:HELVETICA;font-size:18;color:white;font-weight:bold;\">$agent_total</font></td>";
echo "<td align='center' valign='middle' bgcolor='#015b91'><font style=\"font-family:HELVETICA;font-size:18;color:white;font-weight:bold;\">$agent_incall</font></td>";
echo "<td align='center' valign='middle' bgcolor='#015b91'><font style=\"font-family:HELVETICA;font-size:18;color:white;font-weight:bold;\">$agent_incall$AIDct</font></td>";
$agents_waiting_td='bgcolor="#015b91"'; $agents_waiting_font='style="color: white; font-family: HELVETICA; font-size: 18; font-weight: bold;"';
if ($agent_ready > 0) {$agents_waiting_td='bgcolor="#CCFFCC"'; $agents_waiting_font='style="color: black; font-family: HELVETICA; font-size: 18; font-weight: bold;"';}
@@ -3528,12 +3556,14 @@ if ( ($report_display_type=='HTML') or ($report_display_type=='WALL_2') )
##### BEGIN custom WALL_3 display option #####
if ($report_display_type=='WALL_3')
{
$AIDct=''; $AIDtx='';
if ($agent_indial > 0) {$AIDct = " / $agent_indial"; $AIDtx = ' / '._QXZ("dials");}
echo "<font style=\"font-size:48; color:black; font-weight: bold; background-color:green\">"._QXZ("agents waiting")."</font>\n";
echo "<font style=\"font-size:72; color:black; font-weight: bold; background-color:green\"> &nbsp; $agent_ready</font><br>\n";
echo "<font style=\"font-size:48; color:black; font-weight: bold; background-color:yellow\">"._QXZ("paused agents")."</font>\n";
echo "<font style=\"font-size:72; color:black; font-weight: bold; background-color:yellow\"> &nbsp; $agent_paused</font><br>\n";
echo "<font style=\"font-size:48; color:black; font-weight: bold; background-color:green\">"._QXZ("agents in calls")."</font>\n";
echo "<font style=\"font-size:72; color:black; font-weight: bold; background-color:green\"> &nbsp; $agent_incall</font><br>\n";
echo "<font style=\"font-size:48; color:black; font-weight: bold; background-color:green\">"._QXZ("agents in calls")."$AIDtx</font>\n";
echo "<font style=\"font-size:72; color:black; font-weight: bold; background-color:green\"> &nbsp; $agent_incall$AIDct</font><br>\n";
echo "<font style=\"font-size:48; color:black; font-weight: bold; background-color:red\">"._QXZ("calls waiting")."</font>\n";
echo "<font style=\"font-size:72; color:black; font-weight: bold; background-color:red\"> &nbsp; $out_live</font><br>\n";
echo "<font style=\"font-size:36; color:black; font-weight: bold;\">"._QXZ("dropped/total calls")."</font>\n";
@@ -3545,6 +3575,8 @@ if ($report_display_type=='WALL_3')
##### BEGIN custom WALL_4 display option #####
if ($report_display_type=='WALL_4')
{
$AIDct=''; $AIDtx='';
if ($agent_indial > 0) {$AIDct = " / $agent_indial"; $AIDtx = ' / '._QXZ("dials");}
echo "<center><table border=0 cellpadding=3 cellspacing=3>\n";
echo "<tr>\n";
echo "<td><font style=\"font-size:48; color:black; font-weight: bold; background-color:green\">"._QXZ("agents waiting")."</font></td>";
@@ -3555,8 +3587,8 @@ if ($report_display_type=='WALL_4')
echo "<td><font style=\"font-size:72; color:black; font-weight: bold; background-color:yellow\"> &nbsp; $agent_paused</font></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td><font style=\"font-size:48; color:black; font-weight: bold; background-color:green\">"._QXZ("agents in calls")."</font></td>";
echo "<td><font style=\"font-size:72; color:black; font-weight: bold; background-color:green\"> &nbsp; $agent_incall</font></td>\n";
echo "<td><font style=\"font-size:48; color:black; font-weight: bold; background-color:green\">"._QXZ("agents in calls")."$AIDtx</font></td>";
echo "<td><font style=\"font-size:72; color:black; font-weight: bold; background-color:green\"> &nbsp; $agent_incall$AIDct</font></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td><font style=\"font-size:48; color:black; font-weight: bold; background-color:red\">"._QXZ("calls waiting")."</font></td>";
+69 -8
View File
@@ -121,10 +121,11 @@
# 170527-2254 - Fix for rare inbound logging issue #1017
# 170601-0747 - Added add_to_hopper options to update_lead function
# 170609-1107 - Added ccc_lead_info function
# 170615-0006 - Added DIAL status for manual dial agent calls that have not been answered, to 4 functions
#
$version = '2.14-97';
$build = '170609-1107';
$version = '2.14-98';
$build = '170615-0006';
$api_url_log = 0;
$startMS = microtime();
@@ -5532,7 +5533,7 @@ if ($function == 'user_group_status')
if (strlen($time_format) < 1)
{$time_format = 'HF';}
if ($header == 'YES')
{$output .= 'usergroups' . $DL . 'calls_waiting' . $DL . 'agents_logged_in' . $DL . 'agents_in_calls' . $DL . 'agents_waiting' . $DL . 'agents_paused' . $DL . 'agents_in_dead_calls' . $DL . 'agents_in_dispo' . "\n";}
{$output .= 'usergroups' . $DL . 'calls_waiting' . $DL . 'agents_logged_in' . $DL . 'agents_in_calls' . $DL . 'agents_waiting' . $DL . 'agents_paused' . $DL . 'agents_in_dead_calls' . $DL . 'agents_in_dispo' . $DL . 'agents_in_dial' . "\n";}
$total_agents=0;
$total_agents_in_calls=0;
@@ -5540,6 +5541,7 @@ if ($function == 'user_group_status')
$total_agents_paused=0;
$total_agents_dead=0;
$total_agents_dispo=0;
$total_agents_in_dial=0;
$total_calls=0;
$total_calls_waiting=0;
$call_camps[0]='';
@@ -5623,6 +5625,24 @@ if ($function == 'user_group_status')
{
if (!preg_match("/$row[5]\|/",$callerids))
{$row[1] = 'DEAD';}
else
{
if ($row[4] == 'MANUAL')
{
$stmt="SELECT uniqueid,channel from vicidial_auto_calls where callerid='$row[5]' LIMIT 1;";
$rslt=mysql_to_mysqli($stmt, $link);
if ($DB) {echo "$stmt\n";}
$mandial_to_check = mysqli_num_rows($rslt);
if ($mandial_to_check > 0)
{
$rowvac=mysqli_fetch_row($rslt);
if ( (strlen($rowvac[0])<5) and (strlen($rowvac[1])<5) )
{
$row[1] = 'DIAL';
}
}
}
}
}
}
}
@@ -5633,8 +5653,10 @@ if ($function == 'user_group_status')
{$total_agents_dispo++;}
if ($row[1]=='PAUSED')
{$total_agents_paused++;}
if ( (preg_match("/INCALL/i",$row[1])) or (preg_match("/QUEUE/i",$row[1])) or (preg_match('/PARK/i',$row[1])))
if ( (preg_match("/INCALL|DIAL/i",$row[1])) or (preg_match("/QUEUE/i",$row[1])) or (preg_match('/PARK/i',$row[1])))
{$total_agents_in_calls++;}
if (preg_match("/DIAL/i",$row[1]))
{$total_agents_in_dial++;}
if ( (preg_match("/READY/i",$row[1])) or (preg_match("/CLOSER/i",$row[1])) )
{$total_agents_waiting++;}
@@ -5642,7 +5664,7 @@ if ($function == 'user_group_status')
$k++;
}
}
$output .= "$user_groupsOUTPUT$DL$total_calls_waiting$DL$total_agents$DL$total_agents_in_calls$DL$total_agents_waiting$DL$total_agents_paused$DL$total_agents_dead$DL$total_agents_dispo\n";
$output .= "$user_groupsOUTPUT$DL$total_calls_waiting$DL$total_agents$DL$total_agents_in_calls$DL$total_agents_waiting$DL$total_agents_paused$DL$total_agents_dead$DL$total_agents_dispo$DL$total_agents_in_dial\n";
echo "$output";
@@ -5781,7 +5803,7 @@ if ($function == 'in_group_status')
if (strlen($time_format) < 1)
{$time_format = 'HF';}
if ($header == 'YES')
{$output .= 'ingroups' . $DL . 'total_calls' . $DL . 'calls_waiting' . $DL . 'agents_logged_in' . $DL . 'agents_in_calls' . $DL . 'agents_waiting' . $DL . 'agents_paused' . $DL . 'agents_in_dispo' . "\n";}
{$output .= 'ingroups' . $DL . 'total_calls' . $DL . 'calls_waiting' . $DL . 'agents_logged_in' . $DL . 'agents_in_calls' . $DL . 'agents_waiting' . $DL . 'agents_paused' . $DL . 'agents_in_dispo' . $DL . 'agents_in_dial' . "\n";}
$total_agents=0;
$total_agents_in_calls=0;
@@ -5789,6 +5811,7 @@ if ($function == 'in_group_status')
$total_agents_paused=0;
$total_agents_dead=0;
$total_agents_dispo=0;
$total_agents_in_dial=0;
$total_calls=0;
$total_calls_waiting=0;
$call_camps[0]='';
@@ -5853,8 +5876,10 @@ if ($function == 'in_group_status')
{$total_agents_dispo++;}
if ($row[1]=='PAUSED')
{$total_agents_paused++;}
if ( (preg_match("/INCALL/i",$row[1])) or (preg_match("/QUEUE/i",$row[1])) or (preg_match('/PARK/i',$row[1])))
if ( (preg_match("/INCALL|DIAL/i",$row[1])) or (preg_match("/QUEUE/i",$row[1])) or (preg_match('/PARK/i',$row[1])))
{$total_agents_in_calls++;}
if (preg_match("/DIAL/i",$row[1]))
{$total_agents_in_dial++;}
if ( (preg_match("/READY/i",$row[1])) or (preg_match("/CLOSER/i",$row[1])) )
{$total_agents_waiting++;}
@@ -5862,7 +5887,7 @@ if ($function == 'in_group_status')
$k++;
}
}
$output .= "$in_groupsOUTPUT$DL$total_calls$DL$total_calls_waiting$DL$total_agents$DL$total_agents_in_calls$DL$total_agents_waiting$DL$total_agents_paused$DL$total_agents_dispo\n";
$output .= "$in_groupsOUTPUT$DL$total_calls$DL$total_calls_waiting$DL$total_agents$DL$total_agents_in_calls$DL$total_agents_waiting$DL$total_agents_paused$DL$total_agents_dispo$DL$total_agents_in_dial\n";
echo "$output";
@@ -6079,6 +6104,24 @@ if ($function == 'agent_status')
$live_channel = $row[0];
if ($live_channel < 1)
{$rtr_status = 'DEAD';}
else
{
if ($comments == 'MANUAL')
{
$stmt="SELECT uniqueid,channel from vicidial_auto_calls where callerid='$callerid' LIMIT 1;";
$rslt=mysql_to_mysqli($stmt, $link);
if ($DB) {echo "$stmt\n";}
$mandial_to_check = mysqli_num_rows($rslt);
if ($mandial_to_check > 0)
{
$rowvac=mysqli_fetch_row($rslt);
if ( (strlen($rowvac[0])<5) and (strlen($rowvac[1])<5) )
{
$rtr_status = 'DIAL';
}
}
}
}
}
}
}
@@ -9231,6 +9274,24 @@ if ($function == 'logged_in_agents')
$live_channel = $row[0];
if ($live_channel < 1)
{$rtr_status = 'DEAD';}
else
{
if ($Acomments[$i] == 'MANUAL')
{
$stmt="SELECT uniqueid,channel from vicidial_auto_calls where callerid='$Acallerid[$i]' LIMIT 1;";
$rslt=mysql_to_mysqli($stmt, $link);
if ($DB) {echo "$stmt\n";}
$mandial_to_check = mysqli_num_rows($rslt);
if ($mandial_to_check > 0)
{
$rowvac=mysqli_fetch_row($rslt);
if ( (strlen($rowvac[0])<5) and (strlen($rowvac[1])<5) )
{
$rtr_status = 'DIAL';
}
}
}
}
}
}
}