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