Advertisement
MichaelBuchholz

Untitled

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