1 package FS::cdr::taqua;
4 use vars qw(@ISA %info $da_rewrite);
5 use FS::cdr qw(_cdr_date_parser_maker);
13 'import_fields' => [ #some of these are kind arbitrary...
18 my($cdr, $field, $conf, $hashref) = @_;
19 $hashref->{skiprow} = 1 unless ($field == 0 && $cdr->disposition == 100);
20 $cdr->cdrtypenum($field);
23 sub { my($cdr, $field) = @_; }, #all10#RecordVersion
24 sub { my($cdr, $field) = @_; }, #OrigShelfNumber
25 sub { my($cdr, $field) = @_; }, #OrigCardNumber
26 sub { my($cdr, $field) = @_; }, #OrigCircuit
27 sub { my($cdr, $field) = @_; }, #OrigCircuitType
28 'uniqueid', #SequenceNumber
29 'accountcode', #SessionNumber
30 'src', #CallingPartyNumber
31 #'dst', #CalledPartyNumber
34 my( $cdr, $field, $conf ) = @_;
35 if ( $cdr->calltypenum == 6 && $cdr->cdrtypenum == 0 ) {
43 _cdr_date_parser_maker('startdate'), #CallArrivalTime
44 _cdr_date_parser_maker('enddate'), #CallCompletionTime
47 #sub { my($cdr, $d ) = @_; $cdr->disposition( $disposition{$d}): },
60 _cdr_date_parser_maker('answerdate'), #DispositionTime
61 sub { my($cdr, $field) = @_; }, #TCAP
62 sub { my($cdr, $field) = @_; }, #OutboundCarrierConnectTime
63 sub { my($cdr, $field) = @_; }, #OutboundCarrierDisconnectTime
66 #it appears channels are actually part of trunk groups, but this data
67 #is interesting and we need a source and destination place to put it
68 'dstchannel', #TermTrunkGroup
71 sub { my($cdr, $field) = @_; }, #TermShelfNumber
72 sub { my($cdr, $field) = @_; }, #TermCardNumber
75 sub { my($cdr, $field) = @_; }, #TermCircuit
76 sub { my($cdr, $field) = @_; }, #TermCircuitType
77 'carrierid', #OutboundCarrierId
82 my( $cdr, $field, $conf ) = @_;
84 #could be more efficient for the no config case, if anyone ever needs that
85 $da_rewrite ||= $conf->config('cdr-taqua-da_rewrite');
87 if ( $da_rewrite && $field =~ /\d/ ) {
88 my $rewrite = $da_rewrite;
90 my @rewrite = split(',', $conf->config('cdr-taqua-da_rewrite') );
91 if ( grep { $field eq $_ } @rewrite ) {
92 $cdr->charged_party( $cdr->src() );
93 $cdr->calltypenum(12);
100 sub { my($cdr, $field) = @_; }, #SubscriberNumber
101 'lastapp', #ServiceName
102 sub { my($cdr, $field) = @_; }, #some weirdness #ChargeTime
103 'lastdata', #ServiceInformation
104 sub { my($cdr, $field) = @_; }, #FacilityInfo
105 sub { my($cdr, $field) = @_; }, #all 1900-01-01 0#CallTraceTime
108 sub { my($cdr, $field) = @_; }, #all-1#UniqueIndicator
109 sub { my($cdr, $field) = @_; }, #all-1#PresentationIndicator
110 sub { my($cdr, $field) = @_; }, #empty#Pin
111 'calltypenum', #CallType
113 #nothing below is used by QIS...
115 sub { my($cdr, $field) = @_; }, #Balt/empty #OrigRateCenter
116 sub { my($cdr, $field) = @_; }, #Balt/empty #TermRateCenter
119 #it appears channels are actually part of trunk groups, but this data
120 #is interesting and we need a source and destination place to put it
121 'channel', #OrigTrunkGroup
123 'userfield', #empty#UserDefined
124 sub { my($cdr, $field) = @_; }, #empty#PseudoDestinationNumber
125 sub { my($cdr, $field) = @_; }, #all-1#PseudoCarrierCode
128 sub { my($cdr, $field) = @_; }, #empty#PseudoANI
129 sub { my($cdr, $field) = @_; }, #all-1#PseudoFacilityInfo
130 sub { my($cdr, $field) = @_; }, #OrigDialedDigits
131 sub { my($cdr, $field) = @_; }, #all-1#OrigOutboundCarrier
132 sub { my($cdr, $field) = @_; }, #IncomingCarrierID
133 'dcontext', #JurisdictionInfo
134 sub { my($cdr, $field) = @_; }, #OrigDestDigits
135 sub { my($cdr, $field) = @_; }, #huh?#InsertTime
136 sub { my($cdr, $field) = @_; }, #key
137 sub { my($cdr, $field) = @_; }, #empty#AMALineNumber
140 sub { my($cdr, $field) = @_; }, #empty#AMAslpID
141 sub { my($cdr, $field) = @_; }, #empty#AMADigitsDialedWC
142 sub { my($cdr, $field) = @_; }, #OpxOffHook
143 sub { my($cdr, $field) = @_; }, #OpxOnHook
145 #acctid - primary key
146 #AUTO #calldate - Call timestamp (SQL timestamp)
147 #clid - Caller*ID with text
148 #XXX src - Caller*ID number / Source number
149 #XXX dst - Destination extension
150 #dcontext - Destination context
151 #channel - Channel used
152 #dstchannel - Destination channel if appropriate
153 #lastapp - Last application if appropriate
154 #lastdata - Last application data
155 #startdate - Start of call (UNIX-style integer timestamp)
156 #answerdate - Answer time of call (UNIX-style integer timestamp)
157 #enddate - End time of call (UNIX-style integer timestamp)
158 #HACK#duration - Total time in system, in seconds
159 #HACK#XXX billsec - Total time call is up, in seconds
160 #disposition - What happened to the call: ANSWERED, NO ANSWER, BUSY
161 #INT amaflags - What flags to use: BILL, IGNORE etc, specified on a per channel basis like accountcode.
162 #accountcode - CDR account number to use: account
164 #uniqueid - Unique channel identifier (Unitel/RSLCOM Event ID)
165 #userfield - CDR user-defined field
167 #X cdrtypenum - CDR type - see FS::cdr_type (Usage = 1, S&E = 7, OC&C = 8)
168 #XXX charged_party - Service number to be billed
169 #upstream_currency - Wholesale currency from upstream
170 #X upstream_price - Wholesale price from upstream
171 #upstream_rateplanid - Upstream rate plan ID
172 #rated_price - Rated (or re-rated) price
173 #distance - km (need units field?)
174 #islocal - Local - 1, Non Local = 0
175 #calltypenum - Type of call - see FS::cdr_calltype
176 #X description - Description (cdr_type 7&8 only) (used for cust_bill_pkg.itemdesc)
177 #quantity - Number of items (cdr_type 7&8 only)
178 #carrierid - Upstream Carrier ID (see FS::cdr_carrier)
179 #upstream_rateid - Upstream Rate ID
181 #svcnum - Link to customer service (see FS::cust_svc)
182 #freesidestatus - NULL, done (or something)