[freeside-commits] branch FREESIDE_3_BRANCH updated. 701b7d70e078a53f36e3d46ea9df4ca0a3a6ca02
Jeremy Davis
jeremyd at 420.am
Tue Jun 10 07:35:14 PDT 2014
The branch, FREESIDE_3_BRANCH has been updated
via 701b7d70e078a53f36e3d46ea9df4ca0a3a6ca02 (commit)
from a39488f57d3dd129a77fd657b7982ef33731c3d0 (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 701b7d70e078a53f36e3d46ea9df4ca0a3a6ca02
Author: Jeremy Davis <jeremyd at freeside.biz>
Date: Tue Jun 10 10:35:08 2014 -0400
#29047 Avaya CDR format
diff --git a/FS/FS/cdr/avaya_ipo.pm b/FS/FS/cdr/avaya_ipo.pm
new file mode 100644
index 0000000..c680af8
--- /dev/null
+++ b/FS/FS/cdr/avaya_ipo.pm
@@ -0,0 +1,66 @@
+package FS::cdr::avaya_ipo;
+
+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' => 'Avaya IPO',
+ 'weight' => 124,
+ 'header' => 0,
+ 'import_fields' => [
+
+
+ sub { my ($cdr, $info) = @_;
+ my @data = split(/\s+/, $info);
+ my $calldate = $data[4]. " ". $data[5];
+
+ $cdr->set('calldate', $calldate);
+ $calldate =~ /^(\d{4})\/(\d{2})\/(\d{2})\s*(\d{2}):(\d{2}):(\d{2})$/
+ or die "unparseable date: $calldate";
+ my $tmp_date = "$2/$3/$1 $4:$5:$6";
+ $tmp_date = str2time($tmp_date);
+ $cdr->set('startdate', $tmp_date);
+
+ }, #DateTime
+
+ sub { my ($cdr, $duration) = @_;
+ my ($hours,$min,$sec) = split(/:/, $duration);
+ my $seconds += ($min * 60)+ ($hours * 60*60) + $sec;
+ $cdr->set('billsec',$seconds);
+ } , # Duration 00:00:00
+ skip(1), # Ring time
+ sub { my ($cdr, $info) = @_;
+ my ($src,$ip) = split(/@/,$info);
+ $cdr->set('src',$src);
+
+ }, # Callers number
+ skip(2), # direction
+ # Called number
+ 'dst', # Dialed number
+ 'accountcode', # Accountcode
+ 'uniqueid', # call ID
+ skip(5), # continuation
+ 'dstchannel', # Party2Device
+ skip(9) # AuthValid
+ # User Charged
+ # call Charge
+ # Currency
+ # Amount at Last User Change
+ # Call Units
+ # Units at Last User Change
+ # Cost per Unit
+ # Markup
+
+
+],
+);
+
+sub skip { map {''} (1..$_[0]) }
+
+1;
+
-----------------------------------------------------------------------
Summary of changes:
FS/FS/cdr/avaya_ipo.pm | 66 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 66 insertions(+)
create mode 100644 FS/FS/cdr/avaya_ipo.pm
More information about the freeside-commits
mailing list