02ff9df6fe29744e67321eb246b8369afddd98d7
[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     skip(2),          # F-G. billingcode ("Room Billingcode"), confname
22     skip(1),          # H. participant_type
23     skip(1),          # I. starttime_t - timezone is unreliable
24     sub {             # J. startdate
25       my ($cdr, $data, $conf, $param) = @_;
26       $param->{'date_part'} = $data; # stash this and combine with the time
27       '';
28     },
29     sub {             # K. starttime
30       my ($cdr, $data, $conf, $param) = @_;
31       my $datestring = delete($param->{'date_part'}) . ' ' . $data;
32       &{ $date_parser }($cdr, $datestring);
33     },
34     sub { my($cdr, $data, $conf, $param) = @_;
35           $cdr->duration($data * 60);
36           $cdr->billsec( $data * 60);
37     },                # L. minutes
38     skip(1),          # M. dnis
39     'src',            # N. ani
40     'dst',            # O. calltype
41     skip(7),          # P-V. calltype_text, confstart_t, confstartdate, 
42                       # confstarttime, confminutes, conflegs, ppm
43     'upstream_price', # W. callcost
44     skip(11),         # X-AH. confcost, rppm, rcallcost, rconfcost,
45                       # auxdata[1..4], ldval, sysname, username
46     'accountcode',    # AI. Chairperson Entry Code
47     skip(1),          # AJ. Participant Entry Code
48     'description',    # AK. contact name
49   ],
50
51 );
52
53 sub skip { map {''} (1..$_[0]) }
54
55 1;