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 || ($field == 1 && $cdr->lastapp eq 'CallerId') #CID blocking
26 $cdr->cdrtypenum($field);
34 'uniqueid', #SequenceNumber
35 'sessionnum', #SessionNumber
37 'src', #CallingPartyNumber
40 my( $cdr, $field, $conf ) = @_;
41 if ( $cdr->calltypenum == 6 && $cdr->cdrtypenum == 0 ) {
48 _cdr_date_parser_maker('startdate', 'gmt' => 1), #CallArrivalTime
49 _cdr_date_parser_maker('enddate', 'gmt' => 1), #CallCompletionTime
52 #sub { my($cdr, $d ) = @_; $cdr->disposition( $disposition{$d}): },
56 # 100 => '', #regular cdr
66 _cdr_date_parser_maker('answerdate', 'gmt' => 1), #DispositionTime
68 '', #OutboundCarrierConnectTime
69 '', #OutboundCarrierDisconnectTime
72 #it appears channels are actually part of trunk groups, but this data
73 #is interesting and we need a source and destination place to put it
74 'dstchannel', #TermTrunkGroup
82 'carrierid', #OutboundCarrierId
87 my( $cdr, $field, $conf ) = @_;
89 #could be more efficient for the no config case, if anyone ever needs that
90 $da_rewrite ||= $conf->config('cdr-taqua-da_rewrite');
92 if ( $da_rewrite && $field =~ /\d/ ) {
93 my $rewrite = $da_rewrite;
95 my @rewrite = split(',', $conf->config('cdr-taqua-da_rewrite') );
96 if ( grep { $field eq $_ } @rewrite ) {
97 $cdr->charged_party( $cdr->src() );
98 $cdr->calltypenum(12);
102 if ( $cdr->is_tollfree ) { # thankfully this is already available
103 $cdr->charged_party($cdr->dst); # and this
105 $cdr->charged_party($field);
109 'subscriber', #SubscriberName
110 'lastapp', #ServiceName
111 '', #some weirdness #ChargeTime
112 'lastdata', #ServiceInformation
117 '', #all 1900-01-01 0#CallTraceTime
118 '', #all-1#UniqueIndicator
119 '', #all-1#PresentationIndicator
121 'calltypenum', #CallType
123 #nothing below is used by QIS...
125 '', #Balt/empty #OrigRateCenter
126 '', #Balt/empty #TermRateCenter
129 #it appears channels are actually part of trunk groups, but this data
130 #is interesting and we need a source and destination place to put it
131 'channel', #OrigTrunkGroup
132 'userfield', #empty#UserDefined
136 '', #empty#PseudoDestinationNumber
137 '', #all-1#PseudoCarrierCode
139 '', #all-1#PseudoFacilityInfo
140 '', #OrigDialedDigits
141 '', #all-1#OrigOutboundCarrier
142 '', #IncomingCarrierID
143 'dcontext', #JurisdictionInfo
145 '', #empty#AMALineNumber
150 '', #empty#AMADigitsDialedWC
153 '', #OrigCalledNumber
154 '', #RedirectingNumber
168 '', #OrigTrunkGroupNumber
169 '', #TermTrunkGroupNumber
171 '', #OrigRoutingIndicator
175 '', #TermRoutingIndicator