summaryrefslogtreecommitdiff
path: root/FS/FS/cdr
diff options
context:
space:
mode:
authorJeremy Davis <jeremyd@freeside.biz>2015-10-06 13:39:20 -0400
committerJeremy Davis <jeremyd@freeside.biz>2015-10-06 13:39:20 -0400
commit8b80447169366e4d586955abd8e72a7bcbad122d (patch)
treec04b8fa1cd4a2f03f60793dd0368c3def902b562 /FS/FS/cdr
parent15b40cdb23b1e3b0e3d8372ead91b8a5244bb0e2 (diff)
cdr types for AMCom CDR's
Diffstat (limited to 'FS/FS/cdr')
-rw-r--r--FS/FS/cdr/amcom.pm11
1 files changed, 10 insertions, 1 deletions
diff --git a/FS/FS/cdr/amcom.pm b/FS/FS/cdr/amcom.pm
index 97ab402..43e6afd 100644
--- a/FS/FS/cdr/amcom.pm
+++ b/FS/FS/cdr/amcom.pm
@@ -4,6 +4,8 @@ use strict;
use base qw( FS::cdr );
use vars qw( %info );
use DateTime;
+use FS::Record qw( qsearchs );
+use FS::cdr_type;
my ($tmp_mday, $tmp_mon, $tmp_year);
@@ -29,7 +31,14 @@ my ($tmp_mday, $tmp_mon, $tmp_year);
if $cdr->accountcode eq '' && $field =~ /^(1800|1300)/;
},
'uniqueid', # 4. Record ID
- 'dcontext', # 5. Call Category (LOCAL, NATIONAL, FREECALL, MOBILE)
+ sub { # 5. Call Category (LOCAL, NATIONAL, FREECALL, MOBILE)
+ my ($cdr, $data) = @_;
+ $data ||= 'none';
+
+ my $cdr_type = qsearchs('cdr_type', { 'cdrtypename' => $data } );
+ $cdr->set('cdrtypenum', $cdr_type->cdrtypenum) if $cdr_type;
+ $cdr->set('dcontext', $data);
+ },
sub { # 6. Start Date (DDMMYYYY
my ($cdr, $date) = @_;
$date =~ /^(\d{2})(\d{2})(\d{4})$/