X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcdr%2Ftaqua.pm;h=390152a042215d9560d867ab1134cd43393987a0;hb=1d9d7d96b80ed08749a44501161a26a82f3cddb6;hp=5d6c6945a52486bebd024b216c8fea463c6290f0;hpb=be924ea50c9fc5710bb3f587c492861c42cbdac8;p=freeside.git diff --git a/FS/FS/cdr/taqua.pm b/FS/FS/cdr/taqua.pm index 5d6c6945a..390152a04 100644 --- a/FS/FS/cdr/taqua.pm +++ b/FS/FS/cdr/taqua.pm @@ -13,14 +13,22 @@ use FS::cdr qw(_cdr_date_parser_maker); 'import_fields' => [ #some of these are kind arbitrary... #0 - 'cdrtypenum', #RecordType + #RecordType + sub { + my($cdr, $field, $conf, $hashref) = @_; + $hashref->{skiprow} = 1 + unless ($field == 0 && $cdr->disposition == 100 ) #regular CDR + || ($field == 1 && $cdr->lastapp eq 'acctcode'); #accountcode + $cdr->cdrtypenum($field); + }, + sub { my($cdr, $field) = @_; }, #all10#RecordVersion sub { my($cdr, $field) = @_; }, #OrigShelfNumber sub { my($cdr, $field) = @_; }, #OrigCardNumber sub { my($cdr, $field) = @_; }, #OrigCircuit sub { my($cdr, $field) = @_; }, #OrigCircuitType 'uniqueid', #SequenceNumber - 'accountcode', #SessionNumber + 'sessionnum', #SessionNumber 'src', #CallingPartyNumber #'dst', #CalledPartyNumber #CalledPartyNumber @@ -34,15 +42,15 @@ use FS::cdr qw(_cdr_date_parser_maker); }, #10 - _cdr_date_parser_maker('startdate'), #CallArrivalTime - _cdr_date_parser_maker('enddate'), #CallCompletionTime + _cdr_date_parser_maker('startdate', 'gmt' => 1), #CallArrivalTime + _cdr_date_parser_maker('enddate', 'gmt' => 1), #CallCompletionTime #Disposition #sub { my($cdr, $d ) = @_; $cdr->disposition( $disposition{$d}): }, 'disposition', # -1 => '', # 0 => '', - # 100 => '', + # 100 => '', #regular cdr # 101 => '', # 102 => '', # 103 => '', @@ -51,7 +59,7 @@ use FS::cdr qw(_cdr_date_parser_maker); # 201 => '', # 203 => '', - _cdr_date_parser_maker('answerdate'), #DispositionTime + _cdr_date_parser_maker('answerdate', 'gmt' => 1), #DispositionTime sub { my($cdr, $field) = @_; }, #TCAP sub { my($cdr, $field) = @_; }, #OutboundCarrierConnectTime sub { my($cdr, $field) = @_; }, #OutboundCarrierDisconnectTime @@ -88,10 +96,14 @@ use FS::cdr qw(_cdr_date_parser_maker); return; } } - $cdr->charged_party($field); + if ( $cdr->is_tollfree ) { # thankfully this is already available + $cdr->charged_party($cdr->dst); # and this + } else { + $cdr->charged_party($field); + } }, - sub { my($cdr, $field) = @_; }, #SubscriberNumber + 'subscriber', #SubscriberNumber 'lastapp', #ServiceName sub { my($cdr, $field) = @_; }, #some weirdness #ChargeTime 'lastdata', #ServiceInformation