Parser Cdma
Parser Cdma
Parser Cdma
/usr/bin/perl
#
# Copyright (c) 2004 Javier Gutierrez <[email protected]>.
# All rights reserved. This program is free software; you can redistribute
# it and/or modify it under the same terms as Perl itself.
# http://www.tap3edit.com
#
# en: show the first service code of every call.
# de: zeigt den ersten Service-Code aller Calls an.
# sp: muestra el primer service code de todas las llamadas.
#
#
# Usage: tap3edit_show_service_code.txt tapfile
#
# E.g: tap3edit_show_service_code.txt CDOPER1OPER200001
#
use TAP3::Tap3edit;
$filename=shift;
if ( ! $filename ) {
die "Usage: $0 tapname\n";
}
$tap3 = TAP3::Tap3edit->new();
$tap3->decode($filename) or die $tap3->error;
$struct=$tap3->structure;
my $key;
$totRetCallCnt = $struct->{transferBatch}->{auditControlInfo}->{callEventDetails
Count};
$totalCharge = $struct->{transferBatch}->{auditControlInfo}->{totalCharge};
$operatorName = $struct->{transferBatch}->{auditControlInfo}->{totalCharge};
print $totRetCallCnt ;
print $totalCharge ;
$recipient = $struct->{transferBatch}->{batchControlInfo}->{recipient};
print $recipient ;
$sender = $struct->{transferBatch}->{batchControlInfo}->{sender};
print $sender ;
$fileSequenceNumber = $struct->{transferBatch}->{batchControlInfo}->{fileSequenc
eNumber};
print $fileSequenceNumber ;
$specificationVersionNumber = $struct->{transferBatch}->{batchControlInfo}->{spe
cificationVersionNumber};
print "specificationVersionNumber:$specificationVersionNumber" ;
$releaseVersionNumber = $struct->{transferBatch}->{batchControlInfo}->{releaseVe
rsionNumber};
print "releaseVersionNumber:$releaseVersionNumber" ;
$fileCreationTimeStamp = $struct->{transferBatch}->{batchControlInfo}->{fileCrea
tionTimeStamp}->{localTimeStamp};
print "fileCreationTimeStamp:$fileCreationTimeStamp" ;
$utcTimeOffset = $struct->{transferBatch}->{batchControlInfo}->{fileCreationTime
Stamp}->{utcTimeOffset};
print "utcTimeOffset:$utcTimeOffset" ;
$transfer_utcTimeOffset = $struct->{transferBatch}->{batchControlInfo}->{transfe
rCutOffTimeStamp}->{localTimeStamp};
print "utcTimeOffset:$transfer_utcTimeOffset" ;
$transfer_utcTimeOffset = $struct->{transferBatch}->{batchControlInfo}->{transfe
rCutOffTimeStamp}->{utcTimeOffset};
print "utcTimeOffset:$transfer_utcTimeOffset" ;
$available_localTimeStamp = $struct->{transferBatch}->{batchControlInfo}->{fileA
vailableTimeStamp}->{localTimeStamp};
print "$available_localTimeStamp:$available_localTimeStamp" ;
$available_utcTimeOffset = $struct->{transferBatch}->{batchControlInfo}->{fileAv
ailableTimeStamp}->{utcTimeOffset};
print "available_utcTimeOffset:$available_utcTimeOffset" ;
print $localCurrency;
print $tapDecimalPlaces;
my $element;
if (defined $element->{numberOfDecimalPlaces}) {
$numberOfDecimalPlaces=$element->{numberOfDecimalPlaces}
;
print "numberOfDecimalPlaces: $numberOfDecimalPlaces\n";
if (defined $element->{exchangeRateCode}) {
$exchangeRateCode=$element->{exchangeRateCode};
print "exchangeRateCode: $exchangeRateCode\n";
}
if (defined $element->{exchangeRate}) {
$exchangeRate=$element->{exchangeRate};
print "exchangeRate: $exchangeRate\n";
}
my $element;
if (defined $element->{totalCallEventDuration}) {
$totalCallEventDuration=$element->{totalCallEventDuratio
n};
print "totalCallEventDuration: $totalCallEventDuration\n
";
}
}
foreach $key ( @{$struct->{'transferBatch'}->{'callEventDetails'} } ) {
$service_code=$key->{$_}{basicServiceUsedList}[0]{basicS
ervice}{serviceCode}{teleServiceCode};
print "Service Code: $service_code\n";
}
}
#}