1 package FS::cdr::telos_csv;
4 use vars qw( @ISA %info $tmp_mon $tmp_mday $tmp_year );
6 use FS::cdr qw(_cdr_min_parser_maker);
11 'name' => 'Telos (CSV)',
17 sub { my($cdr, $date) = @_;
18 $date =~ /^(\d{1,2})\/(\d{1,2})\/(\d\d(\d\d)?)$/
19 or die "unparsable date: $date";
20 ($tmp_mday, $tmp_mon, $tmp_year) = ( $2, $1-1, $3 );
24 sub { my($cdr, $time) = @_;
25 $time =~ /^(\d{1,2}):(\d{1,2}):(\d{1,2})$/
26 or die "unparsable time: $time";
28 timelocal($3, $2, $1 ,$tmp_mday, $tmp_mon, $tmp_year)
33 my($cdr, $rectype, $conf, $param) = @_;
34 $param->{skiprow} = 1 if lc($rectype) ne 'stop';
36 skip(24), #Full-Name, Auth-Type, User-Name, NAS-IP-Address, NAS-Port,
37 #Service-Type, Framed-Protocol, Framed-IP-Address,
38 #Framed-IP-Netmask, Framed-Routing, Filter-ID, Framed-MTU,
39 #Framed-Compression, Login-IP-Host, Login-Service, Login-TCP-Port,
40 #Callback-Number, Callback-ID, Framed-Route, Framed-IPX-Network,
41 #Class, Session-Timeout, Idle-Timeout, Termination-Action
42 #I told you it was a RADIUS log
43 'dst', # Called-Station-ID, always 'X' in sample data
44 'src', # Calling-Station-ID
45 skip(8), #NAS-Identifier, Proxy-State, Acct-Status-Type, Acct-Delay-Time,
46 #Acct-Input-Octets, Acct-Output-Octets, Acct-Session-Id,
52 $cdr->startdate($cdr->enddate - $sec);
54 skip(75), #everything else
58 sub skip { map {''} (1..$_[0]) }