1 package FS::cdr::voip_innovations;
4 use base qw( FS::cdr );
6 use FS::cdr qw( _cdr_date_parser_maker _cdr_min_parser_maker );
9 'name' => 'VoIP Innovations',
17 sub { my($cdr, $type) = @_;
18 # DNIS and ANI are the same columns regardless of direction,
19 # so all we need to assign is the IP address
20 if ($type =~ /^term/i) {
21 $cdr->dst_ip_addr( $cdr->get('ipaddr') );
23 $cdr->src_ip_addr( $cdr->get('ipaddr') );
25 # also strip the leading '1' or '+1' from src/dst
26 foreach (qw(src dst)) {
27 my $num = $cdr->get($_);
33 _cdr_date_parser_maker('startdate'),
35 _cdr_date_parser_maker('enddate'),
37 sub { my($cdr, $duration) = @_;
38 $cdr->duration(sprintf('%.0f',$duration));
40 # BillDuration (granularized)
41 sub { my($cdr, $billsec) = @_;
42 $cdr->billsec(sprintf('%.0f',$billsec));
44 # CallMinimum, CallIncrement (used to granularize BillDuration)
50 # TransactionId (seems not to be meaningful to us)
53 'ipaddr', # will go to src or dst addr, depending
57 '', # would be really useful for classifying inter/intrastate calls,
58 # except we don't use it
61 # LRN (Local Routing Number of the destination)
63 # DNISState, DNISLATA, DNISOCN
65 # OrigTier, TermRateDeck
66 '', '', # these are upstream rate plans, but they're not numeric