Added Code to hangup & dispo NOAUDIODATA as ADAIR (Dead Air Auto) with Settings Container option, Issue #1459
git-svn-id: svn://192.168.202.10@3706 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
# exten => _8320*.,1,AGI(VD_amd.agi,${EXTEN}-----YES)
|
||||
# exten => _8320*.,2,Hangup
|
||||
#
|
||||
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2023 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# changes:
|
||||
# 60206-1434 - first build
|
||||
@@ -63,9 +63,11 @@
|
||||
# 200311-0041 - Added amd_agent_route_options feature
|
||||
# 200424-1839 - Added STC(settings-container) and LTT(lead temp table) message playback options
|
||||
# 220411-0833 - Added FHG(file-http-get) message playback option to download file from website
|
||||
# 230412-1023 - Added Code to dispo NOAUDIODATA as ADAIR (Dead Air Auto) with Settings Container option, Issue #1459
|
||||
#
|
||||
|
||||
$script = 'VD_amd.agi';
|
||||
$build = '230412-1023';
|
||||
|
||||
$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
|
||||
@@ -175,7 +177,7 @@ $sthA->finish();
|
||||
if (length($ARGV[0])>1)
|
||||
{
|
||||
if ($AGILOG)
|
||||
{$agi_string = "Perl Environment Dump:"; &agi_output;}
|
||||
{$agi_string = "Perl Environment Dump: (build $build)"; &agi_output;}
|
||||
$i=0;
|
||||
while ($#ARGV >= $i)
|
||||
{
|
||||
@@ -342,6 +344,7 @@ if ( (length($CLIphone_number) > 1) && (length($VD_phone_number) < 1) )
|
||||
$amd_agent_route_options='';
|
||||
$AMDcontainer_entry='';
|
||||
$AMD_agent_send=0;
|
||||
$NOAUDIODATA_hangup_enabled=0;
|
||||
$stmtA = "SELECT amd_agent_route_options FROM vicidial_campaigns where campaign_id='$VD_campaign_id' limit 1;";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
@@ -383,6 +386,10 @@ if ($amd_agent_route_options =~ /ENABLED/i)
|
||||
if ($AGILOG) {$agi_string = "AMD Agent send MATCH: $c|$AMDline[0]($AMDSTATUS)|$AMDline[1]($AMDRESPONSE)|"; &agi_output;}
|
||||
}
|
||||
}
|
||||
if ($AMDcontainer_lines[$c] =~ /NOAUDIODATA-Hangup-ENABLED/)
|
||||
{
|
||||
$NOAUDIODATA_hangup_enabled++;
|
||||
}
|
||||
$c++;
|
||||
}
|
||||
}
|
||||
@@ -741,6 +748,26 @@ else
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ($AMDRESPONSE =~ /^NOAUDIODATA/) && ($NOAUDIODATA_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;";
|
||||
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;}
|
||||
|
||||
$stmtA = "UPDATE vicidial_list set status='ADAIR' where lead_id='$VD_lead_id';";
|
||||
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
if ($AGILOG) {$agi_string = "-- VDAD vicidial_list ADAIR update: |$affected_rows|$uniqueid|"; &agi_output;}
|
||||
|
||||
$dbhA->disconnect();
|
||||
|
||||
$AGI->hangup($channel);
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ( ($DB_amd_send_to_vmx =~ /Y/) || ($force_playback =~ /YES/) ) && (length($DB_am_message_exten) > 0) )
|
||||
{
|
||||
$msg_status='AM';
|
||||
|
||||
Reference in New Issue
Block a user