[freeside-commits] branch FREESIDE_3_BRANCH updated. 4cbb5a4b52b2c49578eed3add1c3400b218079e4

Jeremy Davis jeremyd at 420.am
Tue Dec 16 07:26:44 PST 2014


The branch, FREESIDE_3_BRANCH has been updated
       via  4cbb5a4b52b2c49578eed3add1c3400b218079e4 (commit)
      from  8a0e102eca3b469b31d5d934fd460a7c87618dec (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 4cbb5a4b52b2c49578eed3add1c3400b218079e4
Author: Jeremy Davis <jeremyd at freeside.biz>
Date:   Tue Dec 16 10:26:29 2014 -0500

    Ticket 29048 3CX CDR format changes

diff --git a/FS/FS/cdr/cx3.pm b/FS/FS/cdr/cx3.pm
index 8c84807..a1e2e93 100644
--- a/FS/FS/cdr/cx3.pm
+++ b/FS/FS/cdr/cx3.pm
@@ -10,40 +10,33 @@ use Date::Parse;
 %info = (
   'name'          => '3CX',
   'weight'        => 120,
-  'header'        => 1,
   'import_fields' => [
 
 
-sub {                 
-      	my ($cdr, $data, $conf, $param) = @_;
-      	 	$param->{skiprow} = 1 unless $data =~ 'CallDetail'; # skip non-detail records
+	sub {                 
+      		my ($cdr, $data, $conf, $param) = @_;
+      	 	$param->{skiprow} = 1 unless $data =~ /Call\s/ ; # skip non-detail records
 	},		# record type
-	skip(2),	# unknown, callid ( not unique )
-	'src',		# source
-	'dst',		# destination
-sub { my ($cdr, $calldate, $param) = @_;
-
-	if ($calldate =~ /^(\d{2})\/(\d{2})\/(\d{4})\s*(\d{2}):(\d{2}):(\d{2})$/){
+	skip(1),	# unknown, callid ( not unique )
+	sub { my ($cdr, $duration) = @_;
+	
+		my ($hour,$min,$sec) = split(/:/,$duration);
+		$sec = sprintf ("%.0f", $sec);
+		$sec += $min * 60;
+		$sec += $hour * 60 * 60;
+		$cdr->set('billsec', $sec);
+
+	},		# duration
+	skip(1),		
+	sub { my ($cdr, $calldate, $param) = @_;
 
 		$cdr->set('calldate', $calldate);
-                my $tmp_date = "$2/$1/$3 $4:$5:$6";
-
-                $tmp_date = str2time($tmp_date);
-                $cdr->set('startdate', $tmp_date);
-                }          
 	},              #date
-sub { my ($cdr, $duration) = @_;
-               
-	my ($hour,$min,$sec) = split(/:/,$duration);
-	$sec += $min * 60;
-	$sec += $hour * 60 * 60;
-	$sec = sprintf ("%.0f", $sec);
-	$cdr->set('billsec', $sec);
-
-},			#duration
-	skip(1),        # unknown
-	'disposition',  # call status
+	skip(4),          
 	'accountcode',  # AccountCode
+	skip(6),		
+	'src',		# source
+	'dst',		# destination
 
   ],
 );

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

Summary of changes:
 FS/FS/cdr/cx3.pm |   45 +++++++++++++++++++--------------------------
 1 file changed, 19 insertions(+), 26 deletions(-)




More information about the freeside-commits mailing list