1 package FS::cdr::thinq;
4 use vars qw( @ISA %info $tmp_mon $tmp_mday $tmp_year );
5 use base qw( FS::cdr );
16 'disabled' => 0, #0 default, set to 1 to disable
22 sub { my($cdr, $date) = @_;
23 $date =~ /^(\d\d(\d\d)?)\-(\d{1,2})\-(\d{1,2})$/
24 or die "unparsable date: $date"; #maybe we shouldn't die...
25 ($tmp_mday, $tmp_mon, $tmp_year) = ( $4, $3-1, $1 );
29 sub { my($cdr, $time) = @_;
30 $time =~ /^(\d{1,2}):(\d{1,2}):(\d{1,2})$/
31 or die "unparsable time: $time"; #maybe we shouldn't die...
33 timelocal($3, $2, $1 ,$tmp_mday, $tmp_mon, $tmp_year)
37 'carrierid', # carrier_id
45 'channel', # thing_tier
47 'accountcode', # account_id
53 skip(1), #total_charge
58 sub skip { map { undef } (1..$_[0]) }
64 FS::cdr::thinq - ThinQ cdr import.
68 https://support.thinq.com/hc/en-us/articles/229251987-Defining-the-CDR-for-Origination
70 File format is csv, fields below.
72 01 date - YYYY-MM-DD 2019-03-04
73 02 time - HH:MM:SS 19:40:31
74 03 carrier_id - thinq id number for each carrier 4
75 04 from_ani - number dialed from 14055343879
76 05 from_lrn - 10 digit number to identify CO switch port 14056269999
77 06 from_lata - originating LATA 536
78 07 from_ocn - operating company number assigned by NECA 6534
79 08 from_state - originating state (US) OK
80 09 from_rc - originating rate center "OKLA CITY"
81 10 to_did - called number 17312018150
82 11 thinq_tier - tier of thinq provider (1,2,3) 1
83 12 callid - unique idenitifer for a call 960773443_66972652@206.147.84.26
84 13 account_id - thinq account identifier 13840
85 14 tf_profile - TFLCR profile used for inbound TF traffic <null>
86 15 dest_type - IP, PSN, ? IP
87 16 dest - pbx IP address for IP routed calls 192.151.131.17
88 17 rate - charge per minute 0.00250000
89 18 billsec - billable seconds 6
90 19 total_charge - charge for this call 0.00025000