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
90 # 27: accessDeviceAddress
93 # 30: failoverCorrelationId
101 my( $cdr, $data ) = @_;
104 $cdr->is_tollfree ? substr( $cdr->dst, 0, 32 ) : $data
108 # 35: authorizationCode
109 # 36: originalCalledNumber
110 # 37: originalCalledPresentationIndicator
111 # 38: originalCalledReason
112 # 39: redirectingNumber
113 # 40: redirectingPresentationIndicator
114 # 41: redirectingReason
115 # 42: chargeIndicator
117 # 44: voicePortalCalling.invocationTime
120 # 47: callingPartyCategory
122 # Also... cols 48 - 448 see Broadsoft documentation
123 skip(111), #35-145 inclusive
133 my $fieldname = shift;
135 my($cdr, $data) = @_;
137 $cdr->$fieldname($data);
143 map { undef } (1..$_[0]);
150 list of freeside CDR fields, useful ones marked with *
153 *[1] calldate - Call timestamp (SQL timestamp)
154 clid - Caller*ID with text
155 7 * src - Caller*ID number / Source number
156 9 * dst - Destination extension
157 dcontext - Destination context
158 channel - Channel used
159 dstchannel - Destination channel if appropriate
160 lastapp - Last application if appropriate
161 lastdata - Last application data
162 10 * startdate - Start of call (UNIX-style integer timestamp)
163 13 answerdate - Answer time of call (UNIX-style integer timestamp)
164 14 * enddate - End time of call (UNIX-style integer timestamp)
165 * duration - Total time in system, in seconds
166 * billsec - Total time call is up, in seconds
167 12 *[2] disposition - What happened to the call: ANSWERED, NO ANSWER, BUSY
168 amaflags - What flags to use: BILL, IGNORE etc, specified on a per
169 channel basis like accountcode.
170 4 *[3] accountcode - CDR account number to use: account
171 uniqueid - Unique channel identifier
172 userfield - CDR user-defined field
173 cdr_type - CDR type - see FS::cdr_type (Usage = 1, S&E = 7, OC&C = 8)
174 *[4] charged_party - Service number to be billed
175 upstream_currency - Wholesale currency from upstream
176 *[5] upstream_price - Wholesale price from upstream
177 upstream_rateplanid - Upstream rate plan ID
178 rated_price - Rated (or re-rated) price
179 distance - km (need units field?)
180 islocal - Local - 1, Non Local = 0
181 *[6] calltypenum - Type of call - see FS::cdr_calltype
182 description - Description (cdr_type 7&8 only) (used for
183 cust_bill_pkg.itemdesc)
184 quantity - Number of items (cdr_type 7&8 only)
185 carrierid - Upstream Carrier ID (see FS::cdr_carrier)
186 upstream_rateid - Upstream Rate ID
187 svcnum - Link to customer service (see FS::cust_svc)
188 freesidestatus - NULL, done (or something)
190 [1] Auto-populated from startdate if not present
191 [2] Package options available to ignore calls without a specific disposition
192 [3] When using 'cdr-charged_party-accountcode' config
193 [4] Auto-populated from src (normal calls) or dst (toll free calls) if not present
194 [5] When using 'upstream_simple' rating method.
195 [6] Set to usage class classnum when using pre-rated CDRs and usage class-based
196 taxation (local/intrastate/interstate/international)