1 package FS::cdr::taqua62;
4 use vars qw(@ISA %info $da_rewrite);
5 use FS::cdr qw(_cdr_date_parser_maker);
10 'name' => 'Taqua v6.2',
17 '', #InsertTime, irrelevant
20 my($cdr, $field, $conf, $hashref) = @_;
21 $hashref->{skiprow} = 1
22 unless ($field == 0 && $cdr->disposition == 100 ) #regular CDR
23 || ($field == 1 && $cdr->lastapp eq 'acctcode'); #accountcode
24 $cdr->cdrtypenum($field);
32 'uniqueid', #SequenceNumber
33 'sessionnum', #SessionNumber
35 'src', #CallingPartyNumber
38 my( $cdr, $field, $conf ) = @_;
39 if ( $cdr->calltypenum == 6 && $cdr->cdrtypenum == 0 ) {
46 _cdr_date_parser_maker('startdate', 'gmt' => 1), #CallArrivalTime
47 _cdr_date_parser_maker('enddate', 'gmt' => 1), #CallCompletionTime
50 #sub { my($cdr, $d ) = @_; $cdr->disposition( $disposition{$d}): },
54 # 100 => '', #regular cdr
64 _cdr_date_parser_maker('answerdate', 'gmt' => 1), #DispositionTime
66 '', #OutboundCarrierConnectTime
67 '', #OutboundCarrierDisconnectTime
70 #it appears channels are actually part of trunk groups, but this data
71 #is interesting and we need a source and destination place to put it
72 'dstchannel', #TermTrunkGroup
80 'carrierid', #OutboundCarrierId
85 my( $cdr, $field, $conf ) = @_;
87 #could be more efficient for the no config case, if anyone ever needs that
88 $da_rewrite ||= $conf->config('cdr-taqua-da_rewrite');
90 if ( $da_rewrite && $field =~ /\d/ ) {
91 my $rewrite = $da_rewrite;
93 my @rewrite = split(',', $conf->config('cdr-taqua-da_rewrite') );
94 if ( grep { $field eq $_ } @rewrite ) {
95 $cdr->charged_party( $cdr->src() );
96 $cdr->calltypenum(12);
100 if ( $cdr->is_tollfree ) { # thankfully this is already available
101 $cdr->charged_party($cdr->dst); # and this
103 $cdr->charged_party($field);
107 'subscriber', #SubscriberName
108 'lastapp', #ServiceName
109 '', #some weirdness #ChargeTime
110 'lastdata', #ServiceInformation
115 '', #all 1900-01-01 0#CallTraceTime
116 '', #all-1#UniqueIndicator
117 '', #all-1#PresentationIndicator
119 'calltypenum', #CallType
121 #nothing below is used by QIS...
123 '', #Balt/empty #OrigRateCenter
124 '', #Balt/empty #TermRateCenter
127 #it appears channels are actually part of trunk groups, but this data
128 #is interesting and we need a source and destination place to put it
129 'channel', #OrigTrunkGroup
130 'userfield', #empty#UserDefined
134 '', #empty#PseudoDestinationNumber
135 '', #all-1#PseudoCarrierCode
137 '', #all-1#PseudoFacilityInfo
138 '', #OrigDialedDigits
139 '', #all-1#OrigOutboundCarrier
140 '', #IncomingCarrierID
141 'dcontext', #JurisdictionInfo
143 '', #empty#AMALineNumber
148 '', #empty#AMADigitsDialedWC
151 '', #OrigCalledNumber
152 '', #RedirectingNumber
166 '', #OrigTrunkGroupNumber
167 '', #TermTrunkGroupNumber
169 '', #OrigRoutingIndicator
173 '', #TermRoutingIndicator