[freeside-commits] branch FREESIDE_2_3_BRANCH updated. 4658140057dc70393cf057af334b0eb810bd0e1a
Mark Wells
mark at 420.am
Thu Jun 13 08:33:06 PDT 2013
The branch, FREESIDE_2_3_BRANCH has been updated
via 4658140057dc70393cf057af334b0eb810bd0e1a (commit)
from 7aeaf8748ca66ffb4f49dd2c2ab3f796b0bdbc5a (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 4658140057dc70393cf057af334b0eb810bd0e1a
Author: Mark Wells <mark at freeside.biz>
Date: Thu Jun 13 08:32:23 2013 -0700
netsapiens CDR format, #23382
diff --git a/FS/FS/cdr/netsapiens.pm b/FS/FS/cdr/netsapiens.pm
new file mode 100644
index 0000000..bcaa349
--- /dev/null
+++ b/FS/FS/cdr/netsapiens.pm
@@ -0,0 +1,50 @@
+package FS::cdr::netsapiens;
+
+use strict;
+use base qw( FS::cdr );
+use vars qw( %info );
+use FS::cdr qw( _cdr_date_parser_maker _cdr_min_parser_maker );
+
+%info = (
+ 'name' => 'NetSapiens',
+ '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
+ 'sep_char' => ',', #for csv, defaults to ,
+ 'disabled' => 0, #0 default, set to 1 to disable
+
+ 'import_fields' => [
+
+ sub { my ($cdr, $direction) = @_;
+ if ($direction =~ /^o/) { # 'origination'
+ # leave src and dst as they are
+ } elsif ($direction =~ /^t/) {
+ my ($local, $remote) = ($cdr->src, $cdr->dst);
+ $cdr->set('dst', $local);
+ $cdr->set('src', $remote);
+ }
+ },
+ '', #Domain
+ '', #user
+ 'src', #local party (src/dst, based on direction)
+ _cdr_date_parser_maker('startddate'),
+ _cdr_date_parser_maker('answerdate'),
+ sub { my ($cdr, $duration) = @_;
+ $cdr->set('duration', $duration);
+ $cdr->set('billsec', $duration);
+ $cdr->set('enddate', $duration + $cdr->answerdate)
+ if $cdr->answerdate;
+ },
+ 'dst', #remote party
+ '', #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 | 50 +++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 50 insertions(+), 0 deletions(-)
create mode 100644 FS/FS/cdr/netsapiens.pm
More information about the freeside-commits
mailing list