projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
PBXware CDRs: strip trailing non-numeric stuff from src/dst numbers, #34575
[freeside.git]
/
FS
/
FS
/
part_export
/
pbxware.pm
diff --git
a/FS/FS/part_export/pbxware.pm
b/FS/FS/part_export/pbxware.pm
index
e647dce
..
36b1a2a
100644
(file)
--- a/
FS/FS/part_export/pbxware.pm
+++ b/
FS/FS/part_export/pbxware.pm
@@
-57,7
+57,7
@@
returns an error message. If there are no new CDRs, returns nothing.
# map their column names to cdr fields
# (warning: API docs are not quite accurate here)
our %column_map = (
# 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',
'From' => 'src',
'To' => 'dst',
'Date/Time' => 'startdate',
@@
-140,6
+140,11
@@
sub import_cdrs {
uniqueid => $uniqueid,
);
@hash{@names} = @$row;
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;
my $cdr = FS::cdr->new(\%hash);
$error = $cdr->insert;