[freeside-commits] branch FREESIDE_3_BRANCH updated. c464d2c65c63ab05f306dad9d718e1eb49e42851

Jeremy Davis jeremyd at 420.am
Wed Apr 8 07:54:23 PDT 2015


The branch, FREESIDE_3_BRANCH has been updated
       via  c464d2c65c63ab05f306dad9d718e1eb49e42851 (commit)
      from  83be664e22c7b4e9b974c04884145c028ef42d17 (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 c464d2c65c63ab05f306dad9d718e1eb49e42851
Author: Jeremy Davis <jeremyd at freeside.biz>
Date:   Wed Apr 8 10:54:17 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