[freeside-commits] freeside/FS/FS/cdr taqua.pm,1.3,1.4
Ivan,,,
ivan at wavetail.420.am
Mon Jan 12 15:51:36 PST 2009
Update of /home/cvs/cvsroot/freeside/FS/FS/cdr
In directory wavetail.420.am:/tmp/cvs-serv7193/cdr
Modified Files:
taqua.pm
Log Message:
taqua config to rewrite DA calls, RT#4502
Index: taqua.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cdr/taqua.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- taqua.pm 9 Sep 2008 02:24:31 -0000 1.3
+++ taqua.pm 12 Jan 2009 23:51:34 -0000 1.4
@@ -1,7 +1,7 @@
package FS::cdr::taqua;
use strict;
-use vars qw(@ISA %info);
+use vars qw(@ISA %info $da_rewrite);
use FS::cdr qw(_cdr_date_parser_maker);
@ISA = qw(FS::cdr);
@@ -60,7 +60,28 @@
sub { my($cdr, $field) = @_; }, #TermCircuit
sub { my($cdr, $field) = @_; }, #TermCircuitType
'carrierid', #OutboundCarrierId
- 'charged_party', #BillingNumber
+
+ #BillingNumber
+ #'charged_party',
+ sub {
+ my( $cdr, $field, $conf ) = @_;
+
+ #could be more efficient for the no config case, if anyone ever needs that
+ $da_rewrite ||= $conf->config('cdr-taqua-da_rewrite');
+
+ if ( $da_rewrite && $field =~ /\d/ ) {
+ my $rewrite = $da_rewrite;
+ $rewrite =~ s/\s//g;
+ my @rewrite = split(',', $conf->config('cdr-taqua-da_rewrite') );
+ if ( grep { $field eq $_ } @rewrite ) {
+ $cdr->charged_party( $cdr->src() );
+ $cdr->calltypenum(12);
+ return;
+ }
+ }
+ $cdr->charged_party($field);
+ },
+
sub { my($cdr, $field) = @_; }, #SubscriberNumber
'lastapp', #ServiceName
sub { my($cdr, $field) = @_; }, #some weirdness #ChargeTime
More information about the freeside-commits
mailing list