[freeside-commits] branch master updated. e5002a24fee7e476cbb3d8d916c8d87ddfc12093

Mark Wells mark at 420.am
Thu Jun 13 10:49:38 PDT 2013


The branch, master has been updated
       via  e5002a24fee7e476cbb3d8d916c8d87ddfc12093 (commit)
       via  5de72308d1c22ca4fc0d7eccf5588c7a39af9286 (commit)
      from  ae35e72d469042f3991d851bf468d4e8b7269c46 (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 e5002a24fee7e476cbb3d8d916c8d87ddfc12093
Author: Mark Wells <mark at freeside.biz>
Date:   Thu Jun 13 10:49:10 2013 -0700

    allow invalid locations to be disabled anyway, #23446

diff --git a/FS/FS/cust_location.pm b/FS/FS/cust_location.pm
index a834859..b98ade1 100644
--- a/FS/FS/cust_location.pm
+++ b/FS/FS/cust_location.pm
@@ -257,12 +257,12 @@ and replace methods.
 
 =cut
 
-#some false laziness w/cust_main, but since it should eventually lose these
-#fields anyway...
 sub check {
   my $self = shift;
   my $conf = new FS::Conf;
 
+  return '' if $self->disabled; # so that disabling locations never fails
+
   my $error = 
     $self->ut_numbern('locationnum')
     || $self->ut_foreign_keyn('prospectnum', 'prospect_main', 'prospectnum')

commit 5de72308d1c22ca4fc0d7eccf5588c7a39af9286
Author: Mark Wells <mark at freeside.biz>
Date:   Wed Jun 12 22:12:00 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 +++++++++++++++++++++++++++++++++++++++++++++++
 FS/FS/cust_location.pm  |    4 +-
 2 files changed, 52 insertions(+), 2 deletions(-)
 create mode 100644 FS/FS/cdr/netsapiens.pm




More information about the freeside-commits mailing list