More code updates for PHP8 compatibility

AMD updates

git-svn-id: svn://192.168.202.10@3997 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2026-05-29 18:45:30 +00:00
parent a518403838
commit 8d20427a51
9 changed files with 214 additions and 42 deletions
+48 -7
View File
@@ -567,10 +567,11 @@
# 251124-0935 - Added lead status display for callbacks list output
# 260302-1057 - Code updates for PHP8 compatibility
# 260403-2155 - Added vicidial_max_inbound_cache logging
# 260529-0914 - Added code to allow for AMDnotesBox
#
$version = '2.14-460';
$build = '260403-2155';
$version = '2.14-461';
$build = '260529-0914';
$php_script = 'vdc_db_query.php';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=10001;
@@ -1254,7 +1255,7 @@ $sip_hangup_cause_dictionary = array(
#############################################
##### START SYSTEM_SETTINGS LOOKUP #####
$stmt = "SELECT use_non_latin,timeclock_end_of_day,agentonly_callback_campaign_lock,alt_log_server_ip,alt_log_dbname,alt_log_login,alt_log_pass,tables_use_alt_log_db,qc_features_active,allow_emails,callback_time_24hour,enable_languages,language_method,agent_debug_logging,default_language,active_modules,allow_chats,default_phone_code,user_new_lead_limit,sip_event_logging,call_quota_lead_ranking,daily_call_count_limit,call_limit_24hour,allow_web_debug,abandon_check_queue,inbound_credits,stereo_recording,stereo_parallel_recording,recording_dtmf_detection,recording_dtmf_muting FROM system_settings;";
$stmt = "SELECT use_non_latin,timeclock_end_of_day,agentonly_callback_campaign_lock,alt_log_server_ip,alt_log_dbname,alt_log_login,alt_log_pass,tables_use_alt_log_db,qc_features_active,allow_emails,callback_time_24hour,enable_languages,language_method,agent_debug_logging,default_language,active_modules,allow_chats,default_phone_code,user_new_lead_limit,sip_event_logging,call_quota_lead_ranking,daily_call_count_limit,call_limit_24hour,allow_web_debug,abandon_check_queue,inbound_credits,stereo_recording,stereo_parallel_recording,recording_dtmf_detection,recording_dtmf_muting,viciamd_enabled FROM system_settings;";
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log);}
#if ($DB) {echo "$stmt\n";}
@@ -1292,6 +1293,7 @@ if ($qm_conf_ct > 0)
$SSstereo_parallel_recording = $row[27];
$SSrecording_dtmf_detection = $row[28];
$SSrecording_dtmf_muting = $row[29];
$SSviciamd_enabled = $row[30];
}
if ($SSallow_web_debug < 1 || !isset($DB)) {$DB=0; $format="text";}
$DB=preg_replace("/[^0-9]/","",$DB);
@@ -10755,6 +10757,7 @@ if ($ACTION == 'VDADcheckINCOMING')
$fronter = $user;
$closer='';
$recording_dtmf_muting=0;
$VCAdata='y';
if ( (strlen($campaign)<1) || (strlen($server_ip)<1) )
{
@@ -10937,7 +10940,7 @@ if ($ACTION == 'VDADcheckINCOMING')
$CBcomments = trim("$row[3]");
}
}
$stmt="SELECT owner_populate,user_group_script,custom_one,custom_two,custom_three,custom_four,custom_five,state_descriptions,stereo_recording,stereo_recording_agent FROM vicidial_campaigns where campaign_id='$campaign';";
$stmt="SELECT owner_populate,user_group_script,custom_one,custom_two,custom_three,custom_four,custom_five,state_descriptions,stereo_recording,stereo_recording_agent,amd_agent_display,amd_type FROM vicidial_campaigns where campaign_id='$campaign';";
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00444',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
@@ -10955,6 +10958,8 @@ if ($ACTION == 'VDADcheckINCOMING')
$state_descriptions = $row[7];
$stereo_recording = $row[8];
$stereo_recording_agent = $row[9];
$amd_agent_display = $row[10];
$amd_type = $row[11];
}
$ownerSQL='';
if ( ($owner_populate=='ENABLED') and ( (strlen($owner) < 1) or ($owner=='NULL') ) )
@@ -11271,7 +11276,43 @@ if ($ACTION == 'VDADcheckINCOMING')
}
}
echo "$VDCL_group_web|$VDCL_group_name||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|X|X||||$VDCL_group_web_two|$VDCL_timer_action|$VDCL_timer_action_message|$VDCL_timer_action_seconds|$VDCL_xferconf_c_number|$VDCL_xferconf_d_number|$VDCL_xferconf_e_number||||$VDCL_timer_action_destination|||||||$VDCL_group_web_three|$VDCL_ingroup_script_color|||$VDCL_campaign_script_two|$VDCL_ingroup_script_color_two|||$stereo_recording|$stereo_recording_agent|$talk_sec_urls_secs|\n|\n";
$SSviciamd_enabled = intval($SSviciamd_enabled);
if ($SSviciamd_enabled > 0)
{
if ( ($amd_type == 'ViciAMD') and ($amd_agent_display == 'ENABLED') )
{
# search for call in the vicidial_vca_log table $callerid, show tables like 'vicidial_vca_log';
$stmt = "SHOW TABLES LIKE 'vicidial_vca_log';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);}
$VVCAL_ct = mysqli_num_rows($rslt);
if ($VVCAL_ct > 0)
{
$ten_min_ago = date("Y-m-d H:i:s", mktime(date("H"),date("i")-10,date("s"),date("m"),date("d"),date("Y")));
$stmt = "SELECT amd_status,amd_cause,text,total_detection_ms FROM vicidial_vca_log where call_id='$callerid' and analysis_date > \"$ten_min_ago\";";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);}
$VVCALd_ct = mysqli_num_rows($rslt);
if ($VVCALd_ct > 0)
{
$row=mysqli_fetch_row($rslt);
$VCAamd_status = $row[0];
$VCAamd_cause = $row[1];
$VCAtext = $row[2];
$VCAlength_ms = $row[3];
$VCAlength = ($VCAlength_ms / 1000);
$VCAlength = sprintf("%.1f", $VCAlength);
$VCAdata = "$VCAamd_status---$VCAamd_cause---$VCAlength---$VCAtext";
# $fp = fopen ("./vicidial_VCA_debug.txt", 'a');
# fwrite ($fp, "$NOW_TIME|$VCAdata\n");
# fclose($fp);
}
}
}
}
echo "$VDCL_group_web|$VDCL_group_name||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|X|X||||$VDCL_group_web_two|$VDCL_timer_action|$VDCL_timer_action_message|$VDCL_timer_action_seconds|$VDCL_xferconf_c_number|$VDCL_xferconf_d_number|$VDCL_xferconf_e_number||||$VDCL_timer_action_destination|||||||$VDCL_group_web_three|$VDCL_ingroup_script_color|||$VDCL_campaign_script_two|$VDCL_ingroup_script_color_two|||$stereo_recording|$stereo_recording_agent|$talk_sec_urls_secs||$VCAdata|\n|\n";
if (preg_match('/X/',$dialed_label))
{
@@ -11829,8 +11870,8 @@ if ($ACTION == 'VDADcheckINCOMING')
if ( ($SSrecording_dtmf_detection > 0) and ($SSrecording_dtmf_muting > 0) )
{if ($SSrecording_dtmf_muting > 1) {$recording_dtmf_muting = $SSrecording_dtmf_muting;} }
### if web form is set then send on to vicidial.php for override of WEB_FORM address
if ( (strlen($VDCL_group_web)>5) or (strlen($VDCL_group_name)>0) ) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|$VDCL_default_group_alias|$VDCL_caller_id_number|$VDCL_group_web_vars|$VDCL_group_web_two|$VDCL_timer_action|$VDCL_timer_action_message|$VDCL_timer_action_seconds|$VDCL_xferconf_c_number|$VDCL_xferconf_d_number|$VDCL_xferconf_e_number|$VDCL_uniqueid_status_display|$custom_call_id|$VDCL_uniqueid_status_prefix|$VDCL_timer_action_destination|$DID_id|$DID_extension|$DID_pattern|$DID_description|$INclosecallid|$INxfercallid|$VDCL_group_web_three|$VDCL_ingroup_script_color|$VDCL_inbound_survey|$VDCL_survey_participate|$VDCL_ingroup_script_two|$VDCL_ingroup_script_color_two|$VDCL_browser_alert_sound|$VDCL_browser_alert_volume|$stereo_recording|$stereo_recording_agent|$talk_sec_urls_secs|$recording_dtmf_muting|\n";}
else {echo "X|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|$VDCL_default_group_alias|$VDCL_caller_id_number|$VDCL_group_web_vars|$VDCL_group_web_two|$VDCL_timer_action|$VDCL_timer_action_message|$VDCL_timer_action_seconds|$VDCL_xferconf_c_number|$VDCL_xferconf_d_number|$VDCL_xferconf_e_number|$VDCL_uniqueid_status_display|$custom_call_id|$VDCL_uniqueid_status_prefix|$VDCL_timer_action_destination|$DID_id|$DID_extension|$DID_pattern|$DID_description|$INclosecallid|$INxfercallid|$VDCL_group_web_three|$VDCL_ingroup_script_color|$VDCL_inbound_survey|$VDCL_survey_participate|$VDCL_ingroup_script_two|$VDCL_ingroup_script_color_two|$VDCL_browser_alert_sound|$VDCL_browser_alert_volume|$stereo_recording|$stereo_recording_agent|$talk_sec_urls_secs|$recording_dtmf_muting|\n";}
if ( (strlen($VDCL_group_web)>5) or (strlen($VDCL_group_name)>0) ) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|$VDCL_default_group_alias|$VDCL_caller_id_number|$VDCL_group_web_vars|$VDCL_group_web_two|$VDCL_timer_action|$VDCL_timer_action_message|$VDCL_timer_action_seconds|$VDCL_xferconf_c_number|$VDCL_xferconf_d_number|$VDCL_xferconf_e_number|$VDCL_uniqueid_status_display|$custom_call_id|$VDCL_uniqueid_status_prefix|$VDCL_timer_action_destination|$DID_id|$DID_extension|$DID_pattern|$DID_description|$INclosecallid|$INxfercallid|$VDCL_group_web_three|$VDCL_ingroup_script_color|$VDCL_inbound_survey|$VDCL_survey_participate|$VDCL_ingroup_script_two|$VDCL_ingroup_script_color_two|$VDCL_browser_alert_sound|$VDCL_browser_alert_volume|$stereo_recording|$stereo_recording_agent|$talk_sec_urls_secs|$recording_dtmf_muting|$VCAdata|\n";}
else {echo "X|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|$VDCL_default_group_alias|$VDCL_caller_id_number|$VDCL_group_web_vars|$VDCL_group_web_two|$VDCL_timer_action|$VDCL_timer_action_message|$VDCL_timer_action_seconds|$VDCL_xferconf_c_number|$VDCL_xferconf_d_number|$VDCL_xferconf_e_number|$VDCL_uniqueid_status_display|$custom_call_id|$VDCL_uniqueid_status_prefix|$VDCL_timer_action_destination|$DID_id|$DID_extension|$DID_pattern|$DID_description|$INclosecallid|$INxfercallid|$VDCL_group_web_three|$VDCL_ingroup_script_color|$VDCL_inbound_survey|$VDCL_survey_participate|$VDCL_ingroup_script_two|$VDCL_ingroup_script_color_two|$VDCL_browser_alert_sound|$VDCL_browser_alert_volume|$stereo_recording|$stereo_recording_agent|$talk_sec_urls_secs|$recording_dtmf_muting|$VCAdata|\n";}
if (strlen($fronter) < 2) {$fronter = $tsr;}
$stmt = "SELECT full_name from vicidial_users where user='$fronter';";
+59 -3
View File
@@ -758,10 +758,11 @@
# 260302-0935 - Code updates for PHP8 compatibility
# 260324-0857 - Added hangup_again_link campaign option
# 260408-1850 - Added max_inbound_auto_reenable option
# 260529-0914 - Added AMDnotesBox
#
$version = '2.14-724c';
$build = '260408-1850';
$version = '2.14-725c';
$build = '260529-0914';
$php_script = 'vicidial.php';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=110;
@@ -6880,6 +6881,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
var previous_agent_log_id='<?php echo $agent_log_id ?>';
var alert_box_close_counter=0;
var dial_box_close_counter=0;
var amd_box_close_counter=0;
var api_switch_lead_triggered=0;
var agent_xfer_validation='<?php echo $agent_xfer_validation ?>';
var agent_xfer_group_selected='';
@@ -7014,6 +7016,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
var talk_sec_url_secs='';
var redirectserverip='';
var hangup_again_link_trigger=<?php echo $hangup_again_link_trigger ?>;
var VCAdata='x';
var DiaLControl_auto_HTML = "<a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADready','','','','','','','YES');\"><img src=\"./images/<?php echo _QXZ("vdc_LB_paused.gif") ?>\" border=\"0\" alt=\"You are paused\" /></a>";
var DiaLControl_auto_HTML_ready = "<a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADpause','','','','','','','YES');\"><img src=\"./images/<?php echo _QXZ("vdc_LB_active.gif") ?>\" border=\"0\" alt=\"You are active\" /></a>";
var DiaLControl_auto_HTML_OFF = "<img src=\"./images/<?php echo _QXZ("vdc_LB_blank_OFF.gif") ?>\" border=\"0\" alt=\"pause button disabled\" />";
@@ -13754,6 +13757,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
three_way_call_cid = orig_three_way_call_cid;
APIskip=0;
temp_XFmin_talk_sec=0;
VCAdata='x';
document.getElementById("BannerPanel").style.background = panel_bgcolor;
document.getElementById("BannerPanel").innerHTML = '';
if (manual_dial_preview < 1)
@@ -14608,7 +14612,8 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
VDICstereo_recording_agent = VDIC_data_VDIG[43];
talk_sec_url_secs = VDIC_data_VDIG[44];
recording_dtmf_muting = VDIC_data_VDIG[45];
// alert("talk_sec_url_secs: |" + talk_sec_url_secs + "|");
VCAdata = VDIC_data_VDIG[46];
// alert("VCAdata: |" + VCAdata + "|");
var VDIC_data_VDFR=check_VDIC_array[3].split("|");
if ( (VDIC_data_VDFR[1].length > 1) && (VDCL_fronter_display == 'Y') )
{VDIC_fronter = " <?php echo _QXZ("Fronter:"); ?> " + VDIC_data_VDFR[0] + " - " + VDIC_data_VDFR[1];}
@@ -14763,6 +14768,17 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
gVD_statuses_ct = 0;
gVARSELstatuses_ct = 0;
if (VCAdata.length > 12)
{
button_click_log = button_click_log + "" + SQLdate + "-----AMDnotesDisplayed---|";
var VCAdata_elements=VCAdata.split("---");
document.getElementById("AMDnotesBoxA").innerHTML = "<b><?php echo _QXZ("Analysis Status:"); ?> </b>" + VCAdata_elements[0];
document.getElementById("AMDnotesBoxB").innerHTML = "<b><?php echo _QXZ("Analysis Cause:"); ?> </b>" + VCAdata_elements[1];
document.getElementById("AMDnotesBoxC").innerHTML = "<b><?php echo _QXZ("Greeting Length:"); ?> </b>" + VCAdata_elements[2];
document.getElementById("AMDnotesBoxD").innerHTML = "<b><?php echo _QXZ("Detected Words:"); ?> </b><br />" + VCAdata_elements[3];
showDiv('AMDnotesBox');
amd_box_close_counter=15;
}
if (status_group_statuses_data.length > 7)
{
var gVARstatusesRAW=status_group_statuses_data.split(',');
@@ -16780,6 +16796,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
MD_dial_timed_out=0;
MDcheck_for_answer=0;
VDRP_stage_seconds=0;
VCAdata='x';
// UPDATE VICIDIAL_LOG ENTRY FOR THIS CALL PROCESS
DialLog("end",nodeletevdac);
@@ -18205,6 +18222,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
APIskip=0;
talk_sec_url_secs='';
temp_XFmin_talk_sec=0;
VCAdata='x';
document.getElementById("BannerPanel").style.background = panel_bgcolor;
document.getElementById("BannerPanel").innerHTML = '';
if (manual_auto_next > 0)
@@ -18262,6 +18280,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
{
document.getElementById("NexTCalLPausE").innerHTML = "<a href=\"#\" onclick=\"next_call_pause_click();return false;\"><?php echo _QXZ("Next Call Pause"); ?></a>";
}
AMDnotesBoxhide();
CBcommentsBoxhide();
EAcommentsBoxhide();
ContactSearchReset();
@@ -21853,6 +21872,19 @@ function phone_number_format(formatphone) {
}
// ################################################################################
// Hide the AMDnotesBox span upon click
function AMDnotesBoxhide()
{
button_click_log = button_click_log + "" + SQLdate + "-----AMDnotesBoxhide---|";
document.getElementById("AMDnotesBoxA").innerHTML = "";
document.getElementById("AMDnotesBoxB").innerHTML = "";
document.getElementById("AMDnotesBoxC").innerHTML = "";
document.getElementById("AMDnotesBoxD").innerHTML = "";
hideDiv('AMDnotesBox');
}
// ################################################################################
// Hide the CBcommentsBox span upon click
function CBcommentsBoxhide()
@@ -22198,6 +22230,7 @@ function phone_number_format(formatphone) {
// hideDiv('NothingBox2');
hideDiv('ScriptTopBGspan');
hideDiv('ManualValidateBox');
hideDiv('AMDnotesBox');
hideDiv('CBcommentsBox');
hideDiv('EAcommentsBox');
hideDiv('EAcommentsMinBox');
@@ -23081,6 +23114,12 @@ function phone_number_format(formatphone) {
if (dial_box_close_counter < 1)
{hideDiv('TimerSpan');}
}
if (amd_box_close_counter > 0)
{
amd_box_close_counter = (amd_box_close_counter - 1);
if (amd_box_close_counter < 1)
{AMDnotesBoxhide();}
}
if (left_3way_timeout > 0)
{left_3way_timeout = (left_3way_timeout - 1);}
@@ -25269,6 +25308,23 @@ if ($agent_display_dialable_leads > 0)
</TABLE>
</span>
<?php //end AUDIT COMMENTS ADDED BY POUNDTEAM // ?>
<span style="position:absolute;left:160px;top:<?php echo $HTheight ?>px;z-index:<?php $zi++; echo $zi ?>;" id="AMDnotesBox">
<table border="0" bgcolor="#99FFCC" width="600px" height="70px">
<tr bgcolor="#33FF99">
<td align="left"><font class="sh_text"> <?php echo _QXZ("Outbound Call Greeting Analysis:"); ?> </font></td>
<td align="right"><font class="sk_text"> <a href="#" onclick="AMDnotesBoxhide();return false;"><?php echo _QXZ("close"); ?></a> </font></td>
</tr><tr>
<td><font class="sh_text">
<span id="AMDnotesBoxA"></span><br />
<span id="AMDnotesBoxB"></span><br />
<span id="AMDnotesBoxC"></span><br />
</font></td>
<td width="280px"><font class="sh_text">
<span id="AMDnotesBoxD"></span>
</font></td>
</tr></table>
</span>
<span style="position:absolute;left:5px;top:<?php echo $HTheight ?>px;z-index:<?php $zi++; echo $zi ?>;" id="CBcommentsBox">
<table border="0" bgcolor="#FFFFCC" width="<?php echo $HCwidth ?>px" height="70px">
<tr bgcolor="#FFFF66">