@ISA = qw(FS::cdr);
%info = (
- 'name' => 'Taqua',
+ 'name' => 'Taqua v6.0',
'weight' => 130,
'header' => 1,
'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
+ #'dst', #CalledPartyNumber
+ #CalledPartyNumber
+ sub {
+ my( $cdr, $field, $conf ) = @_;
+ if ( $cdr->calltypenum == 6 && $cdr->cdrtypenum == 0 ) {
+ $cdr->dst("+$field");
+ } else {
+ $cdr->dst($field);
+ }
+ },
#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 => '',
# 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
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