#!/usr/bin/perl # # Copyright (c) 2004-2006 Javier Gutierrez . # 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 charge detail of every calls in a TAP file # de: zeigt die Charge Details aller Calls eines TAP Files an. # sp: muestra los detalles de charge de todas las llamadas de un archivo TAP. # # # Usage: tap3edit_show_charge_details.txt tapfile # # E.g: tap3edit_show_charge_details.txt CDOPER1OPER200001 # use TAP3::Tap3edit; use Data::Dumper; $Data::Dumper::Indent=1; $Data::Dumper::Quotekeys=1; $Data::Dumper::Useqq=1; $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; # Will scan all the calls for Camel attachments. foreach $key ( @{$struct->{'transferBatch'}->{'callEventDetails'} } ) { $call=(keys %{$key})[0]; # Every element has always only one call print "This call is: $call\n"; # This shows the content of the chargelist. # print Dumper( $key->{$call}->{basicServiceUsedList}[0]{chargeInformationList}[0]{chargeDetailList} ); foreach $charge ( @{$key->{$call}->{basicServiceUsedList}[0]{chargeInformationList}[0]{chargeDetailList} } ) { print "chargeType= $charge->{chargeType}, charge= $charge->{charge}\n"; } }