[freeside-commits] branch master updated. b391b1ce982eb659dcba167dc1c3a883dd437325

Ivan ivan at 420.am
Tue Mar 21 08:52:30 PDT 2017


The branch, master has been updated
       via  b391b1ce982eb659dcba167dc1c3a883dd437325 (commit)
      from  d22004dc0909c8a7fca5a44aa596c4d4f590b558 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit b391b1ce982eb659dcba167dc1c3a883dd437325
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Tue Mar 21 08:52:29 2017 -0700

    asterisk v12 CDRs, RT#71704

diff --git a/FS/bin/freeside-cdr-asterisk_sql b/FS/bin/freeside-cdr-asterisk_sql
index 6e63ff0..529ec9b 100755
--- a/FS/bin/freeside-cdr-asterisk_sql
+++ b/FS/bin/freeside-cdr-asterisk_sql
@@ -104,17 +104,17 @@ while ( my $row = $sth->fetchrow_hashref ) {
 
     $imports++;
 
-    my $where = '';
+    my $usql = "UPDATE $table SET freesidestatus = 'done' WHERE ";
     my @args = ();
     if ( $opt{V} >= 12 ) {
-      $where = 'id = '. $row->{'id'};
+      $usql .= ' id = '. $row->{'id'};
       @args = ( undef );
     } else {
-      $where = 'calldate = ? AND src = ? AND dst = ?';
+      $usql .= ' calldate = ? AND src = ? AND dst = ?';
       @args = ( undef, $row->{'calldate'}, $row->{'src'}, $row->{'dst'}, );
     }
 
-    if ( $dbi->do("UPDATE $table SET freesidestatus = 'done' $where", @args) ) {
+    if ( $dbi->do($usql, @args) ) {
       $updates++;
     } else {
       warn "failed to set status: ".$dbi->errstr."\n";

-----------------------------------------------------------------------

Summary of changes:
 FS/bin/freeside-cdr-asterisk_sql |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)




More information about the freeside-commits mailing list