SHARE
TWEET

Untitled

a guest Nov 19th, 2019 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/perl -w
  2.  
  3. no warnings qw(uninitialized);
  4.  
  5. use TAP3::Tap3edit;
  6. use Data::Dumper;
  7.  
  8. printDir(".");
  9.  
  10. sub printDir {
  11.  
  12.     opendir(DIR, $_[0]);
  13.  
  14.     local(@files);
  15.     local(@dirs);
  16.  
  17.     (@files) = readdir(DIR);
  18.  
  19.     foreach $file (@files) {
  20.  
  21.         if (-f $file and substr($file,0,2) eq "CD" ) {
  22.  
  23.             my $tap3 = TAP3::Tap3edit->new;
  24.  
  25.             my $tap_file = $file;
  26.             $tap3->decode($tap_file) or die $tap3->error;
  27.  
  28.             my $struct=$tap3->structure;
  29.             my $Tracker = $struct->{'transferBatch'};
  30.  
  31.             if (defined $Tracker) {
  32.  
  33.                 my $rectag = $struct->{'transferBatch'}->{'networkInfo'}->{'recEntityInfo'};
  34.  
  35.                 map { $_->{'recEntityType'} = 4 if ( $_->{'recEntityType'} > 6) } @$rectag;
  36.  
  37.                 my $calleventtag = $struct->{'transferBatch'}->{'callEventDetails'};
  38.  
  39.                 my @indexes = reverse (grep { exists $calleventtag->[$_]->{'supplServiceEvent'} } 0..$#$calleventtag);
  40.  
  41.                 my $sup_event_cnt = $#indexes;
  42.  
  43.                 foreach my $index (@indexes) {
  44.                     splice (@$calleventtag , $index,1);
  45.                 }
  46.  
  47.                 my $total_events_cnt = $struct->{'transferBatch'}->{'auditControlInfo'}->{'callEventDetailsCount'};
  48.                 $struct->{'transferBatch'}->{'auditControlInfo'}->{'callEventDetailsCount'} = $total_events_cnt - $sup_event_cnt-1;
  49.  
  50.                 if ( exists $struct->{'transferBatch'}->{'batchControlInfo'}->{'operatorSpecInformation'} ) {
  51.                     delete $struct->{'transferBatch'}->{'batchControlInfo'}->{'operatorSpecInformation'};
  52.                 }
  53.  
  54.                 if ( exists $struct->{'transferBatch'}->{'auditControlInfo'}->{'operatorSpecInformation'} ) {
  55.                     delete $struct->{'transferBatch'}->{'auditControlInfo'}->{'operatorSpecInformation'};
  56.                 }
  57.  
  58.                 foreach (0..$#$calleventtag) {
  59.  
  60.                     # 1st next if
  61.                     next if ( ! exists $calleventtag->[$_]->{'mobileOriginatedCall'});
  62.  
  63.                     if ( exists $calleventtag->[$_]->{'mobileOriginatedCall'}->{'basicCallInformation'}->{'destinationNetwork'} ) {
  64.                         delete $calleventtag->[$_]->{'mobileOriginatedCall'}->{'basicCallInformation'}->{'destinationNetwork'};
  65.                     }
  66.  
  67.                     if (
  68.                         exists $calleventtag->[$_]->{'mobileOriginatedCall'}->{'basicCallInformation'}->{'chargeableSubscriber'}->{'simChargeableSubscriber'}->{'msisdn'}
  69.                         && $calleventtag->[$_]->{'mobileOriginatedCall'}->{'basicCallInformation'}->{'chargeableSubscriber'}->{'simChargeableSubscriber'}->{'msisdn'} !~ m/^5519/
  70.                     ) {
  71.                         delete $calleventtag->[$_]->{'mobileOriginatedCall'}->{'basicCallInformation'}->{'chargeableSubscriber'}->{'simChargeableSubscriber'}->{'msisdn'};
  72.                     }
  73.  
  74.                     if (
  75.                         exists $calleventtag->[$_]->{'mobileOriginatedCall'}->{'camelServiceUsed'}
  76.                         && $calleventtag->[$_]->{'mobileOriginatedCall'}->{'camelServiceUsed'}->{'camelServiceKey'} != 80
  77.                     ) {
  78.                         delete $calleventtag->[$_]->{'mobileOriginatedCall'}->{'camelServiceUsed'};
  79.                     }
  80.  
  81.                     ## 2th next if
  82.                     next if (! exists $calleventtag->[$_]->{'gprsCall'});
  83.  
  84.                     if ( exists $calleventtag->[$_]->{'gprsCall'}->{'gprsBasicCallInformation'}->{'gprsDestination'}->{'accessPointNameOI'} ) {
  85.                         delete $calleventtag->[$_]->{'gprsCall'}->{'gprsBasicCallInformation'}->{'gprsDestination'}->{'accessPointNameOI'};
  86.                     }
  87.  
  88.                 }
  89.  
  90.  
  91.                 $tap3->encode("$tap_file")  or  die $tap3->error;
  92.             }
  93.  
  94.         }
  95.  
  96.     }
  97.  
  98.     closedir(DIR);
  99. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top