[freeside-commits] branch master updated. 562a3c85e49cd3ea8fb80e5c2fd7f4c5f60333e9
Christopher Burger
burgerc at freeside.biz
Thu May 23 08:48:46 PDT 2019
The branch, master has been updated
via 562a3c85e49cd3ea8fb80e5c2fd7f4c5f60333e9 (commit)
from 269c5484bb13430773443a2ae376368be0b56c2c (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 562a3c85e49cd3ea8fb80e5c2fd7f4c5f60333e9
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