[freeside-commits] branch master updated. 1da4dd0ce7edd9683a5eac22d24bb79b4be416b8
Jeremy Davis
jeremyd at 420.am
Tue Dec 16 07:25:44 PST 2014
The branch, master has been updated
via 1da4dd0ce7edd9683a5eac22d24bb79b4be416b8 (commit)
from 40a1ad133a19994311dc5a91b375d25aedd6d679 (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 1da4dd0ce7edd9683a5eac22d24bb79b4be416b8
Author: Jeremy Davis <jeremyd at freeside.biz>
Date: Tue Dec 16 10:25:06 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