[freeside-commits] branch master updated. 7035b1184a6c8dae4c3ea3c5dc34173725b714ec

Jeremy Davis jeremyd at 420.am
Mon Mar 30 07:05:13 PDT 2015


The branch, master has been updated
       via  7035b1184a6c8dae4c3ea3c5dc34173725b714ec (commit)
      from  e96b1f2c3826361a4a133f347508d46fbc317764 (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 7035b1184a6c8dae4c3ea3c5dc34173725b714ec
Author: Jeremy Davis <jeremyd at freeside.biz>
Date:   Mon Mar 30 10:04:48 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