badf41e1d42a37a062f93e8beb53c00aa8f4fa34
[freeside.git] / FS / FS / cdr / infinite.pm
1 package FS::cdr::infinite;
2
3 use strict;
4 use vars qw( @ISA %info );
5 use FS::cdr qw(_cdr_date_parser_maker);
6
7 @ISA = qw(FS::cdr);
8
9 my $date_parser = _cdr_date_parser_maker('startdate');
10
11 %info = (
12   'name'          => 'Infinite Conferencing',
13   'weight'        => 520,
14   'header'        => 1,
15   'type'          => 'csv',
16   'sep_char'      => ',',
17   'import_fields' => [
18     'uniqueid',       # A. billid
19     skip(3),          # B-D. confid, invoicenum, acctgrpid
20     skip(1),          # E. accountid ("Room Confirmation Number")
21     'dst',            # was: skip(1), # F. billingcode ("Room Billingcode")
22     skip(1),          # G. confname
23     skip(1),          # H. participant_type
24     skip(1),          # I. starttime_t - timezone is unreliable
25     sub {             # J. startdate
26       my ($cdr, $data, $conf, $param) = @_;
27       $param->{'date_part'} = $data; # stash this and combine with the time
28       '';
29     },
30     sub {             # K. starttime
31       my ($cdr, $data, $conf, $param) = @_;
32       my $datestring = delete($param->{'date_part'}) . ' ' . $data;
33       &{ $date_parser }($cdr, $datestring);
34     },
35     sub { my($cdr, $data, $conf, $param) = @_;
36           $cdr->duration($data * 60);
37           $cdr->billsec( $data * 60);
38     },                # L. minutes
39     skip(1),          # M. dnis
40     'src',            # N. ani
41     skip(1),          # was: 'dst', # O. calltype
42     skip(7),          # P-V. calltype_text, confstart_t, confstartdate, 
43                       # confstarttime, confminutes, conflegs, ppm
44     'upstream_price', # W. callcost
45     skip(11),         # X-AH. confcost, rppm, rcallcost, rconfcost,
46                       # auxdata[1..4], ldval, sysname, username
47     'accountcode',    # AI. Chairperson Entry Code
48     skip(1),          # AJ. Participant Entry Code
49     'description',    # AK. contact name
50   ],
51
52 );
53
54 sub skip { map {''} (1..$_[0]) }
55
56 1;