Added lead search of archived leads table if present.

Added QueueMetrics 13.04 support with call hold records
minor code cleanup in several scripts

git-svn-id: svn://192.168.202.10@2026 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2013-09-27 03:09:14 +00:00
parent 5b8d528d31
commit 0c39b60866
11 changed files with 455 additions and 333 deletions
+4
View File
@@ -148,6 +148,10 @@ OTHER CHANGES:
CELLPHONE_USA_TCPA_FCC_COMPLAINCE.txt file for more detailed information CELLPHONE_USA_TCPA_FCC_COMPLAINCE.txt file for more detailed information
on this feature. on this feature.
18. Added lead search of archived leads table if present.
19. Added QueueMetrics 13.04 support with call hold records
+6 -6
View File
@@ -353,9 +353,9 @@ CREATE INDEX call_id on queue_log(call_id);
OpenSuSE 11.1 installation instructions: OpenSuSE 11.1 to 11.3 installation instructions:
How to install Queue Metrics on OpenSuSE v.11.1 (32 or 64 bit) with a system that was installed with the ViciDial Group install script. Run them in this order to avoid funky java script bugs :D How to install Queue Metrics on OpenSuSE v.11.1 to v 11.3 (32 or 64 bit) with a system that was installed with the ViciDial Group install script. Run them in this order to avoid funky java script bugs :D
1) Type: zypper in tomcat6 tomcat6-webapps 1) Type: zypper in tomcat6 tomcat6-webapps
- Say yes to install, and say yes to license - Say yes to install, and say yes to license
@@ -364,12 +364,12 @@ How to install Queue Metrics on OpenSuSE v.11.1 (32 or 64 bit) with a system tha
- Say yes to install, and say yes to license - Say yes to install, and say yes to license
3) cd /usr/src 3) cd /usr/src
4) wget http://queuemetrics.com/download/QueueMetrics-1.6.0.1-trial.tar.gz 4) wget http://queuemetrics.com/download/QueueMetrics-13.04.2-trial.tar.gz
5) mkdir tars (incase it doesn't exist) 5) mkdir tars (incase it doesn't exist)
6) tar xvfz QueueMetrics-1.6.0.1-trial.tar.gz 6) tar xvfz QueueMetrics-13.04.2-trial.tar.gz
7) mv QueueMetrics-1.6.0.1-trial.tar.gz ./tars/ 7) mv QueueMetrics-13.04.2-trial.tar.gz ./tars/
8) mkdir /srv/tomcat6/webapps/QM 8) mkdir /srv/tomcat6/webapps/QM
9) cp -r queuemetrics-1.6.0.1/* /srv/tomcat6/webapps/QM/ 9) cp -r queuemetrics-13.04.2/* /srv/tomcat6/webapps/QM/
10) zypper in mysql-connector-java 10) zypper in mysql-connector-java
11) cp /usr/share/java/mysql-connector-java.jar /srv/tomcat6/webapps/QM/WEB-INF/lib/ 11) cp /usr/share/java/mysql-connector-java.jar /srv/tomcat6/webapps/QM/WEB-INF/lib/
12) chkconfig tomcat6 on 12) chkconfig tomcat6 on
+3 -2
View File
@@ -1524,7 +1524,8 @@ level_8_disable_add ENUM('0','1') default '0',
pass_hash_enabled ENUM('0','1') default '0', pass_hash_enabled ENUM('0','1') default '0',
pass_key VARCHAR(100) default '', pass_key VARCHAR(100) default '',
pass_cost TINYINT(2) UNSIGNED default '2', pass_cost TINYINT(2) UNSIGNED default '2',
disable_auto_dial ENUM('0','1') default '0' disable_auto_dial ENUM('0','1') default '0',
queuemetrics_record_hold ENUM('0','1') default '0'
) ENGINE=MyISAM; ) ENGINE=MyISAM;
CREATE TABLE vicidial_campaigns_list_mix ( CREATE TABLE vicidial_campaigns_list_mix (
@@ -3212,4 +3213,4 @@ UPDATE vicidial_configuration set value='1766' where name='qc_database_version';
UPDATE system_settings set vdc_agent_api_active='1'; UPDATE system_settings set vdc_agent_api_active='1';
UPDATE system_settings SET db_schema_version='1356',db_schema_update_date=NOW(); UPDATE system_settings SET db_schema_version='1357',db_schema_update_date=NOW();
+4
View File
@@ -110,3 +110,7 @@ index (start_time)
) ENGINE=MyISAM; ) ENGINE=MyISAM;
UPDATE system_settings SET db_schema_version='1356',db_schema_update_date=NOW() where db_schema_version < 1356; UPDATE system_settings SET db_schema_version='1356',db_schema_update_date=NOW() where db_schema_version < 1356;
ALTER TABLE system_settings ADD queuemetrics_record_hold ENUM('0','1') default '0';
UPDATE system_settings SET db_schema_version='1357',db_schema_update_date=NOW() where db_schema_version < 1357;
@@ -230,6 +230,8 @@ Add inbound and outbound holiday rule||
Add outbound holiday rule|| Add outbound holiday rule||
If set to N, the calls will queue up, even if there are no agents logged in and set to take calls from this in-group|| If set to N, the calls will queue up, even if there are no agents logged in and set to take calls from this in-group||
Active Voicemail Server is not set|| Active Voicemail Server is not set||
QueueMetrics Hold Call Log||
This option, if enabled, will log when a customer is put on hold and taken off hold in the newer record_tags QM table. Default is 0 for disabled||
########################## CHANGES TO EXISTING PHRASES IN ADMIN TRANSLATION ########################## CHANGES TO EXISTING PHRASES IN ADMIN TRANSLATION
+338 -246
View File
@@ -117,12 +117,13 @@
# 130603-2205 - Added login lockout for 15 minutes after 10 failed logins, and other security fixes # 130603-2205 - Added login lockout for 15 minutes after 10 failed logins, and other security fixes
# 130705-1521 - Added optional encrypted passwords compatibility # 130705-1521 - Added optional encrypted passwords compatibility
# 130802-1021 - Changed to PHP mysqli functions # 130802-1021 - Changed to PHP mysqli functions
# 130926-1755 - Added queuemetrics_record_hold option
# #
$version = '2.8-64'; $version = '2.8-65';
$build = '130802-1021'; $build = '130926-1755';
$mel=1; # Mysql Error Log enabled = 1 $mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=119; $mysql_log_count=127;
$one_mysql_log=0; $one_mysql_log=0;
require_once("dbconnect_mysqli.php"); require_once("dbconnect_mysqli.php");
@@ -897,71 +898,84 @@ if ($ACTION=="RedirectToPark")
} }
else else
{ {
if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} if ($stage!="2NDXfeR")
$stmt = "INSERT INTO parked_channels values('$channel','$server_ip','$CalLCID','$extenName','$parkedby','$NOW_TIME');";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02025',$user,$server_ip,$session_name,$one_mysql_log);}
$ACTION="Redirect";
$stmt = "INSERT INTO park_log SET uniqueid='$uniqueid',status='PARKED',channel='$channel',channel_group='$campaign',server_ip='$server_ip',parked_time='$NOW_TIME',parked_sec=0,extension='$CalLCID',user='$user',lead_id='$lead_id';";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02098',$user,$server_ip,$session_name,$one_mysql_log);}
#############################################
##### START 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_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02099',$user,$server_ip,$session_name,$one_mysql_log);}
if ($format=='debug') {echo "\n<!-- $rowx[0]|$stmt -->";}
$qm_conf_ct = mysqli_num_rows($rslt);
$i=0;
while ($i < $qm_conf_ct)
{ {
$row=mysqli_fetch_row($rslt); if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;}
$enable_queuemetrics_logging = $row[0]; $stmt = "INSERT INTO parked_channels values('$channel','$server_ip','$CalLCID','$extenName','$parkedby','$NOW_TIME');";
$queuemetrics_server_ip = $row[1]; if ($format=='debug') {echo "\n<!-- $stmt -->";}
$queuemetrics_dbname = $row[2]; $rslt=mysql_to_mysqli($stmt, $link);
$queuemetrics_login = $row[3]; if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02025',$user,$server_ip,$session_name,$one_mysql_log);}
$queuemetrics_pass = $row[4]; $ACTION="Redirect";
$queuemetrics_log_id = $row[5];
$i++;
}
##### END QUEUEMETRICS LOGGING LOOKUP #####
###########################################
if ($enable_queuemetrics_logging > 0)
{
$linkB=mysqli_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass");
mysqli_select_db($linkB, "$queuemetrics_dbname");
$time_id=0; $stmt = "INSERT INTO park_log SET uniqueid='$uniqueid',status='PARKED',channel='$channel',channel_group='$campaign',server_ip='$server_ip',parked_time='$NOW_TIME',parked_sec=0,extension='$CalLCID',user='$user',lead_id='$lead_id';";
$stmt="SELECT time_id,queue,agent from queue_log where call_id='$CalLCID' and verb='CONNECT' order by time_id desc limit 1;"; if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_to_mysqli($stmt, $linkB); $rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02100',$user,$server_ip,$session_name,$one_mysql_log);} if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02098',$user,$server_ip,$session_name,$one_mysql_log);}
$VAC_eq_ct = mysqli_num_rows($rslt);
if ($VAC_eq_ct > 0)
#############################################
##### START QUEUEMETRICS LOGGING LOOKUP #####
$stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,queuemetrics_record_hold FROM system_settings;";
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02099',$user,$server_ip,$session_name,$one_mysql_log);}
if ($format=='debug') {echo "\n<!-- $rowx[0]|$stmt -->";}
$qm_conf_ct = mysqli_num_rows($rslt);
$i=0;
while ($i < $qm_conf_ct)
{ {
$row=mysqli_fetch_row($rslt); $row=mysqli_fetch_row($rslt);
$time_id = $row[0]; $enable_queuemetrics_logging = $row[0];
$queue = $row[1]; $queuemetrics_server_ip = $row[1];
$agent = $row[2]; $queuemetrics_dbname = $row[2];
$queuemetrics_login = $row[3];
$queuemetrics_pass = $row[4];
$queuemetrics_log_id = $row[5];
$queuemetrics_record_hold = $row[6];
$i++;
} }
$StarTtime = date("U"); ##### END QUEUEMETRICS LOGGING LOOKUP #####
if ($time_id > 100000) ###########################################
{$secondS = ($StarTtime - $time_id);} if ($enable_queuemetrics_logging > 0)
if ($VAC_eq_ct > 0)
{ {
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$CalLCID',queue='$queue',agent='Agent/$user',verb='CALLERONHOLD',data1='PARK',serverid='$queuemetrics_log_id';"; $linkB=mysqli_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass");
mysqli_select_db($linkB, "$queuemetrics_dbname");
$time_id=0;
$secondS=0;
$stmt="SELECT time_id,queue,agent from queue_log where call_id='$CalLCID' and verb='CONNECT' order by time_id desc limit 1;";
$rslt=mysql_to_mysqli($stmt, $linkB); $rslt=mysql_to_mysqli($stmt, $linkB);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02101',$user,$server_ip,$session_name,$one_mysql_log);} if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02100',$user,$server_ip,$session_name,$one_mysql_log);}
$affected_rows = mysqli_affected_rows($linkB); $VAC_eq_ct = mysqli_num_rows($rslt);
if ($format=='debug') {echo "\n<!-- $affected_rows|$stmt -->";} if ($VAC_eq_ct > 0)
{
$row=mysqli_fetch_row($rslt);
$time_id = $row[0];
$queue = $row[1];
$agent = $row[2];
}
$StarTtime = date("U");
if ($time_id > 100000)
{$secondS = ($StarTtime - $time_id);}
if ($VAC_eq_ct > 0)
{
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$CalLCID',queue='$queue',agent='Agent/$user',verb='CALLERONHOLD',data1='PARK',serverid='$queuemetrics_log_id';";
$rslt=mysql_to_mysqli($stmt, $linkB);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02101',$user,$server_ip,$session_name,$one_mysql_log);}
$affected_rows = mysqli_affected_rows($linkB);
if ($format=='debug') {echo "\n<!-- $affected_rows|$stmt -->";}
if ($queuemetrics_record_hold > 0)
{
$stmt = "INSERT INTO record_tags SET call_id='$CalLCID',record_title='Hold',visible='1',color='255',time='$secondS',duration='0',message='$user|$NOW_TIME';";
$rslt=mysql_to_mysqli($stmt, $linkB);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02120',$user,$server_ip,$session_name,$one_mysql_log);}
$affected_rows = mysqli_affected_rows($linkB);
if ($format=='debug') {echo "\n<!-- $affected_rows|$stmt -->";}
}
}
} }
} }
# $fp = fopen ("./vicidial_debug.txt", "a"); # $fp = fopen ("./vicidial_debug.txt", "a");
# fwrite ($fp, "$NOW_TIME|MS_LOG_0|$queryCID|$stmt|\n"); # fwrite ($fp, "$NOW_TIME|MS_LOG_0|$queryCID|$stmt|\n");
# fclose($fp); # fclose($fp);
@@ -988,77 +1002,109 @@ if ($ACTION=="RedirectFromPark")
} }
else else
{ {
if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} if ($stage!="2NDXfeR")
$stmt = "DELETE FROM parked_channels where server_ip='$server_ip' and channel='$channel';";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02026',$user,$server_ip,$session_name,$one_mysql_log);}
$ACTION="Redirect";
$parked_sec=0;
$stmt = "SELECT UNIX_TIMESTAMP(parked_time) FROM park_log where uniqueid='$uniqueid' and server_ip='$server_ip' and extension='$CalLCID' and (parked_sec < 1 or grab_time is NULL) order by parked_time desc limit 1;";
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02102',$user,$server_ip,$session_name,$one_mysql_log);}
$VAC_pl_ct = mysqli_num_rows($rslt);
if ($VAC_pl_ct > 0)
{ {
$row=mysqli_fetch_row($rslt); if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;}
$parked_sec = ($StarTtime - $row[0]); $stmt = "DELETE FROM parked_channels where server_ip='$server_ip' and channel='$channel';";
$stmt = "UPDATE park_log SET status='GRABBED',grab_time='$NOW_TIME',parked_sec='$parked_sec' where uniqueid='$uniqueid' and server_ip='$server_ip' and extension='$CalLCID' order by parked_time desc limit 1;";
if ($format=='debug') {echo "\n<!-- $stmt -->";} if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_to_mysqli($stmt, $link); $rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02103',$user,$server_ip,$session_name,$one_mysql_log);} if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02026',$user,$server_ip,$session_name,$one_mysql_log);}
$ACTION="Redirect";
############################################# $parked_sec=0;
##### START QUEUEMETRICS LOGGING LOOKUP ##### $stmt = "SELECT UNIX_TIMESTAMP(parked_time) FROM park_log where uniqueid='$uniqueid' and server_ip='$server_ip' and extension='$CalLCID' and (parked_sec < 1 or grab_time is NULL) order by parked_time desc limit 1;";
$stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;";
$rslt=mysql_to_mysqli($stmt, $link); $rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02104',$user,$server_ip,$session_name,$one_mysql_log);} if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02102',$user,$server_ip,$session_name,$one_mysql_log);}
if ($format=='debug') {echo "\n<!-- $rowx[0]|$stmt -->";} $VAC_pl_ct = mysqli_num_rows($rslt);
$qm_conf_ct = mysqli_num_rows($rslt); if ($VAC_pl_ct > 0)
$i=0;
while ($i < $qm_conf_ct)
{ {
$row=mysqli_fetch_row($rslt); $row=mysqli_fetch_row($rslt);
$enable_queuemetrics_logging = $row[0]; $parked_sec = ($StarTtime - $row[0]);
$queuemetrics_server_ip = $row[1];
$queuemetrics_dbname = $row[2];
$queuemetrics_login = $row[3];
$queuemetrics_pass = $row[4];
$queuemetrics_log_id = $row[5];
$i++;
}
##### END QUEUEMETRICS LOGGING LOOKUP #####
###########################################
if ($enable_queuemetrics_logging > 0)
{
$linkB=mysqli_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass");
mysqli_select_db($linkB, "$queuemetrics_dbname");
$time_id=0; $stmt = "UPDATE park_log SET status='GRABBED',grab_time='$NOW_TIME',parked_sec='$parked_sec' where uniqueid='$uniqueid' and server_ip='$server_ip' and extension='$CalLCID' order by parked_time desc limit 1;";
$stmt="SELECT time_id,queue,agent from queue_log where call_id='$CalLCID' and verb='CONNECT' order by time_id desc limit 1;"; if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_to_mysqli($stmt, $linkB); $rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02105',$user,$server_ip,$session_name,$one_mysql_log);} if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02103',$user,$server_ip,$session_name,$one_mysql_log);}
$VAC_eq_ct = mysqli_num_rows($rslt);
if ($VAC_eq_ct > 0) #############################################
##### START QUEUEMETRICS LOGGING LOOKUP #####
$stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,queuemetrics_record_hold FROM system_settings;";
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02104',$user,$server_ip,$session_name,$one_mysql_log);}
if ($format=='debug') {echo "\n<!-- $rowx[0]|$stmt -->";}
$qm_conf_ct = mysqli_num_rows($rslt);
$i=0;
while ($i < $qm_conf_ct)
{ {
$row=mysqli_fetch_row($rslt); $row=mysqli_fetch_row($rslt);
$time_id = $row[0]; $enable_queuemetrics_logging = $row[0];
$queue = $row[1]; $queuemetrics_server_ip = $row[1];
$agent = $row[2]; $queuemetrics_dbname = $row[2];
$queuemetrics_login = $row[3];
$queuemetrics_pass = $row[4];
$queuemetrics_log_id = $row[5];
$queuemetrics_record_hold = $row[6];
$i++;
} }
$StarTtime = date("U"); ##### END QUEUEMETRICS LOGGING LOOKUP #####
if ($time_id > 100000) ###########################################
{$secondS = ($StarTtime - $time_id);} if ($enable_queuemetrics_logging > 0)
if ($VAC_eq_ct > 0)
{ {
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$CalLCID',queue='$queue',agent='Agent/$user',verb='CALLEROFFHOLD',data1='$parked_sec',data2='PARK',serverid='$queuemetrics_log_id';"; $linkB=mysqli_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass");
mysqli_select_db($linkB, "$queuemetrics_dbname");
$time_id=0;
$secondS=0;
$stmt="SELECT time_id,queue,agent from queue_log where call_id='$CalLCID' and verb='CONNECT' order by time_id desc limit 1;";
$rslt=mysql_to_mysqli($stmt, $linkB); $rslt=mysql_to_mysqli($stmt, $linkB);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02106',$user,$server_ip,$session_name,$one_mysql_log);} if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02105',$user,$server_ip,$session_name,$one_mysql_log);}
$affected_rows = mysqli_affected_rows($linkB); $VAC_eq_ct = mysqli_num_rows($rslt);
if ($format=='debug') {echo "\n<!-- $affected_rows|$stmt -->";} if ($VAC_eq_ct > 0)
{
$row=mysqli_fetch_row($rslt);
$time_id = $row[0];
$queue = $row[1];
$agent = $row[2];
}
$StarTtime = date("U");
if ($time_id > 100000)
{$secondS = ($StarTtime - $time_id);}
if ($VAC_eq_ct > 0)
{
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$CalLCID',queue='$queue',agent='Agent/$user',verb='CALLEROFFHOLD',data1='$parked_sec',data2='PARK',serverid='$queuemetrics_log_id';";
$rslt=mysql_to_mysqli($stmt, $linkB);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02106',$user,$server_ip,$session_name,$one_mysql_log);}
$affected_rows = mysqli_affected_rows($linkB);
if ($format=='debug') {echo "\n<!-- $affected_rows|$stmt -->";}
if ($queuemetrics_record_hold > 0)
{
$hold_start_time_id=0;
$stmt="SELECT time from record_tags where call_id='$CalLCID' and record_title='Hold' and duration=0;";
$rslt=mysql_to_mysqli($stmt, $linkB);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02121',$user,$server_ip,$session_name,$one_mysql_log);}
$VAC_eq_ct = mysqli_num_rows($rslt);
if ($VAC_eq_ct > 0)
{
$row=mysqli_fetch_row($rslt);
$hold_start_time_id = $row[0];
}
$total_hold_time = ($secondS - $hold_start_time_id);
$stmt = "INSERT INTO record_tags SET call_id='$CalLCID',record_title='Unhold',visible='1',color='255',time='$secondS',duration='$total_hold_time',message='$user|$NOW_TIME';";
$rslt=mysql_to_mysqli($stmt, $linkB);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02122',$user,$server_ip,$session_name,$one_mysql_log);}
$affected_rows = mysqli_affected_rows($linkB);
if ($format=='debug') {echo "\n<!-- $affected_rows|$stmt -->";}
$stmt = "UPDATE record_tags SET duration='$total_hold_time' where call_id='$CalLCID' and record_title='Hold' and duration=0;";
$rslt=mysql_to_mysqli($stmt, $linkB);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02123',$user,$server_ip,$session_name,$one_mysql_log);}
$affected_rows = mysqli_affected_rows($linkB);
if ($format=='debug') {echo "\n<!-- $affected_rows|$stmt -->";}
}
}
} }
} }
} }
@@ -1087,77 +1133,91 @@ if ($ACTION=="RedirectToParkIVR")
} }
else else
{ {
if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} if ($stage!="2NDXfeR")
$stmt = "INSERT INTO parked_channels values('$channel','$server_ip','$CalLCID','$extenName','$parkedby','$NOW_TIME');";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02025',$user,$server_ip,$session_name,$one_mysql_log);}
$ACTION="Redirect";
$stmt = "UPDATE vicidial_auto_calls SET extension='PARK_IVR' where callerid='$CalLCID' limit 1;";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02088',$user,$server_ip,$session_name,$one_mysql_log);}
$stmt = "INSERT INTO park_log SET uniqueid='$uniqueid',status='IVRPARKED',channel='$channel',channel_group='$campaign',server_ip='$server_ip',parked_time='$NOW_TIME',parked_sec=0,extension='$CalLCID',user='$user',lead_id='$lead_id';";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02107',$user,$server_ip,$session_name,$one_mysql_log);}
#############################################
##### START 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_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02108',$user,$server_ip,$session_name,$one_mysql_log);}
if ($format=='debug') {echo "\n<!-- $rowx[0]|$stmt -->";}
$qm_conf_ct = mysqli_num_rows($rslt);
$i=0;
while ($i < $qm_conf_ct)
{ {
$row=mysqli_fetch_row($rslt); if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;}
$enable_queuemetrics_logging = $row[0]; $stmt = "INSERT INTO parked_channels values('$channel','$server_ip','$CalLCID','$extenName','$parkedby','$NOW_TIME');";
$queuemetrics_server_ip = $row[1]; if ($format=='debug') {echo "\n<!-- $stmt -->";}
$queuemetrics_dbname = $row[2]; $rslt=mysql_to_mysqli($stmt, $link);
$queuemetrics_login = $row[3]; if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02025',$user,$server_ip,$session_name,$one_mysql_log);}
$queuemetrics_pass = $row[4]; $ACTION="Redirect";
$queuemetrics_log_id = $row[5];
$i++;
}
##### END QUEUEMETRICS LOGGING LOOKUP #####
###########################################
if ($enable_queuemetrics_logging > 0)
{
$linkB=mysqli_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass");
mysqli_select_db($linkB, "$queuemetrics_dbname");
$time_id=0; $stmt = "UPDATE vicidial_auto_calls SET extension='PARK_IVR' where callerid='$CalLCID' limit 1;";
$stmt="SELECT time_id,queue,agent from queue_log where call_id='$CalLCID' and verb='CONNECT' order by time_id desc limit 1;"; if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_to_mysqli($stmt, $linkB); $rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02109',$user,$server_ip,$session_name,$one_mysql_log);} if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02088',$user,$server_ip,$session_name,$one_mysql_log);}
$VAC_eq_ct = mysqli_num_rows($rslt);
if ($VAC_eq_ct > 0) $stmt = "INSERT INTO park_log SET uniqueid='$uniqueid',status='IVRPARKED',channel='$channel',channel_group='$campaign',server_ip='$server_ip',parked_time='$NOW_TIME',parked_sec=0,extension='$CalLCID',user='$user',lead_id='$lead_id';";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02107',$user,$server_ip,$session_name,$one_mysql_log);}
#############################################
##### START QUEUEMETRICS LOGGING LOOKUP #####
$stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,queuemetrics_record_hold FROM system_settings;";
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02108',$user,$server_ip,$session_name,$one_mysql_log);}
if ($format=='debug') {echo "\n<!-- $rowx[0]|$stmt -->";}
$qm_conf_ct = mysqli_num_rows($rslt);
$i=0;
while ($i < $qm_conf_ct)
{ {
$row=mysqli_fetch_row($rslt); $row=mysqli_fetch_row($rslt);
$time_id = $row[0]; $enable_queuemetrics_logging = $row[0];
$queue = $row[1]; $queuemetrics_server_ip = $row[1];
$agent = $row[2]; $queuemetrics_dbname = $row[2];
$queuemetrics_login = $row[3];
$queuemetrics_pass = $row[4];
$queuemetrics_log_id = $row[5];
$queuemetrics_record_hold = $row[6];
$i++;
} }
$StarTtime = date("U"); ##### END QUEUEMETRICS LOGGING LOOKUP #####
if ($time_id > 100000) ###########################################
{$secondS = ($StarTtime - $time_id);} if ($enable_queuemetrics_logging > 0)
if ($VAC_eq_ct > 0)
{ {
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$CalLCID',queue='$queue',agent='Agent/$user',verb='CALLERONHOLD',data1='IVRPARK',serverid='$queuemetrics_log_id';"; $linkB=mysqli_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass");
mysqli_select_db($linkB, "$queuemetrics_dbname");
$time_id=0;
$secondS=0;
$stmt="SELECT time_id,queue,agent from queue_log where call_id='$CalLCID' and verb='CONNECT' order by time_id desc limit 1;";
$rslt=mysql_to_mysqli($stmt, $linkB); $rslt=mysql_to_mysqli($stmt, $linkB);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02110',$user,$server_ip,$session_name,$one_mysql_log);} if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02109',$user,$server_ip,$session_name,$one_mysql_log);}
$affected_rows = mysqli_affected_rows($linkB); $VAC_eq_ct = mysqli_num_rows($rslt);
if ($format=='debug') {echo "\n<!-- $affected_rows|$stmt -->";} if ($VAC_eq_ct > 0)
{
$row=mysqli_fetch_row($rslt);
$time_id = $row[0];
$queue = $row[1];
$agent = $row[2];
}
$StarTtime = date("U");
if ($time_id > 100000)
{$secondS = ($StarTtime - $time_id);}
if ($VAC_eq_ct > 0)
{
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$CalLCID',queue='$queue',agent='Agent/$user',verb='CALLERONHOLD',data1='IVRPARK',serverid='$queuemetrics_log_id';";
$rslt=mysql_to_mysqli($stmt, $linkB);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02110',$user,$server_ip,$session_name,$one_mysql_log);}
$affected_rows = mysqli_affected_rows($linkB);
if ($format=='debug') {echo "\n<!-- $affected_rows|$stmt -->";}
if ($queuemetrics_record_hold > 0)
{
$stmt = "INSERT INTO record_tags SET call_id='$CalLCID',record_title='Hold',visible='1',color='255',time='$secondS',duration='0',message='$user|$NOW_TIME';";
$rslt=mysql_to_mysqli($stmt, $linkB);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02124',$user,$server_ip,$session_name,$one_mysql_log);}
$affected_rows = mysqli_affected_rows($linkB);
if ($format=='debug') {echo "\n<!-- $affected_rows|$stmt -->";}
}
}
} }
# $fp = fopen ("./vicidial_debug.txt", "a");
# fwrite ($fp, "$NOW_TIME|MS_LOG_0|$queryCID|$stmt|\n");
# fclose($fp);
} }
# $fp = fopen ("./vicidial_debug.txt", "a");
# fwrite ($fp, "$NOW_TIME|MS_LOG_0|$queryCID|$stmt|\n");
# fclose($fp);
} }
$stmt="UPDATE vicidial_live_agents SET external_park='' where user='$user';"; $stmt="UPDATE vicidial_live_agents SET external_park='' where user='$user';";
@@ -1181,91 +1241,123 @@ if ($ACTION=="RedirectFromParkIVR")
} }
else else
{ {
if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} if ($stage!="2NDXfeR")
$stmt = "DELETE FROM parked_channels where server_ip='$server_ip' and channel='$channel';";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02026',$user,$server_ip,$session_name,$one_mysql_log);}
$ACTION="Redirect";
$stmt = "UPDATE vicidial_auto_calls SET extension='' where callerid='$CalLCID' limit 1;";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02090',$user,$server_ip,$session_name,$one_mysql_log);}
$parked_sec=0;
$stmt = "SELECT UNIX_TIMESTAMP(parked_time) FROM park_log where uniqueid='$uniqueid' and server_ip='$server_ip' and extension='$CalLCID' and (parked_sec < 1 or grab_time is NULL) order by parked_time desc limit 1;";
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02111',$user,$server_ip,$session_name,$one_mysql_log);}
$VAC_pl_ct = mysqli_num_rows($rslt);
if ($VAC_pl_ct > 0)
{ {
$row=mysqli_fetch_row($rslt); if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;}
$parked_sec = ($StarTtime - $row[0]); $stmt = "DELETE FROM parked_channels where server_ip='$server_ip' and channel='$channel';";
$stmt = "UPDATE park_log SET status='GRABBEDIVR',grab_time='$NOW_TIME',parked_sec='$parked_sec' where uniqueid='$uniqueid' and server_ip='$server_ip' and extension='$CalLCID' order by parked_time desc limit 1;";
if ($format=='debug') {echo "\n<!-- $stmt -->";} if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_to_mysqli($stmt, $link); $rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02112',$user,$server_ip,$session_name,$one_mysql_log);} if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02026',$user,$server_ip,$session_name,$one_mysql_log);}
$ACTION="Redirect";
############################################# $stmt = "UPDATE vicidial_auto_calls SET extension='' where callerid='$CalLCID' limit 1;";
##### START QUEUEMETRICS LOGGING LOOKUP ##### if ($format=='debug') {echo "\n<!-- $stmt -->";}
$stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;";
$rslt=mysql_to_mysqli($stmt, $link); $rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02113',$user,$server_ip,$session_name,$one_mysql_log);} if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02090',$user,$server_ip,$session_name,$one_mysql_log);}
if ($format=='debug') {echo "\n<!-- $rowx[0]|$stmt -->";}
$qm_conf_ct = mysqli_num_rows($rslt); $parked_sec=0;
$i=0; $stmt = "SELECT UNIX_TIMESTAMP(parked_time) FROM park_log where uniqueid='$uniqueid' and server_ip='$server_ip' and extension='$CalLCID' and (parked_sec < 1 or grab_time is NULL) order by parked_time desc limit 1;";
while ($i < $qm_conf_ct) $rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02111',$user,$server_ip,$session_name,$one_mysql_log);}
$VAC_pl_ct = mysqli_num_rows($rslt);
if ($VAC_pl_ct > 0)
{ {
$row=mysqli_fetch_row($rslt); $row=mysqli_fetch_row($rslt);
$enable_queuemetrics_logging = $row[0]; $parked_sec = ($StarTtime - $row[0]);
$queuemetrics_server_ip = $row[1];
$queuemetrics_dbname = $row[2];
$queuemetrics_login = $row[3];
$queuemetrics_pass = $row[4];
$queuemetrics_log_id = $row[5];
$i++;
}
##### END QUEUEMETRICS LOGGING LOOKUP #####
###########################################
if ($enable_queuemetrics_logging > 0)
{
$linkB=mysqli_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass");
mysqli_select_db($linkB, "$queuemetrics_dbname");
$time_id=0; $stmt = "UPDATE park_log SET status='GRABBEDIVR',grab_time='$NOW_TIME',parked_sec='$parked_sec' where uniqueid='$uniqueid' and server_ip='$server_ip' and extension='$CalLCID' order by parked_time desc limit 1;";
$stmt="SELECT time_id,queue,agent from queue_log where call_id='$CalLCID' and verb='CONNECT' order by time_id desc limit 1;"; if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_to_mysqli($stmt, $linkB); $rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02114',$user,$server_ip,$session_name,$one_mysql_log);} if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02112',$user,$server_ip,$session_name,$one_mysql_log);}
$VAC_eq_ct = mysqli_num_rows($rslt);
if ($VAC_eq_ct > 0) #############################################
##### START QUEUEMETRICS LOGGING LOOKUP #####
$stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,queuemetrics_record_hold FROM system_settings;";
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02113',$user,$server_ip,$session_name,$one_mysql_log);}
if ($format=='debug') {echo "\n<!-- $rowx[0]|$stmt -->";}
$qm_conf_ct = mysqli_num_rows($rslt);
$i=0;
while ($i < $qm_conf_ct)
{ {
$row=mysqli_fetch_row($rslt); $row=mysqli_fetch_row($rslt);
$time_id = $row[0]; $enable_queuemetrics_logging = $row[0];
$queue = $row[1]; $queuemetrics_server_ip = $row[1];
$agent = $row[2]; $queuemetrics_dbname = $row[2];
$queuemetrics_login = $row[3];
$queuemetrics_pass = $row[4];
$queuemetrics_log_id = $row[5];
$queuemetrics_record_hold = $row[6];
$i++;
} }
$StarTtime = date("U"); ##### END QUEUEMETRICS LOGGING LOOKUP #####
if ($time_id > 100000) ###########################################
{$secondS = ($StarTtime - $time_id);} if ($enable_queuemetrics_logging > 0)
if ($VAC_eq_ct > 0)
{ {
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$CalLCID',queue='$queue',agent='Agent/$user',verb='CALLEROFFHOLD',data1='$parked_sec',data2='IVRPARK',serverid='$queuemetrics_log_id';"; $linkB=mysqli_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass");
mysqli_select_db($linkB, "$queuemetrics_dbname");
$time_id=0;
$secondS=0;
$stmt="SELECT time_id,queue,agent from queue_log where call_id='$CalLCID' and verb='CONNECT' order by time_id desc limit 1;";
$rslt=mysql_to_mysqli($stmt, $linkB); $rslt=mysql_to_mysqli($stmt, $linkB);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02115',$user,$server_ip,$session_name,$one_mysql_log);} if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02114',$user,$server_ip,$session_name,$one_mysql_log);}
$affected_rows = mysqli_affected_rows($linkB); $VAC_eq_ct = mysqli_num_rows($rslt);
if ($format=='debug') {echo "\n<!-- $affected_rows|$stmt -->";} if ($VAC_eq_ct > 0)
{
$row=mysqli_fetch_row($rslt);
$time_id = $row[0];
$queue = $row[1];
$agent = $row[2];
}
$StarTtime = date("U");
if ($time_id > 100000)
{$secondS = ($StarTtime - $time_id);}
if ($VAC_eq_ct > 0)
{
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$CalLCID',queue='$queue',agent='Agent/$user',verb='CALLEROFFHOLD',data1='$parked_sec',data2='IVRPARK',serverid='$queuemetrics_log_id';";
$rslt=mysql_to_mysqli($stmt, $linkB);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02115',$user,$server_ip,$session_name,$one_mysql_log);}
$affected_rows = mysqli_affected_rows($linkB);
if ($format=='debug') {echo "\n<!-- $affected_rows|$stmt -->";}
if ($queuemetrics_record_hold > 0)
{
$hold_start_time_id=0;
$stmt="SELECT time from record_tags where call_id='$CalLCID' and record_title='Hold' and duration=0;";
$rslt=mysql_to_mysqli($stmt, $linkB);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02125',$user,$server_ip,$session_name,$one_mysql_log);}
$VAC_eq_ct = mysqli_num_rows($rslt);
if ($VAC_eq_ct > 0)
{
$row=mysqli_fetch_row($rslt);
$hold_start_time_id = $row[0];
}
$total_hold_time = ($secondS - $hold_start_time_id);
$stmt = "INSERT INTO record_tags SET call_id='$CalLCID',record_title='Unhold',visible='1',color='255',time='$secondS',duration='$total_hold_time',message='$user|$NOW_TIME';";
$rslt=mysql_to_mysqli($stmt, $linkB);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02126',$user,$server_ip,$session_name,$one_mysql_log);}
$affected_rows = mysqli_affected_rows($linkB);
if ($format=='debug') {echo "\n<!-- $affected_rows|$stmt -->";}
$stmt = "UPDATE record_tags SET duration='$total_hold_time' where call_id='$CalLCID' and record_title='Hold' and duration=0;";
$rslt=mysql_to_mysqli($stmt, $linkB);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'02127',$user,$server_ip,$session_name,$one_mysql_log);}
$affected_rows = mysqli_affected_rows($linkB);
if ($format=='debug') {echo "\n<!-- $affected_rows|$stmt -->";}
}
}
} }
} }
} }
} }
$stmt="UPDATE vicidial_live_agents SET external_park='' where user='$user';"; $stmt="UPDATE vicidial_live_agents SET external_park='' where user='$user';";
if ($format=='debug') {echo "\n<!-- $stmt -->";} if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_to_mysqli($stmt, $link); $rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02091',$user,$server_ip,$session_name,$one_mysql_log);} if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02091',$user,$server_ip,$session_name,$one_mysql_log);}
} }
+32 -32
View File
@@ -5524,42 +5524,42 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
delete xmlhttpXF; delete xmlhttpXF;
} }
// used to send second Redirect for manual dial calls // used to send second Redirect for manual dial calls
if ( (auto_dial_level == 0) && (taskvar != '3WAY') ) if ( (auto_dial_level == 0) && (taskvar != '3WAY') )
{ {
RedirecTxFEr = 1; RedirecTxFEr = 1;
var xmlhttpXF2=false; var xmlhttpXF2=false;
/*@cc_on @*/ /*@cc_on @*/
/*@if (@_jscript_version >= 5) /*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions. // JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects. // and security blocked creation of the objects.
try { try {
xmlhttpXF2 = new ActiveXObject("Msxml2.XMLHTTP"); xmlhttpXF2 = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) { } catch (e) {
try { try {
xmlhttpXF2 = new ActiveXObject("Microsoft.XMLHTTP"); xmlhttpXF2 = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) { } catch (E) {
xmlhttpXF2 = false; xmlhttpXF2 = false;
} }
} }
@end @*/ @end @*/
if (!xmlhttpXF2 && typeof XMLHttpRequest!='undefined') if (!xmlhttpXF2 && typeof XMLHttpRequest!='undefined')
{ {
xmlhttpXF2 = new XMLHttpRequest(); xmlhttpXF2 = new XMLHttpRequest();
} }
if (xmlhttpXF2) if (xmlhttpXF2)
{ {
xmlhttpXF2.open('POST', 'manager_send.php'); xmlhttpXF2.open('POST', 'manager_send.php');
xmlhttpXF2.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttpXF2.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
xmlhttpXF2.send(xferredirect_query + "&stage=2NDXfeR"); xmlhttpXF2.send(xferredirect_query + "&stage=2NDXfeR");
xmlhttpXF2.onreadystatechange = function() xmlhttpXF2.onreadystatechange = function()
{ {
if (xmlhttpXF2.readyState == 4 && xmlhttpXF2.status == 200) if (xmlhttpXF2.readyState == 4 && xmlhttpXF2.status == 200)
{ {
Nactiveext = null; Nactiveext = null;
Nactiveext = xmlhttpXF2.responseText; Nactiveext = xmlhttpXF2.responseText;
// alert(RedirecTxFEr + "|" + xmlhttpXF2.responseText); // alert(RedirecTxFEr + "|" + xmlhttpXF2.responseText);
} }
} }
delete xmlhttpXF2; delete xmlhttpXF2;
} }
+4 -27
View File
@@ -219,28 +219,15 @@ $list_string='|';
$list_ct = count($list); $list_ct = count($list);
while($i < $list_ct) while($i < $list_ct)
{ {
# if ( (preg_match("/ $list_campaigns[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/-ALL/",$LOGallowed_campaigns)) ) $list_string .= "$list[$i]|";
# { $list_SQL .= "'$list[$i]',";
$list_string .= "$list[$i]|"; $listQS .= "&list[]=$list[$i]";
$list_SQL .= "'$list[$i]',";
$listQS .= "&list[]=$list[$i]";
# }
$i++; $i++;
} }
$list_id_str=substr($list_SQL,0,-1); $list_id_str=substr($list_SQL,0,-1);
#if ( (preg_match('/\-\-ALL\-\-/',$list_string) ) or ($list_ct < 1) or (strlen($list_string) < 2) )
# {
$group_SQL = "$LOGallowed_campaignsSQL"; $group_SQL = "$LOGallowed_campaignsSQL";
# } $group_SQLand = "$LOGallowed_campaignsSQL";
#else
# {
# $group_SQL = preg_replace('/,$/i', '',$group_SQL);
# $both_group_SQLand = "and ( (campaign_id IN($group_drop_SQL)) or (campaign_id IN($group_SQL)) )";
# $both_group_SQL = "where ( (campaign_id IN($group_drop_SQL)) or (campaign_id IN($group_SQL)) )";
# $group_SQLand = "and campaign_id IN($group_SQL)";
# $group_SQL = "where campaign_id IN($group_SQL)";
# }
####################### #######################
@@ -424,16 +411,6 @@ else
$OUToutput .= "\n"; $OUToutput .= "\n";
$lists_id_str="";
$list_stmt="SELECT list_id from vicidial_lists where active IN('Y','N') $group_SQLand $list_SQLand";
if ($DB) {$MAIN.="$list_stmt\n";}
$list_rslt=mysql_to_mysqli($list_stmt, $link);
while ($lrow=mysqli_fetch_row($list_rslt))
{
$lists_id_str.="'$lrow[0]',";
}
$lists_id_str=substr($lists_id_str,0,-1);
$list_stmt="select vicidial_list.list_id,list_name,active, count(*) from vicidial_list, vicidial_lists where vicidial_lists.list_id in ($list_id_str) and vicidial_lists.list_id=vicidial_list.list_id group by vicidial_list.list_id, list_name, active order by list_id, list_name asc;"; $list_stmt="select vicidial_list.list_id,list_name,active, count(*) from vicidial_list, vicidial_lists where vicidial_lists.list_id in ($list_id_str) and vicidial_lists.list_id=vicidial_list.list_id group by vicidial_list.list_id, list_name, active order by list_id, list_name asc;";
$list_rslt=mysql_to_mysqli($list_stmt, $link); $list_rslt=mysql_to_mysqli($list_stmt, $link);
if ($DB) {$MAIN.="$stmt\n";} if ($DB) {$MAIN.="$stmt\n";}
+15 -4
View File
@@ -1802,6 +1802,8 @@ if (isset($_GET["level_8_disable_add"])) {$level_8_disable_add=$_GET["level_8_
elseif (isset($_POST["level_8_disable_add"])) {$level_8_disable_add=$_POST["level_8_disable_add"];} elseif (isset($_POST["level_8_disable_add"])) {$level_8_disable_add=$_POST["level_8_disable_add"];}
if (isset($_GET["survey_wait_sec"])) {$survey_wait_sec=$_GET["survey_wait_sec"];} if (isset($_GET["survey_wait_sec"])) {$survey_wait_sec=$_GET["survey_wait_sec"];}
elseif (isset($_POST["survey_wait_sec"])) {$survey_wait_sec=$_POST["survey_wait_sec"];} elseif (isset($_POST["survey_wait_sec"])) {$survey_wait_sec=$_POST["survey_wait_sec"];}
if (isset($_GET["queuemetrics_record_hold"])) {$queuemetrics_record_hold=$_GET["queuemetrics_record_hold"];}
elseif (isset($_POST["queuemetrics_record_hold"])) {$queuemetrics_record_hold=$_POST["queuemetrics_record_hold"];}
if (isset($script_id)) {$script_id= strtoupper($script_id);} if (isset($script_id)) {$script_id= strtoupper($script_id);}
@@ -2122,6 +2124,7 @@ if ($non_latin < 1)
$enhanced_disconnect_logging = preg_replace('/[^0-9]/','',$enhanced_disconnect_logging); $enhanced_disconnect_logging = preg_replace('/[^0-9]/','',$enhanced_disconnect_logging);
$level_8_disable_add = preg_replace('/[^0-9]/','',$level_8_disable_add); $level_8_disable_add = preg_replace('/[^0-9]/','',$level_8_disable_add);
$survey_wait_sec = preg_replace('/[^0-9]/','',$survey_wait_sec); $survey_wait_sec = preg_replace('/[^0-9]/','',$survey_wait_sec);
$queuemetrics_record_hold = preg_replace('/[^0-9]/','',$queuemetrics_record_hold);
$drop_call_seconds = preg_replace('/[^-0-9]/','',$drop_call_seconds); $drop_call_seconds = preg_replace('/[^-0-9]/','',$drop_call_seconds);
@@ -3224,12 +3227,13 @@ else
# 130809-1410 - Small fixes for call times and holidays # 130809-1410 - Small fixes for call times and holidays
# 130824-2319 - Changed to mysqli PHP functions # 130824-2319 - Changed to mysqli PHP functions
# 130915-0045 - Added counts for new nanpa prefix type tables # 130915-0045 - Added counts for new nanpa prefix type tables
# 130926-1731 - Added queuemetrics_record_hold system setting
# #
# 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 # 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.8-411a'; $admin_version = '2.8-412a';
$build = '130915-0045'; $build = '130926-1731';
$STARTtime = date("U"); $STARTtime = date("U");
$SQLdate = date("Y-m-d H:i:s"); $SQLdate = date("Y-m-d H:i:s");
@@ -8859,6 +8863,11 @@ if ($ADD==99999)
<BR> <BR>
<B>QueueMetrics Phone Environment Phone Append -</B> This option, if enabled, will append the agent phone login to the data4 record in the queue log table if the Campaign Phone Environment field is populated. Default is 0 for disabled. <B>QueueMetrics Phone Environment Phone Append -</B> This option, if enabled, will append the agent phone login to the data4 record in the queue log table if the Campaign Phone Environment field is populated. Default is 0 for disabled.
<BR>
<A NAME="settings-queuemetrics_record_hold">
<BR>
<B>QueueMetrics Hold Call Log -</B> This option, if enabled, will log when a customer is put on hold and taken off hold in the newer record_tags QM table. Default is 0 for disabled.
<BR> <BR>
<A NAME="settings-queuemetrics_socket"> <A NAME="settings-queuemetrics_socket">
<BR> <BR>
@@ -18865,7 +18874,7 @@ if ($ADD==411111111111111)
} }
$tables_use_alt_log_db = preg_replace("/,$/","",$new_altlog_value); $tables_use_alt_log_db = preg_replace("/,$/","",$new_altlog_value);
$stmt="UPDATE system_settings set use_non_latin='$use_non_latin',webroot_writable='$webroot_writable',enable_queuemetrics_logging='$enable_queuemetrics_logging',queuemetrics_server_ip='$queuemetrics_server_ip',queuemetrics_dbname='$queuemetrics_dbname',queuemetrics_login='$queuemetrics_login',queuemetrics_pass='$queuemetrics_pass',queuemetrics_url='$queuemetrics_url',queuemetrics_log_id='$queuemetrics_log_id',queuemetrics_eq_prepend='$queuemetrics_eq_prepend',vicidial_agent_disable='$vicidial_agent_disable',allow_sipsak_messages='$allow_sipsak_messages',admin_home_url='$admin_home_url',enable_agc_xfer_log='$enable_agc_xfer_log',timeclock_end_of_day='$timeclock_end_of_day',vdc_header_date_format='$vdc_header_date_format',vdc_customer_date_format='$vdc_customer_date_format',vdc_header_phone_format='$vdc_header_phone_format',vdc_agent_api_active='$vdc_agent_api_active',enable_vtiger_integration='$enable_vtiger_integration',vtiger_server_ip='$vtiger_server_ip',vtiger_dbname='$vtiger_dbname',vtiger_login='$vtiger_login',vtiger_pass='$vtiger_pass',vtiger_url='$vtiger_url',qc_features_active='$qc_features_active',outbound_autodial_active='$outbound_autodial_active',outbound_calls_per_second='$outbound_calls_per_second',enable_tts_integration='$enable_tts_integration',agentonly_callback_campaign_lock='$agentonly_callback_campaign_lock',sounds_central_control_active='$sounds_central_control_active',sounds_web_server='$sounds_web_server',sounds_web_directory='$sounds_web_directory',active_voicemail_server='$active_voicemail_server',auto_dial_limit='$auto_dial_limit',user_territories_active='$user_territories_active',allow_custom_dialplan='$allow_custom_dialplan',enable_second_webform='$enable_second_webform',default_webphone='$default_webphone',default_external_server_ip='$default_external_server_ip',webphone_url='" . mysqli_real_escape_string($link, $webphone_url) . "',enable_agc_dispo_log='$enable_agc_dispo_log',custom_dialplan_entry='$custom_dialplan_entry',queuemetrics_loginout='$queuemetrics_loginout',callcard_enabled='$callcard_enabled',queuemetrics_callstatus='$queuemetrics_callstatus',default_codecs='$default_codecs',admin_web_directory='$admin_web_directory',label_title='$label_title',label_first_name='$label_first_name',label_middle_initial='$label_middle_initial',label_last_name='$label_last_name',label_address1='$label_address1',label_address2='$label_address2',label_address3='$label_address3',label_city='$label_city',label_state='$label_state',label_province='$label_province',label_postal_code='$label_postal_code',label_vendor_lead_code='$label_vendor_lead_code',label_gender='$label_gender',label_phone_number='$label_phone_number',label_phone_code='$label_phone_code',label_alt_phone='$label_alt_phone',label_security_phrase='$label_security_phrase',label_email='$label_email',label_comments='$label_comments',custom_fields_enabled='$custom_fields_enabled',slave_db_server='$slave_db_server',reports_use_slave_db='$reports_use_slave_db',webphone_systemkey='$webphone_systemkey',first_login_trigger='$first_login_trigger',default_phone_registration_password='$default_phone_registration_password',default_phone_login_password='$default_phone_login_password',default_server_password='$default_server_password',admin_modify_refresh='$admin_modify_refresh',nocache_admin='$nocache_admin',generate_cross_server_exten='$generate_cross_server_exten',queuemetrics_addmember_enabled='$queuemetrics_addmember_enabled',queuemetrics_dispo_pause='$queuemetrics_dispo_pause',label_hide_field_logs='$label_hide_field_logs',queuemetrics_pe_phone_append='$queuemetrics_pe_phone_append',test_campaign_calls='$test_campaign_calls',agents_calls_reset='$agents_calls_reset',default_voicemail_timezone='$default_voicemail_timezone',default_local_gmt='$default_local_gmt',noanswer_log='$noanswer_log',alt_log_server_ip='$alt_log_server_ip',alt_log_dbname='$alt_log_dbname',alt_log_login='$alt_log_login',alt_log_pass='$alt_log_pass',tables_use_alt_log_db='$tables_use_alt_log_db',did_agent_log='$did_agent_log',campaign_cid_areacodes_enabled='$campaign_cid_areacodes_enabled',pllb_grouping_limit='$pllb_grouping_limit',did_ra_extensions_enabled='$did_ra_extensions_enabled',expanded_list_stats='$expanded_list_stats',contacts_enabled='$contacts_enabled',call_menu_qualify_enabled='$call_menu_qualify_enabled',admin_list_counts='$admin_list_counts',allow_voicemail_greeting='$allow_voicemail_greeting',queuemetrics_socket='$queuemetrics_socket',queuemetrics_socket_url='$queuemetrics_socket_url',enhanced_disconnect_logging='$enhanced_disconnect_logging',allow_emails='$allow_emails',level_8_disable_add='$level_8_disable_add';"; $stmt="UPDATE system_settings set use_non_latin='$use_non_latin',webroot_writable='$webroot_writable',enable_queuemetrics_logging='$enable_queuemetrics_logging',queuemetrics_server_ip='$queuemetrics_server_ip',queuemetrics_dbname='$queuemetrics_dbname',queuemetrics_login='$queuemetrics_login',queuemetrics_pass='$queuemetrics_pass',queuemetrics_url='$queuemetrics_url',queuemetrics_log_id='$queuemetrics_log_id',queuemetrics_eq_prepend='$queuemetrics_eq_prepend',vicidial_agent_disable='$vicidial_agent_disable',allow_sipsak_messages='$allow_sipsak_messages',admin_home_url='$admin_home_url',enable_agc_xfer_log='$enable_agc_xfer_log',timeclock_end_of_day='$timeclock_end_of_day',vdc_header_date_format='$vdc_header_date_format',vdc_customer_date_format='$vdc_customer_date_format',vdc_header_phone_format='$vdc_header_phone_format',vdc_agent_api_active='$vdc_agent_api_active',enable_vtiger_integration='$enable_vtiger_integration',vtiger_server_ip='$vtiger_server_ip',vtiger_dbname='$vtiger_dbname',vtiger_login='$vtiger_login',vtiger_pass='$vtiger_pass',vtiger_url='$vtiger_url',qc_features_active='$qc_features_active',outbound_autodial_active='$outbound_autodial_active',outbound_calls_per_second='$outbound_calls_per_second',enable_tts_integration='$enable_tts_integration',agentonly_callback_campaign_lock='$agentonly_callback_campaign_lock',sounds_central_control_active='$sounds_central_control_active',sounds_web_server='$sounds_web_server',sounds_web_directory='$sounds_web_directory',active_voicemail_server='$active_voicemail_server',auto_dial_limit='$auto_dial_limit',user_territories_active='$user_territories_active',allow_custom_dialplan='$allow_custom_dialplan',enable_second_webform='$enable_second_webform',default_webphone='$default_webphone',default_external_server_ip='$default_external_server_ip',webphone_url='" . mysqli_real_escape_string($link, $webphone_url) . "',enable_agc_dispo_log='$enable_agc_dispo_log',custom_dialplan_entry='$custom_dialplan_entry',queuemetrics_loginout='$queuemetrics_loginout',callcard_enabled='$callcard_enabled',queuemetrics_callstatus='$queuemetrics_callstatus',default_codecs='$default_codecs',admin_web_directory='$admin_web_directory',label_title='$label_title',label_first_name='$label_first_name',label_middle_initial='$label_middle_initial',label_last_name='$label_last_name',label_address1='$label_address1',label_address2='$label_address2',label_address3='$label_address3',label_city='$label_city',label_state='$label_state',label_province='$label_province',label_postal_code='$label_postal_code',label_vendor_lead_code='$label_vendor_lead_code',label_gender='$label_gender',label_phone_number='$label_phone_number',label_phone_code='$label_phone_code',label_alt_phone='$label_alt_phone',label_security_phrase='$label_security_phrase',label_email='$label_email',label_comments='$label_comments',custom_fields_enabled='$custom_fields_enabled',slave_db_server='$slave_db_server',reports_use_slave_db='$reports_use_slave_db',webphone_systemkey='$webphone_systemkey',first_login_trigger='$first_login_trigger',default_phone_registration_password='$default_phone_registration_password',default_phone_login_password='$default_phone_login_password',default_server_password='$default_server_password',admin_modify_refresh='$admin_modify_refresh',nocache_admin='$nocache_admin',generate_cross_server_exten='$generate_cross_server_exten',queuemetrics_addmember_enabled='$queuemetrics_addmember_enabled',queuemetrics_dispo_pause='$queuemetrics_dispo_pause',label_hide_field_logs='$label_hide_field_logs',queuemetrics_pe_phone_append='$queuemetrics_pe_phone_append',test_campaign_calls='$test_campaign_calls',agents_calls_reset='$agents_calls_reset',default_voicemail_timezone='$default_voicemail_timezone',default_local_gmt='$default_local_gmt',noanswer_log='$noanswer_log',alt_log_server_ip='$alt_log_server_ip',alt_log_dbname='$alt_log_dbname',alt_log_login='$alt_log_login',alt_log_pass='$alt_log_pass',tables_use_alt_log_db='$tables_use_alt_log_db',did_agent_log='$did_agent_log',campaign_cid_areacodes_enabled='$campaign_cid_areacodes_enabled',pllb_grouping_limit='$pllb_grouping_limit',did_ra_extensions_enabled='$did_ra_extensions_enabled',expanded_list_stats='$expanded_list_stats',contacts_enabled='$contacts_enabled',call_menu_qualify_enabled='$call_menu_qualify_enabled',admin_list_counts='$admin_list_counts',allow_voicemail_greeting='$allow_voicemail_greeting',queuemetrics_socket='$queuemetrics_socket',queuemetrics_socket_url='$queuemetrics_socket_url',enhanced_disconnect_logging='$enhanced_disconnect_logging',allow_emails='$allow_emails',level_8_disable_add='$level_8_disable_add',queuemetrics_record_hold='$queuemetrics_record_hold';";
$rslt=mysql_to_mysqli($stmt, $link); $rslt=mysql_to_mysqli($stmt, $link);
if ($reload_dialplan_on_servers > 0) if ($reload_dialplan_on_servers > 0)
@@ -32631,7 +32640,7 @@ if ($ADD==311111111111111)
$ALLagent_count = $rowx[2]; $ALLagent_count = $rowx[2];
} }
$stmt="SELECT version,install_date,use_non_latin,webroot_writable,enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_url,queuemetrics_log_id,queuemetrics_eq_prepend,vicidial_agent_disable,allow_sipsak_messages,admin_home_url,enable_agc_xfer_log,db_schema_version,auto_user_add_value,timeclock_end_of_day,timeclock_last_reset_date,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,vdc_agent_api_active,qc_last_pull_time,enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url,qc_features_active,outbound_autodial_active,outbound_calls_per_second,enable_tts_integration,agentonly_callback_campaign_lock,sounds_central_control_active,sounds_web_server,sounds_web_directory,active_voicemail_server,auto_dial_limit,user_territories_active,allow_custom_dialplan,db_schema_update_date,enable_second_webform,default_webphone,default_external_server_ip,webphone_url,enable_agc_dispo_log,custom_dialplan_entry,queuemetrics_loginout,callcard_enabled,queuemetrics_callstatus,default_codecs,admin_web_directory,label_title,label_first_name,label_middle_initial,label_last_name,label_address1,label_address2,label_address3,label_city,label_state,label_province,label_postal_code,label_vendor_lead_code,label_gender,label_phone_number,label_phone_code,label_alt_phone,label_security_phrase,label_email,label_comments,custom_fields_enabled,slave_db_server,reports_use_slave_db,webphone_systemkey,first_login_trigger,default_phone_registration_password,default_phone_login_password,default_server_password,admin_modify_refresh,nocache_admin,generate_cross_server_exten,queuemetrics_addmember_enabled,queuemetrics_dispo_pause,label_hide_field_logs,queuemetrics_pe_phone_append,test_campaign_calls,agents_calls_reset,default_voicemail_timezone,default_local_gmt,noanswer_log,alt_log_server_ip,alt_log_dbname,alt_log_login,alt_log_pass,tables_use_alt_log_db,did_agent_log,campaign_cid_areacodes_enabled,pllb_grouping_limit,did_ra_extensions_enabled,expanded_list_stats,contacts_enabled,call_menu_qualify_enabled,admin_list_counts,allow_voicemail_greeting,svn_revision,queuemetrics_socket,queuemetrics_socket_url,enhanced_disconnect_logging,allow_emails,level_8_disable_add,pass_hash_enabled,pass_key,pass_cost,disable_auto_dial from system_settings;"; $stmt="SELECT version,install_date,use_non_latin,webroot_writable,enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_url,queuemetrics_log_id,queuemetrics_eq_prepend,vicidial_agent_disable,allow_sipsak_messages,admin_home_url,enable_agc_xfer_log,db_schema_version,auto_user_add_value,timeclock_end_of_day,timeclock_last_reset_date,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,vdc_agent_api_active,qc_last_pull_time,enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url,qc_features_active,outbound_autodial_active,outbound_calls_per_second,enable_tts_integration,agentonly_callback_campaign_lock,sounds_central_control_active,sounds_web_server,sounds_web_directory,active_voicemail_server,auto_dial_limit,user_territories_active,allow_custom_dialplan,db_schema_update_date,enable_second_webform,default_webphone,default_external_server_ip,webphone_url,enable_agc_dispo_log,custom_dialplan_entry,queuemetrics_loginout,callcard_enabled,queuemetrics_callstatus,default_codecs,admin_web_directory,label_title,label_first_name,label_middle_initial,label_last_name,label_address1,label_address2,label_address3,label_city,label_state,label_province,label_postal_code,label_vendor_lead_code,label_gender,label_phone_number,label_phone_code,label_alt_phone,label_security_phrase,label_email,label_comments,custom_fields_enabled,slave_db_server,reports_use_slave_db,webphone_systemkey,first_login_trigger,default_phone_registration_password,default_phone_login_password,default_server_password,admin_modify_refresh,nocache_admin,generate_cross_server_exten,queuemetrics_addmember_enabled,queuemetrics_dispo_pause,label_hide_field_logs,queuemetrics_pe_phone_append,test_campaign_calls,agents_calls_reset,default_voicemail_timezone,default_local_gmt,noanswer_log,alt_log_server_ip,alt_log_dbname,alt_log_login,alt_log_pass,tables_use_alt_log_db,did_agent_log,campaign_cid_areacodes_enabled,pllb_grouping_limit,did_ra_extensions_enabled,expanded_list_stats,contacts_enabled,call_menu_qualify_enabled,admin_list_counts,allow_voicemail_greeting,svn_revision,queuemetrics_socket,queuemetrics_socket_url,enhanced_disconnect_logging,allow_emails,level_8_disable_add,pass_hash_enabled,pass_key,pass_cost,disable_auto_dial,queuemetrics_record_hold from system_settings;";
$rslt=mysql_to_mysqli($stmt, $link); $rslt=mysql_to_mysqli($stmt, $link);
$row=mysqli_fetch_row($rslt); $row=mysqli_fetch_row($rslt);
$version = $row[0]; $version = $row[0];
@@ -32752,6 +32761,7 @@ if ($ADD==311111111111111)
$pass_key = $row[115]; $pass_key = $row[115];
$pass_cost = $row[116]; $pass_cost = $row[116];
$disable_auto_dial = $row[117]; $disable_auto_dial = $row[117];
$queuemetrics_record_hold = $row[118];
if ($pass_hash_enabled > 0) {$pass_hash_enabled = 'ENABLED';} if ($pass_hash_enabled > 0) {$pass_hash_enabled = 'ENABLED';}
else {$pass_hash_enabled = 'DISABLED';} else {$pass_hash_enabled = 'DISABLED';}
@@ -33095,6 +33105,7 @@ if ($ADD==311111111111111)
echo "<tr bgcolor=#99FFCC><td align=right>QueueMetrics Addmember Enabled: </td><td align=left><select size=1 name=queuemetrics_addmember_enabled><option>1</option><option>0</option><option selected>$queuemetrics_addmember_enabled</option></select>$NWB#settings-queuemetrics_addmember_enabled$NWE</td></tr>\n"; echo "<tr bgcolor=#99FFCC><td align=right>QueueMetrics Addmember Enabled: </td><td align=left><select size=1 name=queuemetrics_addmember_enabled><option>1</option><option>0</option><option selected>$queuemetrics_addmember_enabled</option></select>$NWB#settings-queuemetrics_addmember_enabled$NWE</td></tr>\n";
echo "<tr bgcolor=#99FFCC><td align=right>QueueMetrics Dispo Pause Code: </td><td align=left><input type=text name=queuemetrics_dispo_pause size=8 maxlength=6 value=\"$queuemetrics_dispo_pause\">$NWB#settings-queuemetrics_dispo_pause$NWE</td></tr>\n"; echo "<tr bgcolor=#99FFCC><td align=right>QueueMetrics Dispo Pause Code: </td><td align=left><input type=text name=queuemetrics_dispo_pause size=8 maxlength=6 value=\"$queuemetrics_dispo_pause\">$NWB#settings-queuemetrics_dispo_pause$NWE</td></tr>\n";
echo "<tr bgcolor=#99FFCC><td align=right>QueueMetrics Phone Environment Phone Append: </td><td align=left><select size=1 name=queuemetrics_pe_phone_append><option>1</option><option>0</option><option selected>$queuemetrics_pe_phone_append</option></select>$NWB#settings-queuemetrics_pe_phone_append$NWE</td></tr>\n"; echo "<tr bgcolor=#99FFCC><td align=right>QueueMetrics Phone Environment Phone Append: </td><td align=left><select size=1 name=queuemetrics_pe_phone_append><option>1</option><option>0</option><option selected>$queuemetrics_pe_phone_append</option></select>$NWB#settings-queuemetrics_pe_phone_append$NWE</td></tr>\n";
echo "<tr bgcolor=#99FFCC><td align=right>QueueMetrics Hold Call Log: </td><td align=left><select size=1 name=queuemetrics_record_hold><option>1</option><option>0</option><option selected>$queuemetrics_record_hold</option></select>$NWB#settings-queuemetrics_record_hold$NWE</td></tr>\n";
echo "<tr bgcolor=#99FFCC><td align=right>QueueMetrics Socket Send: </td><td align=left><select size=1 name=queuemetrics_socket><option>NONE</option><option>CONNECT_COMPLETE</option><option selected>$queuemetrics_socket</option></select>$NWB#settings-queuemetrics_socket$NWE</td></tr>\n"; echo "<tr bgcolor=#99FFCC><td align=right>QueueMetrics Socket Send: </td><td align=left><select size=1 name=queuemetrics_socket><option>NONE</option><option>CONNECT_COMPLETE</option><option selected>$queuemetrics_socket</option></select>$NWB#settings-queuemetrics_socket$NWE</td></tr>\n";
echo "<tr bgcolor=#99FFCC><td align=right>QueueMetrics Socket Send URL: </td><td align=left><input type=text name=queuemetrics_socket_url size=60 maxlength=1000 value=\"$queuemetrics_socket_url\">$NWB#settings-queuemetrics_socket_url$NWE</td></tr>\n"; echo "<tr bgcolor=#99FFCC><td align=right>QueueMetrics Socket Send URL: </td><td align=left><input type=text name=queuemetrics_socket_url size=60 maxlength=1000 value=\"$queuemetrics_socket_url\">$NWB#settings-queuemetrics_socket_url$NWE</td></tr>\n";
+18 -6
View File
@@ -56,6 +56,7 @@
# 130621-1731 - Added filtering of input to prevent SQL injection attacks and new user auth # 130621-1731 - Added filtering of input to prevent SQL injection attacks and new user auth
# 130705-1726 - Minor change for encrypted password compatibility # 130705-1726 - Minor change for encrypted password compatibility
# 130901-0816 - Changed to mysqli PHP functions # 130901-0816 - Changed to mysqli PHP functions
# 130926-2053 - Added option for viewing/modifying vicidial_list_archive leads
# #
require("dbconnect_mysqli.php"); require("dbconnect_mysqli.php");
@@ -166,6 +167,11 @@ if (isset($_POST["appointment_time"])) {$appointment_time=$_POST["appointment_
elseif (isset($_GET["appointment_time"])) {$appointment_time=$_GET["appointment_time"];} elseif (isset($_GET["appointment_time"])) {$appointment_time=$_GET["appointment_time"];}
if (isset($_GET["CBstatus"])) {$CBstatus=$_GET["CBstatus"];} if (isset($_GET["CBstatus"])) {$CBstatus=$_GET["CBstatus"];}
elseif (isset($_POST["CBstatus"])) {$CBstatus=$_POST["CBstatus"];} elseif (isset($_POST["CBstatus"])) {$CBstatus=$_POST["CBstatus"];}
if (isset($_GET["archive_search"])) {$archive_search=$_GET["archive_search"];}
elseif (isset($_POST["archive_search"])) {$archive_search=$_POST["archive_search"];}
if ($archive_search=="Yes") {$vl_table="vicidial_list_archive";}
else {$vl_table="vicidial_list"; $archive_search="No";}
$STARTtime = date("U"); $STARTtime = date("U");
$TODAY = date("Y-m-d"); $TODAY = date("Y-m-d");
@@ -389,13 +395,13 @@ if ($lead_id == 'NEW')
} }
else else
{ {
$stmt="SELECT count(*) from vicidial_list where lead_id='" . mysqli_real_escape_string($link, $lead_id) . "'"; $stmt="SELECT count(*) from $vl_table where lead_id='" . mysqli_real_escape_string($link, $lead_id) . "'";
$rslt=mysql_to_mysqli($stmt, $link); $rslt=mysql_to_mysqli($stmt, $link);
if ($DB) {echo "$stmt\n";} if ($DB) {echo "$stmt\n";}
$row=mysqli_fetch_row($rslt); $row=mysqli_fetch_row($rslt);
$lead_exists = $row[0]; $lead_exists = $row[0];
$stmt="SELECT count(*) from vicidial_list where lead_id='" . mysqli_real_escape_string($link, $lead_id) . "' $LOGallowed_listsSQL"; $stmt="SELECT count(*) from $vl_table where lead_id='" . mysqli_real_escape_string($link, $lead_id) . "' $LOGallowed_listsSQL";
$rslt=mysql_to_mysqli($stmt, $link); $rslt=mysql_to_mysqli($stmt, $link);
if ($DB) {echo "$stmt\n";} if ($DB) {echo "$stmt\n";}
$row=mysqli_fetch_row($rslt); $row=mysqli_fetch_row($rslt);
@@ -415,12 +421,12 @@ if ($end_call > 0)
$comments = preg_replace("/\n/",'!N',$comments); $comments = preg_replace("/\n/",'!N',$comments);
$comments = preg_replace("/\r/",'',$comments); $comments = preg_replace("/\r/",'',$comments);
### update the lead record in the vicidial_list table ### update the lead record in the vicidial_list table
$stmt="UPDATE vicidial_list set status='" . mysqli_real_escape_string($link, $status) . "',title='" . mysqli_real_escape_string($link, $title) . "',first_name='" . mysqli_real_escape_string($link, $first_name) . "',middle_initial='" . mysqli_real_escape_string($link, $middle_initial) . "',last_name='" . mysqli_real_escape_string($link, $last_name) . "',address1='" . mysqli_real_escape_string($link, $address1) . "',address2='" . mysqli_real_escape_string($link, $address2) . "',address3='" . mysqli_real_escape_string($link, $address3) . "',city='" . mysqli_real_escape_string($link, $city) . "',state='" . mysqli_real_escape_string($link, $state) . "',province='" . mysqli_real_escape_string($link, $province) . "',postal_code='" . mysqli_real_escape_string($link, $postal_code) . "',country_code='" . mysqli_real_escape_string($link, $country_code) . "',alt_phone='" . mysqli_real_escape_string($link, $alt_phone) . "',phone_number='$phone_number',phone_code='$phone_code',email='" . mysqli_real_escape_string($link, $email) . "',security_phrase='" . mysqli_real_escape_string($link, $security) . "',comments='" . mysqli_real_escape_string($link, $comments) . "',rank='" . mysqli_real_escape_string($link, $rank) . "',owner='" . mysqli_real_escape_string($link, $owner) . "',vendor_lead_code='" . mysqli_real_escape_string($link, $vendor_id) . "' where lead_id='" . mysqli_real_escape_string($link, $lead_id) . "'"; $stmt="UPDATE $vl_table set status='" . mysqli_real_escape_string($link, $status) . "',title='" . mysqli_real_escape_string($link, $title) . "',first_name='" . mysqli_real_escape_string($link, $first_name) . "',middle_initial='" . mysqli_real_escape_string($link, $middle_initial) . "',last_name='" . mysqli_real_escape_string($link, $last_name) . "',address1='" . mysqli_real_escape_string($link, $address1) . "',address2='" . mysqli_real_escape_string($link, $address2) . "',address3='" . mysqli_real_escape_string($link, $address3) . "',city='" . mysqli_real_escape_string($link, $city) . "',state='" . mysqli_real_escape_string($link, $state) . "',province='" . mysqli_real_escape_string($link, $province) . "',postal_code='" . mysqli_real_escape_string($link, $postal_code) . "',country_code='" . mysqli_real_escape_string($link, $country_code) . "',alt_phone='" . mysqli_real_escape_string($link, $alt_phone) . "',phone_number='$phone_number',phone_code='$phone_code',email='" . mysqli_real_escape_string($link, $email) . "',security_phrase='" . mysqli_real_escape_string($link, $security) . "',comments='" . mysqli_real_escape_string($link, $comments) . "',rank='" . mysqli_real_escape_string($link, $rank) . "',owner='" . mysqli_real_escape_string($link, $owner) . "',vendor_lead_code='" . mysqli_real_escape_string($link, $vendor_id) . "' where lead_id='" . mysqli_real_escape_string($link, $lead_id) . "'";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_to_mysqli($stmt, $link); $rslt=mysql_to_mysqli($stmt, $link);
echo "information modified<BR><BR>\n"; echo "information modified<BR><BR>\n";
echo "<a href=\"$PHP_SELF?lead_id=$lead_id&DB=$DB\">Go back to the lead modification page</a><BR><BR>\n"; echo "<a href=\"$PHP_SELF?lead_id=$lead_id&DB=$DB&archive_search=$archive_search\">Go back to the lead modification page</a><BR><BR>\n";
echo "<form><input type=button value=\"Close This Window\" onClick=\"javascript:window.close();\"></form>\n"; echo "<form><input type=button value=\"Close This Window\" onClick=\"javascript:window.close();\"></form>\n";
### LOG INSERTION Admin Log Table ### ### LOG INSERTION Admin Log Table ###
@@ -564,7 +570,7 @@ else
} }
$stmt="SELECT count(*) from vicidial_list where lead_id='" . mysqli_real_escape_string($link, $lead_id) . "'"; $stmt="SELECT count(*) from $vl_table where lead_id='" . mysqli_real_escape_string($link, $lead_id) . "'";
$rslt=mysql_to_mysqli($stmt, $link); $rslt=mysql_to_mysqli($stmt, $link);
if ($DB) {echo "$stmt\n";} if ($DB) {echo "$stmt\n";}
$row=mysqli_fetch_row($rslt); $row=mysqli_fetch_row($rslt);
@@ -734,7 +740,7 @@ else
} }
##### grab vicidial_list data for lead ##### ##### grab vicidial_list data for lead #####
$stmt="SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id from vicidial_list where lead_id='" . mysqli_real_escape_string($link, $lead_id) . "' $LOGallowed_listsSQL"; $stmt="SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id from $vl_table where lead_id='" . mysqli_real_escape_string($link, $lead_id) . "' $LOGallowed_listsSQL";
$rslt=mysql_to_mysqli($stmt, $link); $rslt=mysql_to_mysqli($stmt, $link);
if ($DB) {echo "$stmt\n";} if ($DB) {echo "$stmt\n";}
$row=mysqli_fetch_row($rslt); $row=mysqli_fetch_row($rslt);
@@ -870,6 +876,12 @@ else
echo "<table cellpadding=1 cellspacing=0>\n"; echo "<table cellpadding=1 cellspacing=0>\n";
echo "<tr><td colspan=2>Lead ID: $lead_id &nbsp; &nbsp; List ID: $list_id</td></tr>\n"; echo "<tr><td colspan=2>Lead ID: $lead_id &nbsp; &nbsp; List ID: $list_id</td></tr>\n";
echo "<tr><td colspan=2>Fronter: <A HREF=\"user_stats.php?user=$tsr\">$tsr</A> &nbsp; &nbsp; Called Count: $called_count</td></tr>\n"; echo "<tr><td colspan=2>Fronter: <A HREF=\"user_stats.php?user=$tsr\">$tsr</A> &nbsp; &nbsp; Called Count: $called_count</td></tr>\n";
if ($archive_search=="Yes") {
echo "<tr><td colspan=2 align='center'>";
echo "<B><font color='#FF0000'>*** ARCHIVED LEAD ***</font></B>";
echo "<input type='hidden' name='archive_search' value='Yes'>";
echo "</td></tr>\n";
}
if ($lead_id == 'NEW') {$list_id='';} if ($lead_id == 'NEW') {$list_id='';}
if ($LOGadmin_hide_lead_data != '0') if ($LOGadmin_hide_lead_data != '0')
+29 -10
View File
@@ -33,6 +33,7 @@
# 130610-1054 - Finalized changing of all ereg instances to preg # 130610-1054 - Finalized changing of all ereg instances to preg
# 130621-1714 - Added filtering of input to prevent SQL injection attacks and new user auth # 130621-1714 - Added filtering of input to prevent SQL injection attacks and new user auth
# 130902-0747 - Changed to mysqli PHP functions # 130902-0747 - Changed to mysqli PHP functions
# 130926-2048 - Added option to search vicidial_list_archive table
# #
require("dbconnect_mysqli.php"); require("dbconnect_mysqli.php");
@@ -71,6 +72,8 @@ if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];}
elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];}
if (isset($_GET["alt_phone_search"])) {$alt_phone_search=$_GET["alt_phone_search"];} if (isset($_GET["alt_phone_search"])) {$alt_phone_search=$_GET["alt_phone_search"];}
elseif (isset($_POST["alt_phone_search"])) {$alt_phone_search=$_POST["alt_phone_search"];} elseif (isset($_POST["alt_phone_search"])) {$alt_phone_search=$_POST["alt_phone_search"];}
if (isset($_GET["archive_search"])) {$archive_search=$_GET["archive_search"];}
elseif (isset($_POST["archive_search"])) {$archive_search=$_POST["archive_search"];}
############################################# #############################################
##### START SYSTEM_SETTINGS LOOKUP ##### ##### START SYSTEM_SETTINGS LOOKUP #####
@@ -93,6 +96,9 @@ if ($qm_conf_ct > 0)
$report_name = 'Search Leads Logs'; $report_name = 'Search Leads Logs';
if ($archive_search=="Yes") {$vl_table="vicidial_list_archive";}
else {$vl_table="vicidial_list"; $archive_search="No";}
$vicidial_list_fields = 'lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner'; $vicidial_list_fields = 'lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner';
$STARTtime = date("U"); $STARTtime = date("U");
@@ -285,8 +291,20 @@ if ( (!$vendor_id) and (!$phone) and (!$lead_id) and (!$log_phone) and (!$log_
echo "<TABLE CELLPADDING=3 CELLSPACING=3>"; echo "<TABLE CELLPADDING=3 CELLSPACING=3>";
echo "<TR>"; echo "<TR>";
echo "<TD colspan=3 align=center><b>Lead Search Options:</TD>"; echo "<TD colspan=3 align=center><b>Lead Search Options:</TD>";
echo "</TR><TR bgcolor=#B9CBFD>"; echo "</TR>";
$archive_stmt="SHOW TABLES LIKE '%vicidial_list_archive%'";
$archive_rslt=mysql_to_mysqli($archive_stmt, $link);
if (mysqli_num_rows($archive_rslt)>0)
{
echo "<TR bgcolor=#B9CBFD>";
echo "<TD ALIGN=right>Archive search: &nbsp; </TD><TD ALIGN=left><select size=1 name=archive_search><option>No</option><option>Yes</option><option SELECTED>$archive_search</option></select></TD>";
echo "<TD> &nbsp; </TD>\n";
echo "</TR><TR>";
echo "<TD colspan=3 align=center> &nbsp; </TD></TR>";
}
echo "<TR bgcolor=#B9CBFD>";
echo "<TD ALIGN=right>$label_vendor_lead_code(vendor lead code): &nbsp; </TD><TD ALIGN=left><input type=text name=vendor_id size=10 maxlength=20></TD>"; echo "<TD ALIGN=right>$label_vendor_lead_code(vendor lead code): &nbsp; </TD><TD ALIGN=left><input type=text name=vendor_id size=10 maxlength=20></TD>";
echo "<TD><input type=submit name=submit value=SUBMIT></TD>\n"; echo "<TD><input type=submit name=submit value=SUBMIT></TD>\n";
echo "</TR><TR>"; echo "</TR><TR>";
@@ -297,6 +315,7 @@ if ( (!$vendor_id) and (!$phone) and (!$lead_id) and (!$log_phone) and (!$log_
echo "<TD rowspan=2><input type=submit name=submit value=SUBMIT></TD>\n"; echo "<TD rowspan=2><input type=submit name=submit value=SUBMIT></TD>\n";
echo "</TR><TR bgcolor=#B9CBFD>"; echo "</TR><TR bgcolor=#B9CBFD>";
echo "<TD ALIGN=right>$label_alt_phone search: &nbsp; </TD><TD ALIGN=left><select size=1 name=alt_phone_search><option>No</option><option>Yes</option><option SELECTED>$alt_phone_search</option></select></TD>"; echo "<TD ALIGN=right>$label_alt_phone search: &nbsp; </TD><TD ALIGN=left><select size=1 name=alt_phone_search><option>No</option><option>Yes</option><option SELECTED>$alt_phone_search</option></select></TD>";
echo "</TR><TR>"; echo "</TR><TR>";
echo "<TD colspan=3 align=center> &nbsp; </TD>"; echo "<TD colspan=3 align=center> &nbsp; </TD>";
echo "</TR><TR bgcolor=#B9CBFD>"; echo "</TR><TR bgcolor=#B9CBFD>";
@@ -430,7 +449,7 @@ else
{$bgcolor='bgcolor="#9BB9FB"';} {$bgcolor='bgcolor="#9BB9FB"';}
echo "<TR $bgcolor>\n"; echo "<TR $bgcolor>\n";
echo "<TD ALIGN=LEFT><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$o</FONT></TD>\n"; echo "<TD ALIGN=LEFT><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$o</FONT></TD>\n";
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1><a href=\"admin_modify_lead.php?lead_id=$row[0]\" target=\"_blank\">$row[0]</a></FONT></TD>\n"; echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1><a href=\"admin_modify_lead.php?lead_id=$row[0]&archive_search=$archive_search\" target=\"_blank\">$row[0]</a></FONT></TD>\n";
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[1]</FONT></TD>\n"; echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[1]</FONT></TD>\n";
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[2]</FONT></TD>\n"; echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[2]</FONT></TD>\n";
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[3]</FONT></TD>\n"; echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[3]</FONT></TD>\n";
@@ -495,7 +514,7 @@ else
{$bgcolor='bgcolor="#9BB9FB"';} {$bgcolor='bgcolor="#9BB9FB"';}
echo "<TR $bgcolor>\n"; echo "<TR $bgcolor>\n";
echo "<TD ALIGN=LEFT><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$o</FONT></TD>\n"; echo "<TD ALIGN=LEFT><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$o</FONT></TD>\n";
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1><a href=\"admin_modify_lead.php?lead_id=$row[0]\" target=\"_blank\">$row[0]</a></FONT></TD>\n"; echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1><a href=\"admin_modify_lead.php?lead_id=$row[0]&archive_search=$archive_search\" target=\"_blank\">$row[0]</a></FONT></TD>\n";
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[1]</FONT></TD>\n"; echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[1]</FONT></TD>\n";
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[2]</FONT></TD>\n"; echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[2]</FONT></TD>\n";
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[3]</FONT></TD>\n"; echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[3]</FONT></TD>\n";
@@ -596,7 +615,7 @@ else
##### BEGIN Lead search ##### ##### BEGIN Lead search #####
if ($vendor_id) if ($vendor_id)
{ {
$stmt="SELECT $vicidial_list_fields from vicidial_list where vendor_lead_code='" . mysqli_real_escape_string($link, $vendor_id) . "' $LOGallowed_listsSQL"; $stmt="SELECT $vicidial_list_fields from $vl_table where vendor_lead_code='" . mysqli_real_escape_string($link, $vendor_id) . "' $LOGallowed_listsSQL";
} }
else else
{ {
@@ -604,18 +623,18 @@ else
{ {
if ($alt_phone_search=="Yes") if ($alt_phone_search=="Yes")
{ {
$stmt="SELECT $vicidial_list_fields from vicidial_list where phone_number='" . mysqli_real_escape_string($link, $phone) . "' or alt_phone='" . mysqli_real_escape_string($link, $phone) . "' or address3='" . mysqli_real_escape_string($link, $phone) . "' $LOGallowed_listsSQL"; $stmt="SELECT $vicidial_list_fields from $vl_table where phone_number='" . mysqli_real_escape_string($link, $phone) . "' or alt_phone='" . mysqli_real_escape_string($link, $phone) . "' or address3='" . mysqli_real_escape_string($link, $phone) . "' $LOGallowed_listsSQL";
} }
else else
{ {
$stmt="SELECT $vicidial_list_fields from vicidial_list where phone_number='" . mysqli_real_escape_string($link, $phone) . "' $LOGallowed_listsSQL"; $stmt="SELECT $vicidial_list_fields from $vl_table where phone_number='" . mysqli_real_escape_string($link, $phone) . "' $LOGallowed_listsSQL";
} }
} }
else else
{ {
if ($lead_id) if ($lead_id)
{ {
$stmt="SELECT $vicidial_list_fields from vicidial_list where lead_id='" . mysqli_real_escape_string($link, $lead_id) . "' $LOGallowed_listsSQL"; $stmt="SELECT $vicidial_list_fields from $vl_table where lead_id='" . mysqli_real_escape_string($link, $lead_id) . "' $LOGallowed_listsSQL";
} }
else else
{ {
@@ -644,7 +663,7 @@ else
if ( ($SQLctA > 0) or ($SQLctB > 0) or ($SQLctC > 0) ) {$andC = 'and';} if ( ($SQLctA > 0) or ($SQLctB > 0) or ($SQLctC > 0) ) {$andC = 'and';}
$ownerSQL = "$andC owner='" . mysqli_real_escape_string($link, $owner) . "'"; $ownerSQL = "$andC owner='" . mysqli_real_escape_string($link, $owner) . "'";
} }
$stmt="SELECT $vicidial_list_fields from vicidial_list where $statusSQL $list_idSQL $userSQL $ownerSQL $LOGallowed_listsSQL"; $stmt="SELECT $vicidial_list_fields from $vl_table where $statusSQL $list_idSQL $userSQL $ownerSQL $LOGallowed_listsSQL";
} }
else else
{ {
@@ -661,7 +680,7 @@ else
if ($SQLctA > 0) {$andA = 'and';} if ($SQLctA > 0) {$andA = 'and';}
$last_nameSQL = "$andA last_name='" . mysqli_real_escape_string($link, $last_name) . "'"; $last_nameSQL = "$andA last_name='" . mysqli_real_escape_string($link, $last_name) . "'";
} }
$stmt="SELECT $vicidial_list_fields from vicidial_list where $first_nameSQL $last_nameSQL $LOGallowed_listsSQL"; $stmt="SELECT $vicidial_list_fields from $vl_table where $first_nameSQL $last_nameSQL $LOGallowed_listsSQL";
} }
else else
{ {
@@ -805,7 +824,7 @@ else
{$bgcolor='bgcolor="#9BB9FB"';} {$bgcolor='bgcolor="#9BB9FB"';}
echo "<TR $bgcolor>\n"; echo "<TR $bgcolor>\n";
echo "<TD ALIGN=LEFT><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$o</FONT></TD>\n"; echo "<TD ALIGN=LEFT><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$o</FONT></TD>\n";
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1><a href=\"admin_modify_lead.php?lead_id=$row[0]\" target=\"_blank\">$row[0]</a></FONT></TD>\n"; echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1><a href=\"admin_modify_lead.php?lead_id=$row[0]&archive_search=$archive_search\" target=\"_blank\">$row[0]</a></FONT></TD>\n";
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[3]</FONT></TD>\n"; echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[3]</FONT></TD>\n";
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[5]</FONT></TD>\n"; echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[5]</FONT></TD>\n";
echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[4]</FONT></TD>\n"; echo "<TD ALIGN=CENTER><FONT FACE=\"ARIAL,HELVETICA\" SIZE=1>$row[4]</FONT></TD>\n";