Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- no warnings qw(uninitialized);
- use TAP3::Tap3edit;
- use Data::Dumper;
- printDir(".");
- sub printDir{
- opendir(DIR, $_[0]);
- local(@files);
- local(@dirs);
- (@files) = readdir(DIR);
- foreach $file (@files) {
- if (-f $file and substr($file,0,2) eq "CD" ) {
- my $tap3 = TAP3::Tap3edit->new;
- my $tap_file = $file;
- $tap3->decode($tap_file) or die $tap3->error;
- my $struct=$tap3->structure;
- my $Tracker = $struct->{'transferBatch'};
- if (defined $Tracker){
- my $rectag = $struct->{'transferBatch'}->{'networkInfo'}->{'recEntityInfo'};
- map { $_->{'recEntityType'} = 4 if ( $_->{'recEntityType'} > 6) } @$rectag;
- #my ($sec, $min, $hour, $mday, $mon, $year) = localtime;
- #my $time = sprintf '%d%02d%02d%02d%02d%02d', 1900+$year, 1+$mon, $mday, "00", "11", "00";
- #$struct->{'transferBatch'}->{'batchControlInfo'}->{'fileAvailableTimeStamp'}->{'localTimeStamp'} ="$time";
- my $calleventtag = $struct->{'transferBatch'}->{'callEventDetails'};
- my @indexes = reverse (grep { exists $calleventtag->[$_]->{'supplServiceEvent'} } 0..$#$calleventtag);
- my $sup_event_cnt = $#indexes;
- foreach my $index (@indexes)
- {
- splice (@$calleventtag , $index,1);
- }
- my $total_events_cnt = $struct->{'transferBatch'}->{'auditControlInfo'}->{'callEventDetailsCount'};
- $struct->{'transferBatch'}->{'auditControlInfo'}->{'callEventDetailsCount'} = $total_events_cnt - $sup_event_cnt-1;
- if ( exists $struct->{'transferBatch'}->{'batchControlInfo'}->{'operatorSpecInformation'} )
- {
- delete $struct->{'transferBatch'}->{'batchControlInfo'}->{'operatorSpecInformation'};
- }
- if ( exists $struct->{'transferBatch'}->{'auditControlInfo'}->{'operatorSpecInformation'} )
- {
- delete $struct->{'transferBatch'}->{'auditControlInfo'}->{'operatorSpecInformation'};
- }
- my $key;
- # Will scan all the calls for MOC's and GPRS.
- foreach $key ( @{$struct->{'transferBatch'}->{'callEventDetails'} } ) {
- foreach ( keys %{$key} ) {
- if ( $_ eq "mobileOriginatedCall" )
- {
- if ( exists $calleventtag->[$_]->{'mobileOriginatedCall'}->{'basicCallInformation'}->{'destinationNetwork'} )
- {
- delete $calleventtag->[$_]->{'mobileOriginatedCall'}->{'basicCallInformation'}->{'destinationNetwork'};
- }
- if ( exists $calleventtag->[$_]->{'mobileOriginatedCall'}->{'basicCallInformation'}->{'chargeableSubscriber'}->{'simChargeableSubscriber'}->{'msisdn'}
- && $calleventtag->[$_]->{'mobileOriginatedCall'}->{'basicCallInformation'}->{'chargeableSubscriber'}->{'simChargeableSubscriber'}->{'msisdn'} !~ m/^96279/
- )
- {
- delete $calleventtag->[$_]->{'mobileOriginatedCall'}->{'basicCallInformation'}->{'chargeableSubscriber'}->{'simChargeableSubscriber'}->{'msisdn'};
- }
- if ( exists $calleventtag->[$_]->{'mobileOriginatedCall'}->{'camelServiceUsed'}
- && $calleventtag->[$_]->{'mobileOriginatedCall'}->{'camelServiceUsed'}->{'camelServiceKey'} != 80
- )
- {
- delete $calleventtag->[$_]->{'mobileOriginatedCall'}->{'camelServiceUsed'};
- }
- }
- if ( $_ eq "gprsCall" )
- {
- if ( exists $calleventtag->[$_]->{'gprsCall'}->{'gprsBasicCallInformation'}->{'gprsDestination'}->{'accessPointNameOI'} )
- {
- delete $calleventtag->[$_]->{'gprsCall'}->{'gprsBasicCallInformation'}->{'gprsDestination'}->{'accessPointNameOI'};
- }
- }
- }
- }
- $tap3->encode("$tap_file") or die $tap3->error;
- }
- }
- }
- closedir(DIR);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement