Fixed several small bugs related to agent interface(logging and recording) as well as conf file generation bugs in admin.php

git-svn-id: svn://192.168.202.10@1079 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2009-03-20 08:37:52 +00:00
parent fcbda1e64a
commit 11726569f1
4 changed files with 51 additions and 17 deletions
+2 -2
View File
@@ -1637,7 +1637,7 @@ if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") )
$row=''; $rowx='';
$channel_live=1;
if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($filename)<15) )
if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($filename)<8) )
{
$channel_live=0;
echo "Channel $channel is not valid or queryCID $queryCID is not valid or filename: $filename is not valid, $ACTION command not inserted\n";
@@ -1725,7 +1725,7 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") )
$channel_live=1;
$uniqueidSQL='';
if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<15) )
if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<8) )
{
$channel_live=0;
echo "Channel $channel is not valid or exten $exten is not valid or filename: $filename is not valid, $ACTION command not inserted\n";
+26 -3
View File
@@ -82,6 +82,7 @@
# - $account - ('DEFAULT',...)
# - $agent_dialed_number - ('1','')
# - $agent_dialed_type - ('MANUAL_OVERRIDE','MANUAL_DIALNOW','MANUAL_PREVIEW',...)
# - $wrapup - ('WRAPUP','')
#
# CHANGELOG:
# 50629-1044 - First build of script
@@ -190,12 +191,13 @@
# 90304-1335 - Added support for group aliases and agent-specific variables for campaigns and in-groups
# 90305-1041 - Added agent_dialed_number and type for user_call_log feature
# 90307-1735 - Added Shift enforcement and manager override features
# 90320-0306 - Fixed agent log bug when using wrapup time
#
$version = '2.0.5-103';
$build = '90307-1735';
$version = '2.0.5-104';
$build = '90320-0306';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=193;
$mysql_log_count=194;
$one_mysql_log=0;
require("dbconnect.php");
@@ -359,6 +361,10 @@ if (isset($_GET["agent_dialed_number"])) {$agent_dialed_number=$_GET["agent_di
elseif (isset($_POST["agent_dialed_number"])) {$agent_dialed_number=$_POST["agent_dialed_number"];}
if (isset($_GET["agent_dialed_type"])) {$agent_dialed_type=$_GET["agent_dialed_type"];}
elseif (isset($_POST["agent_dialed_type"])) {$agent_dialed_type=$_POST["agent_dialed_type"];}
if (isset($_GET["wrapup"])) {$wrapup=$_GET["wrapup"];}
elseif (isset($_POST["wrapup"])) {$wrapup=$_POST["wrapup"];}
header ("Content-type: text/html; charset=utf-8");
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
@@ -3728,6 +3734,23 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') )
$agent_log = 'NEW_ID';
}
if ($wrapup == 'WRAPUP')
{
if ( (eregi("NULL",$dispo_epoch)) or ($dispo_epoch < 1000) )
{
$stmt="UPDATE vicidial_agent_log set dispo_epoch='$StarTtime', dispo_sec='0' where agent_log_id='$agent_log_id';";
}
else
{
$dispo_sec = ($StarTtime - $dispo_epoch);
$stmt="UPDATE vicidial_agent_log set dispo_sec='$dispo_sec' where agent_log_id='$agent_log_id';";
}
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00194',$user,$server_ip,$session_name,$one_mysql_log);}
}
if ($agent_log == 'NEW_ID')
{
$user_group='';
+8 -10
View File
@@ -223,10 +223,11 @@
# 90305-0917 - Added prefix-choice and group-alias options for calls coming from API
# 90307-1736 - Added Shift enforcement and manager override features
# 90315-1009 - Changed revision for new trunk 2.2.0
# 90320-0309 - Fixed agent log bug when using wrapup time
#
$version = '2.2.0-201';
$build = '90315-1009';
$version = '2.2.0-202';
$build = '90320-0309';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=60;
$one_mysql_log=0;
@@ -2241,7 +2242,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
var campaign_am_message_exten = '<? echo $campaign_am_message_exten ?>';
var park_on_extension = '<? echo $VICIDiaL_park_on_extension ?>';
var park_count=0;
var park_refresh=0;
var customerparked=0;
var check_n = 0;
var conf_check_recheck = 0;
@@ -4792,7 +4792,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
// ################################################################################
// Set the client to READY and start looking for calls (VDADready, VDADpause)
function AutoDial_ReSume_PauSe(taskaction,taskagentlog)
function AutoDial_ReSume_PauSe(taskaction,taskagentlog,taskwrapup)
{
if (taskaction == 'VDADready')
{
@@ -4860,7 +4860,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
}
if (xmlhttp)
{
autoDiaLready_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=" + taskaction + "&user=" + user + "&pass=" + pass + "&stage=" + VDRP_stage + "&agent_log_id=" + agent_log_id + "&agent_log=" + taskagentlog + "&campaign=" + campaign;
autoDiaLready_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=" + taskaction + "&user=" + user + "&pass=" + pass + "&stage=" + VDRP_stage + "&agent_log_id=" + agent_log_id + "&agent_log=" + taskagentlog + "&wrapup=" + taskwrapup + "&campaign=" + campaign;
xmlhttp.open('POST', 'vdc_db_query.php');
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
xmlhttp.send(autoDiaLready_query);
@@ -7498,10 +7498,6 @@ else
{
// check_for_live_calls();
check_s = check_n.toString();
if ( (park_refresh > 0) && (check_s.match(/0$|5$/)) )
{
// parked_calls_display_refresh();
}
}
if (wrapup_seconds > 0)
{
@@ -7516,6 +7512,7 @@ else
if (auto_dial_level != '0')
{
AutoDialWaiting = 0;
// alert('wrapup pause');
AutoDial_ReSume_PauSe("VDADpause");
// document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML;
}
@@ -7531,7 +7528,8 @@ else
if (auto_dial_level != '0')
{
AutoDialWaiting = 1;
AutoDial_ReSume_PauSe("VDADready");
// alert('wrapup ready');
AutoDial_ReSume_PauSe("VDADready","NEW_ID","WRAPUP");
// document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready;
}
}
+15 -2
View File
@@ -1645,11 +1645,12 @@ $dialplan_entry = ereg_replace(";","",$dialplan_entry);
# 90309-0059 - Changed logging to admin_server_log
# 90310-2203 - Added export_reports option for call activity report data exports
# 90315-1010 - Changed revision for new trunk 2.2.0
# 90320-0424 - Fixed several small bugs conf records group alias and permissions
#
# 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.2.0-172';
$build = '90315-1010';
$admin_version = '2.2.0-174';
$build = '90320-0424';
$STARTtime = date("U");
$SQLdate = date("Y-m-d H:i:s");
@@ -7892,6 +7893,9 @@ if ($ADD==21111111111)
$stmt="INSERT INTO phones (extension,dialplan_number,voicemail_id,phone_ip,computer_ip,server_ip,login,pass,status,active,phone_type,fullname,company,picture,protocol,local_gmt,outbound_cid) values('$extension','$dialplan_number','$voicemail_id','$phone_ip','$computer_ip','$server_ip','$login','$pass','$status','$active','$phone_type','$fullname','$company','$picture','$protocol','$local_gmt','$outbound_cid');";
$rslt=mysql_query($stmt, $link);
$stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';";
$rslt=mysql_query($stmtA, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
@@ -8015,6 +8019,9 @@ if ($ADD==211111111111)
$stmt="INSERT INTO servers (server_id,server_description,server_ip,active,asterisk_version) values('$server_id','$server_description','$server_ip','$active','$asterisk_version');";
$rslt=mysql_query($stmt, $link);
$stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';";
$rslt=mysql_query($stmtA, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
@@ -8145,6 +8152,9 @@ if ($ADD==241111111111)
$stmt="INSERT INTO vicidial_server_carriers (carrier_id,carrier_name,registration_string,template_id,account_entry,protocol,globals_string,dialplan_entry,server_ip,active) values('$carrier_id','$carrier_name','$registration_string','$template_id','$account_entry','$protocol','$globals_string','$dialplan_entry','$server_ip','N');";
$rslt=mysql_query($stmt, $link);
$stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';";
$rslt=mysql_query($stmtA, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);
@@ -12411,6 +12421,9 @@ if ($ADD==61111111111)
$stmt="DELETE from phones where extension='$extension' and server_ip='$server_ip' limit 1;";
$rslt=mysql_query($stmt, $link);
$stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';";
$rslt=mysql_query($stmtA, $link);
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log);