#!/usr/bin/perl # # Copyright (c) 2004 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 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; # Will scan all the calls for Camel attachments. foreach $key ( @{$struct->{'transferBatch'}->{'callEventDetails'} } ) { foreach ( keys %{$key} ) { # Since the content of basicServiceUsedList is stored as an Array we show # the first elemet with "[0]". In the case we want to show all of them we # can use "foreach". $service_code=$key->{$_}{basicServiceUsedList}[0]{basicService}{serviceCode}{teleServiceCode}; print "Service Code: $service_code\n"; } }