[freeside-commits] branch master updated. f65ac2eaef54f51964c0ee1d626d434b32c406cc

Jeremy Davis jeremyd at 420.am
Wed Apr 8 07:53:50 PDT 2015


The branch, master has been updated
       via  f65ac2eaef54f51964c0ee1d626d434b32c406cc (commit)
      from  0cf9aa4a84ac9cf6aa763db4536756c03630ab69 (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 f65ac2eaef54f51964c0ee1d626d434b32c406cc
Author: Jeremy Davis <jeremyd at freeside.biz>
Date:   Wed Apr 8 10:52:50 2015 -0400

    ISPPhone CDR format

diff --git a/FS/FS/cdr/ispphone.pm b/FS/FS/cdr/ispphone.pm
index 49d1b07..2817d53 100644
--- a/FS/FS/cdr/ispphone.pm
+++ b/FS/FS/cdr/ispphone.pm
@@ -3,7 +3,7 @@ package FS::cdr::ispphone;
 use strict;
 use vars qw( @ISA %info $tmp_mon $tmp_mday $tmp_year );
 use Time::Local;
-use FS::cdr;
+use FS::cdr qw ( _cdr_date_parser_maker );
 use Date::Parse;
 
 @ISA = qw(FS::cdr);
@@ -11,29 +11,15 @@ use Date::Parse;
 %info = (
   'name'          => 'ISPPhone',
   'weight'        => 123,
-  'header'        => 2,
+  'header'        => 1,
   'import_fields' => [
 
+                 'accountcode',  # Accountcode
 	                 'src',	 # Form
 		         'dst',  # To
-     'upstream_dst_regionname',  # Country
-                    'dcontext',  # Description
-              	 
-			sub { my ($cdr, $calldate) = @_;
-                        	$cdr->set('calldate', $calldate);
-
-			my $tmp_date;
-
- 	                      if ($calldate =~ /^(\d{2})\/(\d{2})\/(\d{2})\s*(\d{1,2}):(\d{2})$/){
-
-                	        $tmp_date = "$2/$1/$3 $4:$5:$6";
-        	                        
-			      } else { $tmp_date = $calldate; }
-	
-				$tmp_date = str2time($tmp_date);
-                        	$cdr->set('startdate', $tmp_date);
-
-                 	},       #DateTime
+		       skip(1),  # Country
+     'upstream_dst_regionname',  # Description
+_cdr_date_parser_maker('startdate'),  #DateTime
 
 	                sub { my ($cdr, $duration) = @_;
 				my ($min,$sec) = split(/:/, $duration);
@@ -47,5 +33,7 @@ use Date::Parse;
 
 );
 
+sub skip { map {''} (1..$_[0]) }
+
 1;
 

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/cdr/ispphone.pm |   28 ++++++++--------------------
 1 file changed, 8 insertions(+), 20 deletions(-)




More information about the freeside-commits mailing list