Sonus CDR format, #13053
[freeside.git] / FS / FS / cdr / freeside_description_default.pm
index bc4e89f..97af73d 100644 (file)
@@ -27,7 +27,8 @@ use FS::cdr;
           $time =~ /^(\d{1,2}):(\d{1,2}):(\d{1,2}) (AM|PM)$/
             or die "unparsable time: $time"; #maybe we shouldn't die...
           my $hour = $1;
-          $hour += 12 if $4 eq 'PM';
+          $hour += 12 if $4 eq 'PM' && $hour != 12;
+          $hour = 0 if $4 eq 'AM' && $hour == 12;
           $cdr->startdate(
             timelocal($3, $2, $hour ,$tmp_mday, $tmp_mon, $tmp_year)
           );
@@ -46,7 +47,7 @@ use FS::cdr;
     # Duration
     sub {
         my($cdr, $duration) = @_;
-        $duration =~ /^(\d{1,2})m (\d{1,2})s$/
+        $duration =~ /^(\d{1,3})m (\d{1,2})s$/
             or die "unparsable duration: $duration"; #maybe we shouldn't die...
         my $sec = $1*60 + $2;
         $cdr->duration($sec);