fix 'Can't call method "parse" on an undefined value' error from CDR format refactor
[freeside.git] / FS / FS / cdr / taqua.pm
1 package FS::cdr::taqua;
2
3 use strict;
4 use vars qw(@ISA %info);
5 use FS::cdr qw(_cdr_date_parser_maker);
6
7 @ISA = qw(FS::cdr);
8
9 %info = (
10   'name'          => 'Taqua',
11   'weight'        => 130,
12   'header'        => 1,
13   'import_fields' => [  #some of these are kind arbitrary...
14     sub { my($cdr, $field) = @_; },       #XXX interesting RecordType
15              # easy to fix: Can't find cdr.cdrtypenum 1 in cdr_type.cdrtypenum
16
17     sub { my($cdr, $field) = @_; },             #all10#RecordVersion
18     sub { my($cdr, $field) = @_; },       #OrigShelfNumber
19     sub { my($cdr, $field) = @_; },       #OrigCardNumber
20     sub { my($cdr, $field) = @_; },       #OrigCircuit
21     sub { my($cdr, $field) = @_; },       #OrigCircuitType
22     'uniqueid',                           #SequenceNumber
23     'accountcode',                        #SessionNumber
24     'src',                                #CallingPartyNumber
25     'dst',                                #CalledPartyNumber
26     _cdr_date_parser_maker('startdate'),  #CallArrivalTime
27     _cdr_date_parser_maker('enddate'),    #CallCompletionTime
28
29     #Disposition
30     #sub { my($cdr, $d ) = @_; $cdr->disposition( $disposition{$d}): },
31     'disposition',
32                                           #  -1 => '',
33                                           #   0 => '',
34                                           # 100 => '',
35                                           # 101 => '',
36                                           # 102 => '',
37                                           # 103 => '',
38                                           # 104 => '',
39                                           # 105 => '',
40                                           # 201 => '',
41                                           # 203 => '',
42
43     _cdr_date_parser_maker('answerdate'), #DispositionTime
44     sub { my($cdr, $field) = @_; },       #TCAP
45     sub { my($cdr, $field) = @_; },       #OutboundCarrierConnectTime
46     sub { my($cdr, $field) = @_; },       #OutboundCarrierDisconnectTime
47
48     #TermTrunkGroup
49     #it appears channels are actually part of trunk groups, but this data
50     #is interesting and we need a source and destination place to put it
51     'dstchannel',                         #TermTrunkGroup
52
53
54     sub { my($cdr, $field) = @_; },       #TermShelfNumber
55     sub { my($cdr, $field) = @_; },       #TermCardNumber
56     sub { my($cdr, $field) = @_; },       #TermCircuit
57     sub { my($cdr, $field) = @_; },       #TermCircuitType
58     sub { my($cdr, $field) = @_; },       #OutboundCarrierId
59     'charged_party',                      #BillingNumber
60     sub { my($cdr, $field) = @_; },       #SubscriberNumber
61     'lastapp',                            #ServiceName
62     sub { my($cdr, $field) = @_; },       #some weirdness #ChargeTime
63     'lastdata',                           #ServiceInformation
64     sub { my($cdr, $field) = @_; },       #FacilityInfo
65     sub { my($cdr, $field) = @_; },             #all 1900-01-01 0#CallTraceTime
66     sub { my($cdr, $field) = @_; },             #all-1#UniqueIndicator
67     sub { my($cdr, $field) = @_; },             #all-1#PresentationIndicator
68     sub { my($cdr, $field) = @_; },             #empty#Pin
69     sub { my($cdr, $field) = @_; },       #CallType
70     sub { my($cdr, $field) = @_; },           #Balt/empty #OrigRateCenter
71     sub { my($cdr, $field) = @_; },           #Balt/empty #TermRateCenter
72
73     #OrigTrunkGroup
74     #it appears channels are actually part of trunk groups, but this data
75     #is interesting and we need a source and destination place to put it
76     'channel',                            #OrigTrunkGroup
77
78     'userfield',                                #empty#UserDefined
79     sub { my($cdr, $field) = @_; },             #empty#PseudoDestinationNumber
80     sub { my($cdr, $field) = @_; },             #all-1#PseudoCarrierCode
81     sub { my($cdr, $field) = @_; },             #empty#PseudoANI
82     sub { my($cdr, $field) = @_; },             #all-1#PseudoFacilityInfo
83     sub { my($cdr, $field) = @_; },       #OrigDialedDigits
84     sub { my($cdr, $field) = @_; },             #all-1#OrigOutboundCarrier
85     sub { my($cdr, $field) = @_; },       #IncomingCarrierID
86     'dcontext',                           #JurisdictionInfo
87     sub { my($cdr, $field) = @_; },       #OrigDestDigits
88     sub { my($cdr, $field) = @_; },       #huh?#InsertTime
89     sub { my($cdr, $field) = @_; },       #key
90     sub { my($cdr, $field) = @_; },             #empty#AMALineNumber
91     sub { my($cdr, $field) = @_; },             #empty#AMAslpID
92     sub { my($cdr, $field) = @_; },             #empty#AMADigitsDialedWC
93     sub { my($cdr, $field) = @_; },       #OpxOffHook
94     sub { my($cdr, $field) = @_; },       #OpxOnHook
95
96         #acctid - primary key
97   #AUTO #calldate - Call timestamp (SQL timestamp)
98 #clid - Caller*ID with text
99         #XXX src - Caller*ID number / Source number
100         #XXX dst - Destination extension
101         #dcontext - Destination context
102         #channel - Channel used
103         #dstchannel - Destination channel if appropriate
104         #lastapp - Last application if appropriate
105         #lastdata - Last application data
106         #startdate - Start of call (UNIX-style integer timestamp)
107         #answerdate - Answer time of call (UNIX-style integer timestamp)
108         #enddate - End time of call (UNIX-style integer timestamp)
109   #HACK#duration - Total time in system, in seconds
110   #HACK#XXX billsec - Total time call is up, in seconds
111         #disposition - What happened to the call: ANSWERED, NO ANSWER, BUSY
112 #INT amaflags - What flags to use: BILL, IGNORE etc, specified on a per channel basis like accountcode.
113         #accountcode - CDR account number to use: account
114
115         #uniqueid - Unique channel identifier (Unitel/RSLCOM Event ID)
116         #userfield - CDR user-defined field
117
118         #X cdrtypenum - CDR type - see FS::cdr_type (Usage = 1, S&E = 7, OC&C = 8)
119         #XXX charged_party - Service number to be billed
120 #upstream_currency - Wholesale currency from upstream
121 #X upstream_price - Wholesale price from upstream
122 #upstream_rateplanid - Upstream rate plan ID
123 #rated_price - Rated (or re-rated) price
124 #distance - km (need units field?)
125 #islocal - Local - 1, Non Local = 0
126 #calltypenum - Type of call - see FS::cdr_calltype
127 #X description - Description (cdr_type 7&8 only) (used for cust_bill_pkg.itemdesc)
128 #quantity - Number of items (cdr_type 7&8 only)
129 #carrierid - Upstream Carrier ID (see FS::cdr_carrier)
130 #upstream_rateid - Upstream Rate ID
131
132         #svcnum - Link to customer service (see FS::cust_svc)
133         #freesidestatus - NULL, done (or something)
134   ],
135 );
136
137 1;