small fixes for inbound and AMD

git-svn-id: svn://192.168.202.10@1423 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2010-04-30 20:38:30 +00:00
parent 7b1349cd14
commit 27a578892c
4 changed files with 34 additions and 32 deletions
+16 -15
View File
@@ -1,6 +1,6 @@
#!/usr/bin/perl
#
# VD_amd.agi version 2.2.0 *DBI-version*
# VD_amd.agi version 2.2.0
#
# runs after a call goes through AMD in extensions.conf to send the call on to
# it's proper destination, or when agent sends to VM message
@@ -35,6 +35,7 @@
# 90924-1533 - Added answering machine message list_id override option
# 100205-1025 - Fixed CPD send to message
# 100327-0819 - Fixed issue with Manual dial treansfers
# 100430-1606 - Added list_id update to vicidial_log updates
#
$script = 'VD_amd.agi';
@@ -320,6 +321,18 @@ else
if ($AGILOG) {$agi_string = "-- VDAD vicidial_list update: |$affected_rows|$VD_lead_id"; &agi_output;}
}
### find list_id for this lead
$stmtA = "SELECT list_id from vicidial_list where lead_id = '$VD_lead_id';";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArowsL=$sthA->rows;
if ($sthArowsL > 0)
{
@aryA = $sthA->fetchrow_array;
$VD_list_id = $aryA[0];
}
$sthA->finish();
########## DELETE vicidial_auto_calls entry ##########
$stmtA = "DELETE FROM vicidial_auto_calls where callerid='$callerid' order by auto_call_id desc limit 1;";
$affected_rows = $dbhA->do($stmtA);
@@ -344,14 +357,14 @@ else
{
if ($AGILOG) {$agi_string = "no VDL record found: $uniqueid $calleridname $VD_lead_id $uniqueid"; &agi_output;}
$end_epoch = ($now_date_epoch + 3);
$stmtA = "INSERT INTO vicidial_log (uniqueid,lead_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,processed,length_in_sec,end_epoch) values('$uniqueid','$VD_lead_id','$VD_campaign_id','$now_date','$now_date_epoch','AA','$VD_phone_code','$VD_phone_number','VDAD','N','3','$end_epoch')";
$stmtA = "INSERT INTO vicidial_log (uniqueid,lead_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,processed,length_in_sec,end_epoch,list_id) values('$uniqueid','$VD_lead_id','$VD_campaign_id','$now_date','$now_date_epoch','AA','$VD_phone_code','$VD_phone_number','VDAD','N','3','$end_epoch','$VD_list_id')";
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
$affected_rows = $dbhA->do($stmtA);
}
else
{
$VD_seconds = ($now_date_epoch - $VD_start_epoch);
$stmtA = "UPDATE vicidial_log set status='AA',end_epoch='$now_date_epoch',length_in_sec='$VD_seconds' where uniqueid='$uniqueid' and lead_id='$VD_lead_id' order by call_date desc limit 1;";
$stmtA = "UPDATE vicidial_log set status='AA',end_epoch='$now_date_epoch',length_in_sec='$VD_seconds',list_id='$VD_list_id' 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 update: |$affected_rows|$uniqueid|"; &agi_output;}
@@ -396,18 +409,6 @@ else
### check for list_id override
if ( ($DB_amd_send_to_vmx =~ /Y/) || ($AMDSTATUS =~ /CPD/) )
{
### find list_id for this lead
$stmtA = "SELECT list_id from vicidial_list where lead_id = '$VD_lead_id';";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArowsL=$sthA->rows;
if ($sthArowsL > 0)
{
@aryA = $sthA->fetchrow_array;
$VD_list_id = $aryA[0];
}
$sthA->finish();
$am_message_exten_override='';
### gather list_id overrides
$stmtA = "SELECT am_message_exten_override FROM vicidial_lists where list_id='$VD_list_id';";
@@ -2411,7 +2411,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
$dbhP=$dbhA; $mysql_count='02081'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
if ($AGILOG) {$agi_string = "-- VDAC posttime record: |$affected_rows|$FDtsSQLdate|$callerid|"; &agi_output;}
if (length($onhold_prompt_filename) > 0)
if ( (length($onhold_prompt_filename) > 0) && ($onhold_prompt_filename !~ /---NONE---/) )
{
$AGI->stream_file('sip-silence'); # stop music-on-hold process
$AGI->stream_file('sip-silence'); # stop music-on-hold process
+16 -15
View File
@@ -1,6 +1,6 @@
#!/usr/bin/perl
#
# VD_amd.agi version 2.2.0 *DBI-version*
# VD_amd.agi version 2.2.0
#
# runs after a call goes through AMD in extensions.conf to send the call on to
# it's proper destination, or when agent sends to VM message
@@ -35,6 +35,7 @@
# 90924-1533 - Added answering machine message list_id override option
# 100205-1025 - Fixed CPD send to message
# 100327-0819 - Fixed issue with Manual dial treansfers
# 100430-1606 - Added list_id update to vicidial_log updates
#
$script = 'VD_amd.agi';
@@ -321,6 +322,18 @@ else
if ($AGILOG) {$agi_string = "-- VDAD vicidial_list update: |$affected_rows|$VD_lead_id"; &agi_output;}
}
### find list_id for this lead
$stmtA = "SELECT list_id from vicidial_list where lead_id = '$VD_lead_id';";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArowsL=$sthA->rows;
if ($sthArowsL > 0)
{
@aryA = $sthA->fetchrow_array;
$VD_list_id = $aryA[0];
}
$sthA->finish();
########## DELETE vicidial_auto_calls entry ##########
$stmtA = "DELETE FROM vicidial_auto_calls where callerid='$callerid' order by auto_call_id desc limit 1;";
$affected_rows = $dbhA->do($stmtA);
@@ -345,14 +358,14 @@ else
{
if ($AGILOG) {$agi_string = "no VDL record found: $uniqueid $calleridname $VD_lead_id $uniqueid"; &agi_output;}
$end_epoch = ($now_date_epoch + 3);
$stmtA = "INSERT INTO vicidial_log (uniqueid,lead_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,processed,length_in_sec,end_epoch) values('$uniqueid','$VD_lead_id','$VD_campaign_id','$now_date','$now_date_epoch','AA','$VD_phone_code','$VD_phone_number','VDAD','N','3','$end_epoch')";
$stmtA = "INSERT INTO vicidial_log (uniqueid,lead_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,processed,length_in_sec,end_epoch,list_id) values('$uniqueid','$VD_lead_id','$VD_campaign_id','$now_date','$now_date_epoch','AA','$VD_phone_code','$VD_phone_number','VDAD','N','3','$end_epoch','$VD_list_id')";
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
$affected_rows = $dbhA->do($stmtA);
}
else
{
$VD_seconds = ($now_date_epoch - $VD_start_epoch);
$stmtA = "UPDATE vicidial_log set status='AA',end_epoch='$now_date_epoch',length_in_sec='$VD_seconds' where uniqueid='$uniqueid' and lead_id='$VD_lead_id' order by call_date desc limit 1;";
$stmtA = "UPDATE vicidial_log set status='AA',end_epoch='$now_date_epoch',length_in_sec='$VD_seconds',list_id='$VD_list_id' 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 update: |$affected_rows|$uniqueid|"; &agi_output;}
@@ -397,18 +410,6 @@ else
### check for list_id override
if ( ($DB_amd_send_to_vmx =~ /Y/) || ($AMDSTATUS =~ /CPD/) )
{
### find list_id for this lead
$stmtA = "SELECT list_id from vicidial_list where lead_id = '$VD_lead_id';";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArowsL=$sthA->rows;
if ($sthArowsL > 0)
{
@aryA = $sthA->fetchrow_array;
$VD_list_id = $aryA[0];
}
$sthA->finish();
$am_message_exten_override='';
### gather list_id overrides
$stmtA = "SELECT am_message_exten_override FROM vicidial_lists where list_id='$VD_list_id';";
+1 -1
View File
@@ -2750,7 +2750,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) )
$dbhP=$dbhA; $mysql_count='02081'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
if ($AGILOG) {$agi_string = "-- VDAC posttime record: |$affected_rows|$FDtsSQLdate|$callerid|"; &agi_output;}
if (length($onhold_prompt_filename) > 0)
if ( (length($onhold_prompt_filename) > 0) && ($onhold_prompt_filename !~ /---NONE---/) )
{
$AGI->stream_file('sip-silence'); # stop music-on-hold process
$AGI->stream_file('sip-silence'); # stop music-on-hold process