1 package FS::cdr::freeside_description_default;
4 use vars qw( @ISA %info $tmp_mon $tmp_mday $tmp_year );
11 'name' => 'Freeside default with description field as destination',
16 'charged_party', # Billed number
20 sub { my($cdr, $date) = @_;
21 $date =~ /^(\d\d(\d\d)?)\/(\d{1,2})\/(\d{1,2})$/
22 or die "unparsable date: $date"; #maybe we shouldn't die...
23 ($tmp_mday, $tmp_mon, $tmp_year) = ( $4, $3-1, $1 );
26 # Time (HH:MM:SS (AM/PM))
27 sub { my($cdr, $time) = @_;
28 $time =~ /^(\d{1,2}):(\d{1,2}):(\d{1,2}) (AM|PM)$/
29 or die "unparsable time: $time"; #maybe we shouldn't die...
31 $hour += 12 if $4 eq 'PM' && $hour != 12;
32 $hour = 0 if $4 eq 'AM' && $hour == 12;
34 timelocal($3, $2, $hour ,$tmp_mday, $tmp_mon, $tmp_year)
40 my($cdr, $number) = @_;
41 $number =~ /(\+|)(\d+)\s(\d+)$/
42 or die "unparsable number: $number"; #maybe we shouldn't die...
46 'description', # Destination (regionname)
50 my($cdr, $duration) = @_;
51 $duration =~ /^(\d{1,3})m (\d{1,2})s$/
52 or die "unparsable duration: $duration"; #maybe we shouldn't die...
60 my($cdr, $amount) = @_;
62 $cdr->upstream_price($amount);