Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl -w
- no warnings qw(uninitialized);
- use TAP3::Tap3edit;
- use Data::Dumper;
- printDir(".");
- sub printDir
- {
- opendir(DIR, $_[0]);
- my @files = readdir(DIR);
- closedir(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)
- {
- # if ( exists $struct->{'transferBatch'}->{'batchControlInfo'}->{'operatorSpecInformation'} )
- # {
- delete $struct->{'transferBatch'}->{'batchControlInfo'}->{'operatorSpecInformation'};
- # }
- # if ( exists $struct->{'transferBatch'}->{'auditControlInfo'}->{'operatorSpecInformation'} )
- # {
- delete $struct->{'transferBatch'}->{'auditControlInfo'}->{'operatorSpecInformation'};
- # }
- my $rectag = $struct->{'transferBatch'}->{'networkInfo'}->{'recEntityInfo'};
- map { $_->{'recEntityType'} = 4 if ( $_->{'recEntityType'} > 6) } @$rectag;
- 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;
- # foreach (0..$#$calleventtag)
- for (my $i = $#$calleventtag; $i >= 0; --$i)
- {
- my $ceti = $calleventtagi->[$i];
- if (exists $ceti->{'supplServiceEvent'})
- {
- splice (@$calleventtag, $i, 1);
- --$struct->{'transferBatch'}->{'auditControlInfo'}->{'callEventDetailsCount'};
- next;
- }
- # 1st next if
- if ( exists $ceti->{'mobileOriginatedCall'})
- {
- if ( exists $ceti->{'mobileOriginatedCall'}->{'basicCallInformation'}->{'destinationNetwork'} )
- {
- delete $ceti->{'mobileOriginatedCall'}->{'basicCallInformation'}->{'destinationNetwork'};
- }
- if ( exists $ceti->{'mobileOriginatedCall'}->{'basicCallInformation'}->{'chargeableSubscriber'}->{'simChargeableSubscriber'}->{'msisdn'}
- && $ceti->{'mobileOriginatedCall'}->{'basicCallInformation'}->{'chargeableSubscriber'}->{'simChargeableSubscriber'}->{'msisdn'} !~ m/^5519/
- )
- {
- delete $ceti->{'mobileOriginatedCall'}->{'basicCallInformation'}->{'chargeableSubscriber'}->{'simChargeableSubscriber'}->{'msisdn'};
- }
- if ( exists $ceti->{'mobileOriginatedCall'}->{'camelServiceUsed'}
- && $ceti->{'mobileOriginatedCall'}->{'camelServiceUsed'}->{'camelServiceKey'} != 80
- )
- {
- delete $ceti->{'mobileOriginatedCall'}->{'camelServiceUsed'};
- }
- }
- ## 2th next if
- if ( exists $ceti->{'gprsCall'})
- {
- # if ( exists $ceti->{'gprsCall'}->{'gprsBasicCallInformation'}->{'gprsDestination'}->{'accessPointNameOI'} )
- # {
- delete $ceti->{'gprsCall'}->{'gprsBasicCallInformation'}->{'gprsDestination'}->{'accessPointNameOI'};
- # }
- }
- }
- $tap3->encode("$tap_file") or die $tap3->error;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement