[freeside-commits] branch FREESIDE_4_BRANCH updated. 3bfedb7199c3de10c0f2d9a0c7de675fed63c4d9
Christopher Burger
burgerc at freeside.biz
Thu May 23 09:04:04 PDT 2019
The branch, FREESIDE_4_BRANCH has been updated
via 3bfedb7199c3de10c0f2d9a0c7de675fed63c4d9 (commit)
from 5b9562f8e03ae6efea0c2eaa90341083744fa529 (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 3bfedb7199c3de10c0f2d9a0c7de675fed63c4d9
Author: Christopher Burger <burgerc at freeside.biz>
Date: Thu May 23 11:48:15 2019 -0400
RT# 75680 - fixed telapi_voip cdr csv import
diff --git a/FS/FS/cdr/telapi_voip.pm b/FS/FS/cdr/telapi_voip.pm
index abc7d5bd2..687c431a8 100644
--- a/FS/FS/cdr/telapi_voip.pm
+++ b/FS/FS/cdr/telapi_voip.pm
@@ -7,46 +7,22 @@ use FS::Record qw( qsearch );
use FS::cdr qw( _cdr_date_parser_maker _cdr_min_parser_maker );
%info = (
- 'name' => 'telapi_voip',
+ 'name' => 'telapi_voip (csv file)',
'weight' => 601,
'header' => 1,
'type' => 'csv',
'import_fields' => [
- _cdr_date_parser_maker('startdate'), #'date gmt'
+ skip(1), # Inbound/Outbound
+ _cdr_date_parser_maker('startdate'), # date
+ skip(1), # cost per minute
+ 'upstream_price', # call cost
+ 'billsec', # duration
'src', # source
'dst', # destination
- 'clid', # callerid
skip(1), # hangup code
- skip(1), # sip account
- 'src_ip_addr', # orig ip
- 'duration', # duration
- skip(1), # per minute
- 'upstream_price', # callcost
- sub {
- my($cdr, $cdrtypename, $conf, $param) = @_;
- return unless length($cdrtypename);
- _init_cdr_types();
- unless (defined $CDR_TYPES->{$cdrtypename}) {
- warn "Skipping Record: CDR type name $cdrtypename does not exist!";
- $param->{skiprow} = 1;
- }
- $cdr->cdrtypenum($CDR_TYPES->{$cdrtypename});
- }, # type
- _cdr_min_parser_maker('billsec'), #PriceDurationMins
],
);
sub skip { map {''} (1..$_[0]) }
-sub _init_cdr_types {
- unless ($CDR_TYPES) {
- $CDR_TYPES = {};
- foreach my $cdr_type ( qsearch('cdr_type') ) {
- die "multiple cdr_types with same cdrtypename".$cdr_type->cdrtypename
- if defined $CDR_TYPES->{$cdr_type->cdrtypename};
- $CDR_TYPES->{$cdr_type->cdrtypename} = $cdr_type->cdrtypenum;
- }
- }
-}
-
1;
\ No newline at end of file
-----------------------------------------------------------------------
Summary of changes:
FS/FS/cdr/telapi_voip.pm | 36 ++++++------------------------------
1 file changed, 6 insertions(+), 30 deletions(-)
More information about the freeside-commits
mailing list