summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorJeremy Davis <jeremyd@freeside.biz>2014-05-13 11:24:30 -0400
committerJeremy Davis <jeremyd@freeside.biz>2014-05-13 11:24:30 -0400
commit3a69843e23952a529f2a110e28fcdfbcb691def1 (patch)
tree56862a5f460cc48be40152772a037b7836e845dc /FS
parent130c5c10385e1717908c4678c844c3e4a39dfad9 (diff)
29049 Zintel CDR format
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/cdr/zintel.pm45
1 files changed, 45 insertions, 0 deletions
diff --git a/FS/FS/cdr/zintel.pm b/FS/FS/cdr/zintel.pm
new file mode 100644
index 000000000..0e44844dd
--- /dev/null
+++ b/FS/FS/cdr/zintel.pm
@@ -0,0 +1,45 @@
+package FS::cdr::zintel;
+
+use strict;
+use vars qw( @ISA %info $tmp_mon $tmp_mday $tmp_year );
+use Time::Local;
+use FS::cdr qw(_cdr_date_parser_maker);
+
+@ISA = qw(FS::cdr);
+
+%info = (
+ 'name' => 'Zintel',
+ 'weight' => 123,
+ 'header' => 1,
+ 'import_fields' => [
+
+ 'accountcode', #customer
+ 'src', #anumber
+ 'dst', #bnumber
+ sub { # OriginatingDate and OriginatingTime, two fields in the spec
+ my ($cdr, $date) = @_;
+ $date =~ /^(\d{2})\/(\d{2})\/(\d{4})\s*(\d{2}):(\d{2}):(\d{2})$/
+ or die "unparseable date: $date";
+ my $tmp_date = "$2/$1/$3 $4:$5:$6";
+ $cdr->calldate($tmp_date);
+ },#datetime
+
+ 'billsec', #duration
+ skip(3), #calltype
+ #status
+ #product
+ 'upstream_price',#sellprice
+ skip(1), #fromregion
+ 'upstream_src_regionname', #fromarea
+ skip(2), #fromc2city
+ #toregion
+ 'upstream_dst_regionname', #toarea
+ skip(2), #toc2city
+ #group_label
+ ],
+);
+
+sub skip { map {''} (1..$_[0]) }
+
+1;
+