1 package FS::cdr::broadsoft;
5 FS::cdr::broadsoft - CDR parse module for Broadsoft
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 );
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( $data =~ /^yes/i ? '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(87), #35-121 inclusive
128 skip(23), #123-145 inclusive
138 my $fieldname = shift;
140 my($cdr, $data) = @_;
142 $cdr->$fieldname($data);
148 map { undef } (1..$_[0]);
155 list of freeside CDR fields, useful ones marked with *
158 *[1] calldate - Call timestamp (SQL timestamp)
159 clid - Caller*ID with text
160 7 * src - Caller*ID number / Source number
161 9 * dst - Destination extension
162 dcontext - Destination context
163 channel - Channel used
164 dstchannel - Destination channel if appropriate
165 lastapp - Last application if appropriate
166 lastdata - Last application data
167 10 * startdate - Start of call (UNIX-style integer timestamp)
168 13 answerdate - Answer time of call (UNIX-style integer timestamp)
169 14 * enddate - End time of call (UNIX-style integer timestamp)
170 * duration - Total time in system, in seconds
171 * billsec - Total time call is up, in seconds
172 12 *[2] disposition - What happened to the call: ANSWERED, NO ANSWER, BUSY
173 amaflags - What flags to use: BILL, IGNORE etc, specified on a per
174 channel basis like accountcode.
175 4 *[3] accountcode - CDR account number to use: account
176 uniqueid - Unique channel identifier
177 userfield - CDR user-defined field
178 cdr_type - CDR type - see FS::cdr_type (Usage = 1, S&E = 7, OC&C = 8)
179 *[4] charged_party - Service number to be billed
180 upstream_currency - Wholesale currency from upstream
181 *[5] upstream_price - Wholesale price from upstream
182 upstream_rateplanid - Upstream rate plan ID
183 rated_price - Rated (or re-rated) price
184 distance - km (need units field?)
185 islocal - Local - 1, Non Local = 0
186 *[6] calltypenum - Type of call - see FS::cdr_calltype
187 description - Description (cdr_type 7&8 only) (used for
188 cust_bill_pkg.itemdesc)
189 quantity - Number of items (cdr_type 7&8 only)
190 carrierid - Upstream Carrier ID (see FS::cdr_carrier)
191 upstream_rateid - Upstream Rate ID
192 svcnum - Link to customer service (see FS::cust_svc)
193 freesidestatus - NULL, done (or something)
195 [1] Auto-populated from startdate if not present
196 [2] Package options available to ignore calls without a specific disposition
197 [3] When using 'cdr-charged_party-accountcode' config
198 [4] Auto-populated from src (normal calls) or dst (toll free calls) if not present
199 [5] When using 'upstream_simple' rating method.
200 [6] Set to usage class classnum when using pre-rated CDRs and usage class-based
201 taxation (local/intrastate/interstate/international)