[freeside-commits] branch master updated. 0c759132a02d9403f391c6a997cbe754a4dba407

Ivan ivan at 420.am
Mon Sep 21 20:40:41 PDT 2015


The branch, master has been updated
       via  0c759132a02d9403f391c6a997cbe754a4dba407 (commit)
      from  ab5177ddab29e7fca9f64144a0c1ed104ead3ead (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 0c759132a02d9403f391c6a997cbe754a4dba407
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Mon Sep 21 20:40:36 2015 -0700

    import a2billing username as charged_party, RT#32909

diff --git a/bin/cdr-a2billing.import b/FS/bin/freeside-cdr-a2billing-import
similarity index 83%
rename from bin/cdr-a2billing.import
rename to FS/bin/freeside-cdr-a2billing-import
index 6677fa0..923f5fb 100755
--- a/bin/cdr-a2billing.import
+++ b/FS/bin/freeside-cdr-a2billing-import
@@ -90,13 +90,15 @@ my %disposition = (
   9 => 'INVALIDARGS',
 );
 
-my @cols = ( qw(
-  id sessionid
-  starttime stoptime sessiontime real_sessiontime
-  terminatecauseid
-  calledstation src
-  id_tariffplan id_ratecard sessionbill
-) );
+my @cols = (
+  'cc_call.id as id', 'cc_card.username as username',
+  qw( sessionid
+      starttime stoptime sessiontime real_sessiontime
+      terminatecauseid
+      calledstation src
+      id_tariffplan id_ratecard sessionbill
+    )
+);
 
 my $sql = 'SELECT '.join(',', @cols). " FROM $table".
   ' WHERE freesidestatus IS NULL' .
@@ -128,6 +130,7 @@ while ( $row = $sth->fetchrow_hashref ) {
     billsec             => $row->{real_sessiontime},
     dst                 => $row->{calledstation},
     src                 => $row->{src},
+    charged_party       => $row->{username},
     upstream_rateplanid => $row->{id_tariffplan},
     upstream_rateid     => $row->{id_ratecard}, # I think?
     upstream_price      => $row->{sessionbill},
@@ -153,7 +156,7 @@ $mysql->disconnect;
 
 sub usage {
   "Usage: 
-  cdr-a2billing.import
+  freeside-cdr-a2billing-import
       [ -H host ]
       -D database
       -U user
@@ -162,3 +165,44 @@ sub usage {
       freesideuser
 ";
 }
+
+=head1 NAME
+
+freeside-cdr-a2billing-import - Download CDRs from an A2Billing MySQL database
+
+=head1 SYNOPSIS
+
+  freeside-cdr-a2billing-import [ -H host ] -D database -U user -P password
+    [ -T tablename ]
+    [ -s start ] [ -e end ] [ -c cdrtypenum ]
+    freesideuser
+
+-H: database hostname
+
+-D: database name
+
+-U: database username
+
+-P: database password
+
+-T: table to import, defaults to cc_call
+
+-s: start date, e.g. 4/20/2015
+
+-e: end date, e.g. 12/25/2015
+
+-c: cdrtypenum to set, defaults to none
+
+freesideuser: freeside username
+
+=head1 DESCRIPTION
+
+=head1 BUGS
+
+=head1 SEE ALSO
+
+L<FS::cdr>
+
+=cut
+
+1;

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

Summary of changes:
 .../bin/freeside-cdr-a2billing-import              |   60 +++++++++++++++++---
 1 file changed, 52 insertions(+), 8 deletions(-)
 rename bin/cdr-a2billing.import => FS/bin/freeside-cdr-a2billing-import (83%)




More information about the freeside-commits mailing list