small fixes for transfer double_log and blind transfers

git-svn-id: svn://192.168.202.10@1414 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2010-04-21 06:12:14 +00:00
parent c2d7764b64
commit e5ccda27cd
3 changed files with 40 additions and 31 deletions
+6 -6
View File
@@ -405,9 +405,9 @@ if ($call_handle_method =~ /^CLOSER/)
$callerid = $JqueryCID;
$VCcallerid = $JqueryCID;
### set the new call callerid to track the call
print "SET CALLERID $JqueryCID\n";
checkresult($result);
if ($AGILOG) {$agi_string = "callerID changed: $JqueryCID"; &agi_output;}
$Jnewcallerid = "\"$JqueryCID <$phone_number>\"";
$AGI->set_callerid($Jnewcallerid);
if ($AGILOG) {$agi_string = "callerID changed: $Jnewcallerid"; &agi_output;}
}
}
@@ -1189,9 +1189,9 @@ $YqueryCID = "Y$CIDdate$PADlead_id";
$callerid = $YqueryCID;
$VCcallerid = $YqueryCID;
### set the callerid
print "SET CALLERID $YqueryCID\n";
checkresult($result);
if ($AGILOG) {$agi_string = "callerID changed: $YqueryCID"; &agi_output;}
$Ynewcallerid = "\"$YqueryCID <$originalCID>\"";
$AGI->set_callerid($Ynewcallerid);
if ($AGILOG) {$agi_string = "callerID changed: $Ynewcallerid"; &agi_output;}
if ($call_handle_method =~ /DIGITID$/)
{
+10
View File
@@ -1573,6 +1573,11 @@ while ($drop_timer <= $DROP_TIME)
$newcallerid = "\"$callerid $eac_extension <$phone_number>\"";
$AGI->set_callerid($newcallerid);
}
else
{
$newcallerid = "\"$callerid <$phone_number>\"";
$AGI->set_callerid($newcallerid);
}
}
$stmtA = "UPDATE vicidial_auto_calls set status='XFER', stage='XFER-$drop_timer', extension='$VDADconf_exten' where callerid='$callerid';";
@@ -1857,6 +1862,11 @@ while ($drop_timer <= $DROP_TIME)
$newcallerid = "\"$callerid $eac_extension <$phone_number>\"";
$AGI->set_callerid($newcallerid);
}
else
{
$newcallerid = "\"$callerid <$phone_number>\"";
$AGI->set_callerid($newcallerid);
}
}
$VDADremDIALstr .= "$VDADconf_exten";
+24 -25
View File
@@ -670,32 +670,31 @@ sub process_request
}
$sthA->finish();
}
### BEGIN Double-log end logging ###
$DOUBLEunique_id = $unique_id . "99";
$stmtA = "SELECT start_epoch FROM call_log where uniqueid='$DOUBLEunique_id' and channel_group='DOUBLE_LOG' order by start_time desc limit 1;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
$DOUBLEstart_epoch = $aryA[0];
$DOUBLElength_in_sec = ($now_date_epoch - $DOUBLEstart_epoch);
$DOUBLElength_in_min = ($DOUBLElength_in_sec / 60);
$DOUBLElength_in_min = sprintf("%8.2f", $DOUBLElength_in_min);
$stmtA = "UPDATE call_log set end_time='$now_date',end_epoch='$now_date_epoch',length_in_sec=$DOUBLElength_in_sec,length_in_min='$DOUBLElength_in_min' where uniqueid='$DOUBLEunique_id' and channel_group='DOUBLE_LOG' order by start_time desc limit 1";
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
$affected_rowsDB = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "DOUBLE QUERY done: start time = $DOUBLEstart_epoch | sec: $DOUBLElength_in_sec | min: $DOUBLElength_in_min |$affected_rowsDB"; &agi_output;}
}
$sthA->finish();
### END Double-log end logging ###
}
### BEGIN Double-log end logging ###
$DOUBLEunique_id = $unique_id . "99";
$stmtA = "SELECT start_epoch FROM call_log where uniqueid='$DOUBLEunique_id' and channel_group='DOUBLE_LOG' order by start_time desc limit 1;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
$DOUBLEstart_epoch = $aryA[0];
$DOUBLElength_in_sec = ($now_date_epoch - $DOUBLEstart_epoch);
$DOUBLElength_in_min = ($DOUBLElength_in_sec / 60);
$DOUBLElength_in_min = sprintf("%8.2f", $DOUBLElength_in_min);
$stmtA = "UPDATE call_log set end_time='$now_date',end_epoch='$now_date_epoch',length_in_sec=$DOUBLElength_in_sec,length_in_min='$DOUBLElength_in_min' where uniqueid='$DOUBLEunique_id' and channel_group='DOUBLE_LOG' order by start_time desc limit 1";
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
$affected_rowsDB = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "DOUBLE QUERY done: start time = $DOUBLEstart_epoch | sec: $DOUBLElength_in_sec | min: $DOUBLElength_in_min |$affected_rowsDB"; &agi_output;}
}
$sthA->finish();
### END Double-log end logging ###
$stmtA = "DELETE from live_inbound where uniqueid IN('$unique_id','$CALLunique_id') and server_ip='$VARserver_ip'";
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}