[freeside-commits] branch master updated. 3c693abdf3cccf5a716a0ce7075f3f1ed1063786
Jeremy Davis
jeremyd at 420.am
Mon Jul 8 12:46:28 PDT 2013
The branch, master has been updated
via 3c693abdf3cccf5a716a0ce7075f3f1ed1063786 (commit)
from 8297a6375be5e9f0fed712745d15ef0b4907da00 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 3c693abdf3cccf5a716a0ce7075f3f1ed1063786
Author: Jeremy Davis <jeremyd at freeside.biz>
Date: Mon Jul 8 15:44:58 2013 -0400
#23382 Changes to NetSapiens CDR format
diff --git a/FS/FS/cdr/netsapiens.pm b/FS/FS/cdr/netsapiens.pm
index bcaa349..9d07aef 100644
--- a/FS/FS/cdr/netsapiens.pm
+++ b/FS/FS/cdr/netsapiens.pm
@@ -15,11 +15,11 @@ use FS::cdr qw( _cdr_date_parser_maker _cdr_min_parser_maker );
'disabled' => 0, #0 default, set to 1 to disable
'import_fields' => [
-
+
sub { my ($cdr, $direction) = @_;
- if ($direction =~ /^o/) { # 'origination'
+ if ($direction =~ /^t/) { # 'origination'
# 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);
@@ -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)
- _cdr_date_parser_maker('startddate'),
+ _cdr_date_parser_maker('startdate'),
_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
- '', #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)
- 'src_ip_addr',
- 'dst_ip_addr',
+ '',
+ '',
'disposition',
],
);
1;
-
-----------------------------------------------------------------------
Summary of changes:
FS/FS/cdr/netsapiens.pm | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)
More information about the freeside-commits
mailing list