summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2015-09-21 20:40:36 -0700
committerIvan Kohler <ivan@freeside.biz>2015-09-21 20:41:17 -0700
commit1156af3a7ca02d40d622a9fe6df899fc74b3e622 (patch)
treebe9822820d6c7385a0801b6da6bf979d4c884049
parent44ab2fe5fc720947da67e5c3a67f086b75c150c3 (diff)
import a2billing username as charged_party, RT#32909
-rwxr-xr-xFS/bin/freeside-cdr-a2billing-import (renamed from bin/cdr-a2billing.import)60
1 files changed, 52 insertions, 8 deletions
diff --git a/bin/cdr-a2billing.import b/FS/bin/freeside-cdr-a2billing-import
index 6677fa0a0..923f5fbb1 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;