projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of git.freeside.biz:/home/git/freeside
[freeside.git]
/
FS
/
FS
/
cdr
/
netsapiens.pm
diff --git
a/FS/FS/cdr/netsapiens.pm
b/FS/FS/cdr/netsapiens.pm
index
bcaa349
..
cf5f8d3
100644
(file)
--- a/
FS/FS/cdr/netsapiens.pm
+++ b/
FS/FS/cdr/netsapiens.pm
@@
-10,16
+10,16
@@
use FS::cdr qw( _cdr_date_parser_maker _cdr_min_parser_maker );
'weight' => 160,
'header' => 1, #0 default, set to 1 to ignore the first line, or
# to higher numbers to ignore that number of lines
'weight' => 160,
'header' => 1, #0 default, set to 1 to ignore the first line, or
# to higher numbers to ignore that number of lines
- 'type' => 'csv',
#csv (default), fixedlength or xls
+ 'type' => 'csv',
'sep_char' => ',', #for csv, defaults to ,
'disabled' => 0, #0 default, set to 1 to disable
'import_fields' => [
'sep_char' => ',', #for csv, defaults to ,
'disabled' => 0, #0 default, set to 1 to disable
'import_fields' => [
-
+
sub { my ($cdr, $direction) = @_;
sub { my ($cdr, $direction) = @_;
- if ($direction =~ /^
o
/) { # 'origination'
+ if ($direction =~ /^
t
/) { # 'origination'
# leave src and dst as they are
# leave src and dst as they are
- } elsif ($direction =~ /^
t
/) {
+ } elsif ($direction =~ /^
o
/) {
my ($local, $remote) = ($cdr->src, $cdr->dst);
$cdr->set('dst', $local);
$cdr->set('src', $remote);
my ($local, $remote) = ($cdr->src, $cdr->dst);
$cdr->set('dst', $local);
$cdr->set('src', $remote);
@@
-28,7
+28,7
@@
use FS::cdr qw( _cdr_date_parser_maker _cdr_min_parser_maker );
'', #Domain
'', #user
'src', #local party (src/dst, based on direction)
'', #Domain
'', #user
'src', #local party (src/dst, based on direction)
- _cdr_date_parser_maker('startd
d
ate'),
+ _cdr_date_parser_maker('startdate'),
_cdr_date_parser_maker('answerdate'),
sub { my ($cdr, $duration) = @_;
$cdr->set('duration', $duration);
_cdr_date_parser_maker('answerdate'),
sub { my ($cdr, $duration) = @_;
$cdr->set('duration', $duration);
@@
-37,14
+37,15
@@
use FS::cdr qw( _cdr_date_parser_maker _cdr_min_parser_maker );
if $cdr->answerdate;
},
'dst', #remote party
if $cdr->answerdate;
},
'dst', #remote party
- '', #dialed number
+ sub { my ($cdr, $dialednum) = @_;
+ $cdr->set('dst',$dialednum) if $dialednum =~ /^(\+?1)?8(8|([02-7])\3)/;
+ }, #dialed number
'uniqueid', #CallID (timestamp + '-' + 32 char hex string)
'uniqueid', #CallID (timestamp + '-' + 32 char hex string)
- '
src_ip_addr
',
- '
dst_ip_addr
',
+ '',
+ '',
'disposition',
],
);
1;
'disposition',
],
);
1;
-