1 package FS::cdr::earthlink;
4 use vars qw( @ISA %info $date);
6 use FS::cdr qw(_cdr_min_parser_maker);
11 my ($tmp_mday, $tmp_mon, $tmp_year);
14 'name' => 'Earthlink',
19 skip(3), #Account number/ SERVICE LOC / BILL NUMBER
20 sub { my($cdr, $date) = @_;
21 $date =~ /^(\d{1,2})\/(\d{1,2})\/(\d{4})$/
22 or die "unparseable date: $date";
23 ($tmp_mon, $tmp_mday, $tmp_year) = ($1, $2, $3);
25 sub { my($cdr, $time) = @_;
26 $time =~ /^(\d{1,2}):(\d{1,2}):(\d{1,2}) (AM|PM)$/
27 or die "unparsable time: $time"; #maybe we shouldn't die...
29 $hour += 12 if $4 eq 'PM' && $hour != 12;
30 $hour = 0 if $4 eq 'AM' && $hour == 12;
32 my $dt = DateTime->new(
41 $cdr->set('startdate', $dt->epoch);
44 skip(1), #TollFreeNumber
45 sub { my($cdr, $src) = @_;
47 $cdr->set('src', $src);
49 skip(2), #ORIG CITY/ORIGSTATE
50 sub { my($cdr, $dst) = @_;
52 $cdr->set('dst', $dst);
54 skip(2), #TERM CITY / TERM STATE
55 _cdr_min_parser_maker, #MINUTES
57 'disposition', #Call Type
59 'accountcode', #AcctCode
63 sub skip { map {''} (1..$_[0]) }