projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
586d704
)
obey otherPartyNamePresentationIndicator and deal with broadsoft's awful non-standard...
author
Ivan Kohler
<ivan@freeside.biz>
Mon, 23 May 2022 21:43:39 +0000
(14:43 -0700)
committer
Ivan Kohler
<ivan@freeside.biz>
Mon, 23 May 2022 21:43:39 +0000
(14:43 -0700)
FS/FS/cdr/broadsoft.pm
patch
|
blob
|
history
diff --git
a/FS/FS/cdr/broadsoft.pm
b/FS/FS/cdr/broadsoft.pm
index
d9530bb
..
01755a8
100644
(file)
--- a/
FS/FS/cdr/broadsoft.pm
+++ b/
FS/FS/cdr/broadsoft.pm
@@
-23,6
+23,15
@@
use FS::cdr qw( _cdr_date_parser_maker _cdr_min_parser_maker );
sep_char => ',',
disabled => 0,
sep_char => ',',
disabled => 0,
+ row_callback => sub {
+ my $line = shift;
+ #try to deal with broadsoft's awful non-standard CSV escaping :/
+ $line =~ s/\\,/ /g; # \, becomes just a space... not entirely accurate,
+ # but better than skewing data into the wrong fields
+ $line =~ s/\\\\/\\/g; # undo double backslashes? none in my test data
+ $line;
+ },
+
import_fields => [
# 1: recordId
import_fields => [
# 1: recordId
@@
-119,7
+128,13
@@
use FS::cdr qw( _cdr_date_parser_maker _cdr_min_parser_maker );
#122: otherPartyName
'clid',
#122: otherPartyName
'clid',
- skip(23), #123-145 inclusive
+ #123: otherPartyNamePresentationIndicator
+ sub {
+ my( $cdr, $data ) = @_;
+ $cdr->clid( $data ) unless $data =~ /^Public$/i;
+ },
+
+ skip(22), #124-145 inclusive
# 146: chargedNumber
'charged_party',
# 146: chargedNumber
'charged_party',