[freeside-commits] branch master updated. c7560e90bea5f1450cf66254468d427b854c83c4
Jeremy Davis
jeremyd at 420.am
Tue Nov 4 09:36:03 PST 2014
The branch, master has been updated
via c7560e90bea5f1450cf66254468d427b854c83c4 (commit)
via 3503b600f300515c448d19a3e332e5c24d2bdfbe (commit)
from 446865fcba43deb85beb4f703a1f768816201d0b (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 c7560e90bea5f1450cf66254468d427b854c83c4
Author: Jeremy Davis <jeremyd at freeside.biz>
Date: Tue Nov 4 09:42:53 2014 -0500
Ticket #29048 3cx cdr format
diff --git a/FS/FS/cdr/cx3.pm b/FS/FS/cdr/cx3.pm
new file mode 100644
index 0000000..bc511d9
--- /dev/null
+++ b/FS/FS/cdr/cx3.pm
@@ -0,0 +1,53 @@
+package FS::cdr::cx3;
+
+use strict;
+use vars qw( @ISA %info);
+use FS::cdr;
+use Date::Parse;
+
+ at ISA = qw(FS::cdr);
+
+%info = (
+ 'name' => '3CX',
+ 'weight' => 120,
+ 'header' => 1,
+ 'import_fields' => [
+
+
+sub {
+ my ($cdr, $data, $conf, $param) = @_;
+ $param->{skiprow} = 1 if $data ne 'CallDetail 0'; # skip non-detail records
+ }, # record type
+ 'uniqueid', # unique id
+ skip(1), # unknown
+ 'src', # source
+ 'dst', # destination
+sub { my ($cdr, $calldate, $param) = @_;
+
+ if ($calldate =~ /^(\d{4})-(\d{2})-(\d{2})\s*(\d{2}):(\d{2}):(\d{2})$/){
+
+ $cdr->set('calldate', $calldate);
+ my $tmp_date = "$2/$3/$1 $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
+
+ ],
+);
+
+sub skip { map {''} (1..$_[0]) }
+
+1;
commit 3503b600f300515c448d19a3e332e5c24d2bdfbe
Author: Jeremy Davis <jeremyd at freeside.biz>
Date: Tue Nov 4 08:28:40 2014 -0500
Ticket #31744 Update vss cdr format
diff --git a/FS/FS/cdr/vss.pm b/FS/FS/cdr/vss.pm
index b07be2b..8b745a8 100644
--- a/FS/FS/cdr/vss.pm
+++ b/FS/FS/cdr/vss.pm
@@ -18,9 +18,9 @@ use FS::cdr qw(_cdr_date_parser_maker);
'accountcode', # account_id
'src', # caller
'dst', # called
- skip(1), # reason
-# _cdr_date_parser_maker('startdate'), # time
- 'calldate',
+ skip(2), # reason
+ # call id
+ _cdr_date_parser_maker('startdate'), # time
'billsec', # duration
skip(3), # ringtime
# status
-----------------------------------------------------------------------
Summary of changes:
FS/FS/cdr/cx3.pm | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++
FS/FS/cdr/vss.pm | 6 +++---
2 files changed, 56 insertions(+), 3 deletions(-)
create mode 100644 FS/FS/cdr/cx3.pm
More information about the freeside-commits
mailing list