1 package FS::cdr::broadsoft22;
5 FS::cdr::broadsoft22 - CDR parse module for Broadsoft R22.0
9 Ref: BW-AccountingCDRInterfaceSpec-R22.pdf
14 use base qw( FS::cdr );
16 use FS::cdr qw( _cdr_date_parser_maker _cdr_min_parser_maker );
19 name => 'Broadsoft R22',
34 my ( $cdr, $data, $conf, $param ) = @_;
36 if lc($data) ne 'normal';
50 # 8: callingPresentationINdicator
57 _cdr_date_parser_maker('startdate'),
64 my( $cdr, $data ) = @_;
65 $cdr->disposition( lc($data) eq 'yes' ? 'ANSWERED' : 'NO ANSWER');
69 _cdr_date_parser_maker('answerdate'),
72 _cdr_date_parser_maker('enddate'),
74 # 15: terminationCause
76 # 17: carrierIdentificationCode
80 # 21: networkTranslatedNumber
81 # 22: networkTranslatedGroup
86 # 27: accessDeviceAddress
89 # 30: failoverCorrelationId
97 my( $cdr, $data ) = @_;
100 $cdr->is_tollfree ? substr( $cdr->dst, 0, 32 ) : $data
104 # 35: authorizationCode
105 # 36: originalCalledNumber
106 # 37: originalCalledPresentationIndicator
107 # 38: originalCalledReason
108 # 39: redirectingNumber
109 # 40: redirectingPresentationIndicator
110 # 41: redirectingReason
111 # 42: chargeIndicator
113 # 44: voicePortalCalling.invocationTime
116 # 47: callingPartyCategory
118 # Also... cols 48 - 448 see Broadsoft documentation
125 my $fieldname = shift;
127 my($cdr, $data) = @_;
129 $cdr->$fieldname($data);
135 map { undef } (1..$_[0]);
142 list of freeside CDR fields, useful ones marked with *
145 *[1] calldate - Call timestamp (SQL timestamp)
146 clid - Caller*ID with text
147 7 * src - Caller*ID number / Source number
148 9 * dst - Destination extension
149 dcontext - Destination context
150 channel - Channel used
151 dstchannel - Destination channel if appropriate
152 lastapp - Last application if appropriate
153 lastdata - Last application data
154 10 * startdate - Start of call (UNIX-style integer timestamp)
155 13 answerdate - Answer time of call (UNIX-style integer timestamp)
156 14 * enddate - End time of call (UNIX-style integer timestamp)
157 * duration - Total time in system, in seconds
158 * billsec - Total time call is up, in seconds
159 12 *[2] disposition - What happened to the call: ANSWERED, NO ANSWER, BUSY
160 amaflags - What flags to use: BILL, IGNORE etc, specified on a per
161 channel basis like accountcode.
162 4 *[3] accountcode - CDR account number to use: account
163 uniqueid - Unique channel identifier
164 userfield - CDR user-defined field
165 cdr_type - CDR type - see FS::cdr_type (Usage = 1, S&E = 7, OC&C = 8)
166 *[4] charged_party - Service number to be billed
167 upstream_currency - Wholesale currency from upstream
168 *[5] upstream_price - Wholesale price from upstream
169 upstream_rateplanid - Upstream rate plan ID
170 rated_price - Rated (or re-rated) price
171 distance - km (need units field?)
172 islocal - Local - 1, Non Local = 0
173 *[6] calltypenum - Type of call - see FS::cdr_calltype
174 description - Description (cdr_type 7&8 only) (used for
175 cust_bill_pkg.itemdesc)
176 quantity - Number of items (cdr_type 7&8 only)
177 carrierid - Upstream Carrier ID (see FS::cdr_carrier)
178 upstream_rateid - Upstream Rate ID
179 svcnum - Link to customer service (see FS::cust_svc)
180 freesidestatus - NULL, done (or something)
182 [1] Auto-populated from startdate if not present
183 [2] Package options available to ignore calls without a specific disposition
184 [3] When using 'cdr-charged_party-accountcode' config
185 [4] Auto-populated from src (normal calls) or dst (toll free calls) if not present
186 [5] When using 'upstream_simple' rating method.
187 [6] Set to usage class classnum when using pre-rated CDRs and usage class-based
188 taxation (local/intrastate/interstate/international)