# map their column names to cdr fields
# (warning: API docs are not quite accurate here)
our %column_map = (
- 'Tenant' => 'subscriber',
+ 'Tenant' => 'accountcode',
'From' => 'src',
'To' => 'dst',
'Date/Time' => 'startdate',
uniqueid => $uniqueid,
);
@hash{@names} = @$row;
+ # strip non-numeric junk that sometimes gets appended to these (it
+ # causes problems creating Freeside detail records)
+ foreach (qw(src dst)) {
+ $hash{$_} =~ s/\D*$//;
+ }
my $cdr = FS::cdr->new(\%hash);
$error = $cdr->insert;