[freeside-commits] branch FREESIDE_3_BRANCH updated. a7419a574afa0141836fceef3ba064c90d584d84
Jeremy Davis
jeremyd at 420.am
Mon Mar 30 07:06:26 PDT 2015
The branch, FREESIDE_3_BRANCH has been updated
via a7419a574afa0141836fceef3ba064c90d584d84 (commit)
from 346a65b5907df913076b436ba47249f9acb79227 (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 a7419a574afa0141836fceef3ba064c90d584d84
Author: Jeremy Davis <jeremyd at freeside.biz>
Date: Mon Mar 30 10:05:45 2015 -0400
Ticket #33459 ISPPhone CDR format
diff --git a/FS/FS/cdr/ispphone.pm b/FS/FS/cdr/ispphone.pm
new file mode 100644
index 0000000..49d1b07
--- /dev/null
+++ b/FS/FS/cdr/ispphone.pm
@@ -0,0 +1,51 @@
+package FS::cdr::ispphone;
+
+use strict;
+use vars qw( @ISA %info $tmp_mon $tmp_mday $tmp_year );
+use Time::Local;
+use FS::cdr;
+use Date::Parse;
+
+ at ISA = qw(FS::cdr);
+
+%info = (
+ 'name' => 'ISPPhone',
+ 'weight' => 123,
+ 'header' => 2,
+ 'import_fields' => [
+
+ '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
+
+ sub { my ($cdr, $duration) = @_;
+ my ($min,$sec) = split(/:/, $duration);
+ my $billsec = $sec + $min * 60;
+ $cdr->set('billsec', $billsec);
+
+ }, #Charged time, min:sec
+
+ 'upstream_price', # Amount ( upstream price )
+],
+
+);
+
+1;
+
-----------------------------------------------------------------------
Summary of changes:
FS/FS/cdr/ispphone.pm | 51 +++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 51 insertions(+)
create mode 100644 FS/FS/cdr/ispphone.pm
More information about the freeside-commits
mailing list