[freeside-commits] branch master updated. 6c0e57a800a9691f9b585fdbb8fac3f01b6edf47
Christopher Burger
burgerc at freeside.biz
Mon Mar 25 09:37:29 PDT 2019
The branch, master has been updated
via 6c0e57a800a9691f9b585fdbb8fac3f01b6edf47 (commit)
from f1d04f65cbacc2d5f4a286ef2a4c3f1b6b3943c2 (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 6c0e57a800a9691f9b585fdbb8fac3f01b6edf47
Author: Christopher Burger <burgerc at freeside.biz>
Date: Mon Mar 25 12:36:14 2019 -0400
RT# 82992 - Added new cdr import format ThinQ
diff --git a/FS/FS/cdr/thinq.pm b/FS/FS/cdr/thinq.pm
new file mode 100644
index 000000000..cbe0aa7d6
--- /dev/null
+++ b/FS/FS/cdr/thinq.pm
@@ -0,0 +1,62 @@
+package FS::cdr::thinq;
+
+use strict;
+use vars qw( @ISA %info $tmp_mon $tmp_mday $tmp_year );
+use base qw( FS::cdr );
+use Time::Local;
+use Date::Parse;
+
+ at ISA = qw(FS::cdr);
+
+%info = (
+ 'name' => 'ThinQ',
+ 'weight' => 13,
+ 'type' => 'csv',
+ 'header' => 1,
+ 'disabled' => 0, #0 default, set to 1 to disable
+
+
+ 'import_fields' => [
+
+ # Date (YYYY-MM-DD)
+ sub { my($cdr, $date) = @_;
+ $date =~ /^(\d\d(\d\d)?)\-(\d{1,2})\-(\d{1,2})$/
+ or die "unparsable date: $date"; #maybe we shouldn't die...
+ ($tmp_mday, $tmp_mon, $tmp_year) = ( $4, $3-1, $1 );
+ },
+
+ # Time (HH:MM:SS )
+ sub { my($cdr, $time) = @_;
+ $time =~ /^(\d{1,2}):(\d{1,2}):(\d{1,2})$/
+ or die "unparsable time: $time"; #maybe we shouldn't die...
+ $cdr->startdate(
+ timelocal($3, $2, $1 ,$tmp_mday, $tmp_mon, $tmp_year)
+ );
+ },
+
+ 'carrierid', # carrier_id
+ 'src', # from_ani
+ skip(5), # from_lrn
+ # from_lata
+ # from_ocn
+ # from_state
+ # from_rc
+ 'dst', # to_did
+ 'channel', # thing_tier
+ 'userfield', # callid
+ 'accountcode', # account_id
+ skip(2), # tf_profile
+ # dest_type
+ 'dst_ip_addr', # dest
+ skip(1), # rate
+ 'billsec', # billsec
+ skip(1), #total_charge
+ ], ## end import
+
+); ## end info
+
+sub skip { map { undef } (1..$_[0]) }
+
+1;
+
+__END__
-----------------------------------------------------------------------
Summary of changes:
FS/FS/cdr/thinq.pm | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 62 insertions(+)
create mode 100644 FS/FS/cdr/thinq.pm
More information about the freeside-commits
mailing list