[freeside-commits] branch FREESIDE_3_BRANCH updated. 9da45db27c29664242eda042d1457e8d69367c20

Mark Wells mark at 420.am
Tue Jun 14 16:46:00 PDT 2016


The branch, FREESIDE_3_BRANCH has been updated
       via  9da45db27c29664242eda042d1457e8d69367c20 (commit)
      from  608de5fe8395ef4c8d629340a85605cb64b90d84 (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 9da45db27c29664242eda042d1457e8d69367c20
Author: Mark Wells <mark at freeside.biz>
Date:   Tue Jun 14 16:45:38 2016 -0700

    in a2billing CDR import, parse destination number out of calledstation string, #71205

diff --git a/FS/bin/freeside-cdr-a2billing-import b/FS/bin/freeside-cdr-a2billing-import
index a8469e7..aa7fa4a 100644
--- a/FS/bin/freeside-cdr-a2billing-import
+++ b/FS/bin/freeside-cdr-a2billing-import
@@ -120,7 +120,13 @@ my $updates = 0;
 
 my $row;
 while ( $row = $sth->fetchrow_hashref ) {
-  $row->{calledstation} =~ s/^1//;
+  my $dst = $row->{calledstation};
+  my $dst_ip_addr = '';
+  if ($dst =~ m[^SIP/(\d+)@(.*)$] ) {
+    $dst = $1;
+    $dst_ip_addr = $2;
+  }
+  $dst =~ s/^1//;
   $row->{src} =~ s/^1//;
   my $cdr = FS::cdr->new ({
     uniqueid            => $row->{sessionid},
@@ -129,8 +135,10 @@ while ( $row = $sth->fetchrow_hashref ) {
     enddate             => time2str($row->{stoptime}),
     duration            => $row->{sessiontime},
     billsec             => $row->{real_sessiontime},
-    dst                 => $row->{calledstation},
+    dst                 => $dst,
     src                 => $row->{src},
+    dst_ip_addr         => $dst_ip_addr,
+    dstchannel          => $row->{calledstation},
     charged_party       => $row->{username},
     upstream_rateplanid => $row->{id_tariffplan},
     upstream_rateid     => $row->{id_ratecard}, # I think?

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

Summary of changes:
 FS/bin/freeside-cdr-a2billing-import |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)




More information about the freeside-commits mailing list