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:
@@ -73,10 +73,11 @@
|
||||
# 250924-2152 - Added code for deprecation of "Monitor" application after Asterisk 20
|
||||
# 251006-0903 - If recording_dtmf_muting enabled, force use of MixMonitor for recording
|
||||
# 260129-1443 - Added code to reinsert missing vicidial_auto_calls record
|
||||
# 260527-0902 - Updates for ViciAMD
|
||||
#
|
||||
|
||||
$script = 'VD_amd.agi';
|
||||
$build = '260129-1443';
|
||||
$build = '260527-0902';
|
||||
|
||||
$A = 1; # set to 1 for AMD output messages mode
|
||||
$AMD_LOG = 3; # set to 1 for logfile and 2 forDB log, 3 for both
|
||||
@@ -407,6 +408,8 @@ $amd_agent_route_options='';
|
||||
$AMDcontainer_entry='';
|
||||
$AMD_agent_send=0;
|
||||
$NOAUDIODATA_hangup_enabled=0;
|
||||
$FAX_hangup_enabled=0;
|
||||
$FAS_hangup_enabled=0;
|
||||
$VL_status_updates=1;
|
||||
$stmtA = "SELECT amd_agent_route_options,manual_vm_status_updates FROM vicidial_campaigns where campaign_id='$VD_campaign_id' limit 1;";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
@@ -456,6 +459,14 @@ if ($amd_agent_route_options =~ /ENABLED/i)
|
||||
{
|
||||
$NOAUDIODATA_hangup_enabled++;
|
||||
}
|
||||
if ($AMDcontainer_lines[$c] =~ /FAX-Hangup-ENABLED/)
|
||||
{
|
||||
$FAX_hangup_enabled++;
|
||||
}
|
||||
if ($AMDcontainer_lines[$c] =~ /FAS-Hangup-ENABLED/)
|
||||
{
|
||||
$FAS_hangup_enabled++;
|
||||
}
|
||||
$c++;
|
||||
}
|
||||
}
|
||||
@@ -464,7 +475,7 @@ if ($amd_agent_route_options =~ /ENABLED/i)
|
||||
|
||||
##################################################################################
|
||||
########## AMD says it's a person so exit and go on to transfer scripts ##########
|
||||
if ( ( ($AMDSTATUS =~ /PERSON|HUMAN|NOTSURE|HANGUP/) && ($force_playback !~ /YES/) && (length($AMDcontainer_entry) < 4) ) || ( ($AMD_agent_send > 0) && (length($AMDcontainer_entry) > 3) ) )
|
||||
if ( ( ($AMDSTATUS =~ /PERSON|HUMAN|NOTSURE|HANGUP|CALLSCREEN/) && ($force_playback !~ /YES/) && (length($AMDcontainer_entry) < 4) ) || ( ($AMD_agent_send > 0) && (length($AMDcontainer_entry) > 3) ) )
|
||||
{
|
||||
if ($A)
|
||||
{
|
||||
@@ -862,24 +873,29 @@ else
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ($AMDRESPONSE =~ /^NOAUDIODATA/) && ($NOAUDIODATA_hangup_enabled > 0) )
|
||||
if ( ( ($AMDRESPONSE =~ /^NOAUDIODATA/) && ($NOAUDIODATA_hangup_enabled > 0) ) || ( ($AMDRESPONSE =~ /^FAX/) && ($FAX_hangup_enabled > 0) ) || ( ($AMDRESPONSE =~ /^FAS/) && ($FAS_hangup_enabled > 0) ) )
|
||||
{
|
||||
### No audio, let's update lead, log and hangup.
|
||||
$stmtA = "UPDATE vicidial_log set status='ADAIR' where uniqueid='$uniqueid' and lead_id='$VD_lead_id' order by call_date desc limit 1;";
|
||||
$hangup_status='ADAIR';
|
||||
if ( ($AMDRESPONSE =~ /^FAX/) && ($FAX_hangup_enabled > 0) )
|
||||
{$hangup_status='FAXHU';}
|
||||
if ( ($AMDRESPONSE =~ /^FAS/) && ($FAS_hangup_enabled > 0) )
|
||||
{$hangup_status='FASHU';}
|
||||
### If No Audio or a Fax or a False Answer, let's update lead, log and hangup.
|
||||
$stmtA = "UPDATE vicidial_log set status='$hangup_status' where uniqueid='$uniqueid' and lead_id='$VD_lead_id' order by call_date desc limit 1;";
|
||||
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
if ($AGILOG) {$agi_string = "-- VDAD vicidial_log ADAIR update: |$affected_rows|$uniqueid|"; &agi_output;}
|
||||
if ($AGILOG) {$agi_string = "-- VDAD vicidial_log $hangup_status update: |$affected_rows|$uniqueid|"; &agi_output;}
|
||||
|
||||
$stmtA = "UPDATE vicidial_list set status='ADAIR' where lead_id='$VD_lead_id';";
|
||||
$stmtA = "UPDATE vicidial_list set status='$hangup_status' where lead_id='$VD_lead_id';";
|
||||
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
|
||||
if ($VL_status_updates > 0)
|
||||
{
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
if ($AGILOG) {$agi_string = "-- VDAD vicidial_list ADAIR update: |$affected_rows|$uniqueid"; &agi_output;}
|
||||
if ($AGILOG) {$agi_string = "-- VDAD vicidial_list $hangup_status update: |$affected_rows|$uniqueid"; &agi_output;}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($AGILOG) {$agi_string = "-- VDAD vicidial_list ADAIR update DISABLED: |$calleridname|$uniqueid|$VL_status_updates|$manual_vm_status_updates|"; &agi_output;}
|
||||
if ($AGILOG) {$agi_string = "-- VDAD vicidial_list $hangup_status update DISABLED: |$calleridname|$uniqueid|$VL_status_updates|$manual_vm_status_updates|"; &agi_output;}
|
||||
}
|
||||
|
||||
$dbhA->disconnect();
|
||||
|
||||
Reference in New Issue
Block a user