From 8f5d165d5ce641c758c021fc8c55c3037058489c Mon Sep 17 00:00:00 2001 From: mattf Date: Sat, 16 Jan 2010 21:47:32 +0000 Subject: [PATCH] small manual dial bug fix, issue 271 git-svn-id: svn://192.168.202.10@1308 3d104415-ff17-0410-8863-d5cf3c621b8a --- bin/FastAGI_log.pl | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/bin/FastAGI_log.pl b/bin/FastAGI_log.pl index 8382050b..f3ae864f 100644 --- a/bin/FastAGI_log.pl +++ b/bin/FastAGI_log.pl @@ -574,6 +574,23 @@ sub process_request if ($carrier_logging_active > 0) { + if ($callerid =~ /^M/) + { + $beginUNIQUEID = $unique_id; + $beginUNIQUEID =~ s/\..*//gi; + $stmtA = "SELECT uniqueid FROM call_log where uniqueid LIKE \"$beginUNIQUEID%\" and caller_code LIKE \"%$CIDlead_id\";"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_count=0; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $unique_id = $aryA[0]; + $uniqueid = $aryA[0]; + } + $sthA->finish(); + } $stmtA = "INSERT IGNORE INTO vicidial_carrier_log set uniqueid='$uniqueid',call_date='$now_date',server_ip='$VARserver_ip',lead_id='$CIDlead_id',hangup_cause='$hangup_cause',dialstatus='$dialstatus',channel='$channel',dial_time='$dial_time',answered_time='$answered_time';"; if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} $VCARaffected_rows = $dbhA->do($stmtA);