# This script is a menu and all files (Not TTFILES) associated with it are located in the same directory.
# All script explanations are located within the associated script files themseleves
# This menu is quite understandable so no explanation is needed.
# Script written by David M. Hagens
# Use as you want
#! /usr/bin/sh
LOGO="Call Trace Menu"
amenu="a. Display search results" ;
bmenu="b. Use a date only search" ;
cmenu="c. Use a time only search" ;
dmenu="d. Use a date range and time range search" ;
emenu="e. Get call records" ;
fmenu="f. Clean up search files" ;
badchoice () { MSG="Invalid Selection... Please Try Again" ; }
apick () { cat msisdnoutput.abbazabba | more; echo "\nPress Enter to return to menu"; read DUMMY; }
bpick () { echo "Enter a range in the form YYMMDD-YYMMDD:>"; ./datesearch TTFILE* >> calltracedate.abbazabba; }
cpick () { echo "Enter a range in the form HHMMSS-HHMMSS:>"; ./timesearch TTFILE* >> calltracetime.abbazabba; }
dpick () { echo "Follow the trailing instructions:\n"; sleep 1; echo "Enter a search range in the form YYMMDD-YYMMDD"; echo "Then push the (ENTER) key, Next"; echo "Enter a search range in the form HHMMSS-HHMMSS"; echo "Push the (ENTER) key again and you're done!"; ./narrowtimesearch TTFILE* >> calltracenarrowtime.abbazabba; }
epick () { echo "This choice makes call records readable then finds the number you are looking for.\n"; echo "NOTE: This process takes hours to complete because of the volume of data which is being searched.\n"; echo "NOTE: During the midpoint of this program you will be asked to supply a msisdn.\n"; echo "Press Enter to Continue"; read DUMMY; ./calltracesed; }
fpick () { echo "This removes files you created during your call records search.\n"; echo "If you wish to keep these files resident on the system please choose 'n'.\n"; echo "Please remember to delete the files you created by using this menu when you no longer need them.\n"; echo "Press Enter to continue"; read DUMMY; echo "Please choose 'y' for (yes) or 'n' for (no)""\n"; ./calltraceremove; }
themenu () {
clear
date
echo
echo "\t\t\t" $LOGO
echo
echo "\t\tNOTE: Search results can only be displayed after option 'd' has been completed."
echo "\t\tNOTE: You must do an 'b' 'c' or 'd' search before executing option 'd'\n"
echo "\t\tPlease Select:"
echo
echo "\t\t\t" $amenu
echo "\t\t\t" $bmenu
echo "\t\t\t" $cmenu
echo "\t\t\t" $dmenu
echo "\t\t\t" $emenu
echo "\t\t\t" $fmenu
echo "\t\t\tx. Exit"
echo
echo $MSG
echo
echo Select by pressing the letter and then ENTER;
}
MSG=
while true
do
themenu
read answer
MSG=
case $answer in
a|A) apick;;
b|B) bpick;;
c|C) cpick;;
d|D) dpick;;
e|E) epick;;
f|F) fpick;;
x|X) break;;
*) badchoice;;
esac
done
####
#!/usr/bin/perl -w
my %mylist;
my $datemin;
my $datemax;
my $timemin;
my $timemax;
my $range;
my $rangex;
# get the range (in this throwtogether it must be entered
# with no spaces in the form YYMMDD-YYMMDD)
# Get the range
$range = ;
$rangex = ;
# Break up the range
($datemin, $datemax) = split /-/, $range;
($timemin, $timemax) = split /-/, $rangex;
# Squeeze out leading and trailing spaces
$datemin =~ s/^\s+//;
$datemin =~ s/\s+$//;
$timemin =~ s/^\s+//;
$timemin =~ s/\s+$//;
$datemax =~ s/^\s+//;
$datemax =~ s/\s+$//;
$timemax =~ s/^\s+//;
$timemax =~ s/\s+$//;
# Get the filenames and break into fields
chomp(@ARGV = ) unless @ARGV;
for (@ARGV) {
if ($_ =~ m/(\w+)\.(\d{4})(\d{6})(\d{6})$/) {
# push the restricted range of filenames onto a hash of arrays
# keyed on the date field
if (($3>= $datemin) && ($3 <= $datemax) && ($4>= $timemin) && ($4 <= $timemax)) {
push(@{$mylist{$3}}, $_);
}
}
}
my @keys = sort (keys %mylist);
foreach my $key (@keys) {
foreach my $thing (@{%mylist}{$key}){
foreach my $it (@$thing) {
print "$it\n";
}
}
}
##
##
# This script first makes a file then appends to a file. The reason it has to append to a file is a sed command is involved
# Which will then make the appended to file executable. Then it is executed with dump_eric and it's output is appended to another file
# Because without this file being executed the next script "calltrace.awk" can't read the output to draw out a msisdn
# Calltrace.awk finds the msisdn (phone number) you are looking for.
# Script Written by David M. Hagens
#! /usr/bin/ksh
echo "Please choose the name corelating to your search:\n"; echo "'calltracedate.abbazabba' for a date search"; echo "'calltracetime.abbazabba' for time search"; echo " or"; echo "'calltracenarrowtime.abbazabba' for a more specific search\n"; echo "Which trace file do you want:>\c "
read ANSWER
if [ "$ANSWER" = "calltracedate.abbazabba" ]; then
sed -e 's/^/\dump_eric /' calltracedate.abbazabba >> calltrace2.abbazabba; chmod 777 calltrace2.abbazabba; ./calltrace2.abbazabba >> output.abbazabba; calltrace.awk; break;
elif
[ "$ANSWER" = "calltracetime.abbazabba" ]; then sed -e 's/^/\dump_eric /' calltracetime.abbazabba >> calltrace2.abbazabba; chmod 777 calltrace2.abbazabba; ./calltrace2.abbazabba >> output.abbazabba; calltrace.awk; break;
else
sed -e 's/^/\dump_eric /' calltracenarrowtime.abbazabba >> calltrace2.abbazabba; chmod 777 calltrace2.abbazabba; ./calltrace2.abbazabba >> output.abbazabba; calltrace.awk; break
fi
##
##
# Asks input for what msisdn (phone number) you are looking for and then it appends it's output to a file otherwise it is displayed on screen.
# The fields Called, Calling, Redirecting, are fields pulled out of the TTFILES
# Script written by David M. Hagens
# Copyright Airadigm Communications
#! /usr/bin/sh
echo "What msisdn?"
read msisdn
awk "BEGIN{ msisdn=\"$msisdn\"; }"'
{ #printf("%s\n", ARGV[2])
line14 =line13
line13 =line12
line12 =line11
line11 =line10
line10 =line9
line9 =line8
line8 =line7
line7 =line6
line6 =line5
line5 =line4
line4 =line3
line3 =line2
line2 =line1
line1 =$0 } /Called/ {if(match($9,msisdn)) a=1;}
a>0 {if(a==1&&match(line12,"MSTerm")) {print "\n" line12"\n" line2"\n"line1;MSTerm=1}
if(a==1&&match(line11,"TRANSIT")) {print "\n" line11"\n" line2"\n"line1; Transit=1}
if((a==8||a==9||a==10)&&MSTerm) print $0
if((a==6||a==7||a==8)&&Transit) print $0
if (a++>10) { a=0;MSTerm=0;Transit=0};
}
/Calling/ {if(match($9,msisdn)) b=1;}
b>0 {if(b==1&&match(line10,"MSORIG")) {print "\n" line10"\n"; MSOrig=1}
if(b==1&&match(line10,"TRANSIT")){print "\n" line10"\n"; Transit=1}
if((b<=2||b==5||b==7||b==8)&&MSOrig) print $0
if((b<=2||b==7||b==8||b==9)&&Transit) print $0
if (b++>8) { b=0; MSOrig=0;Transit=0};
}
/Redirecting/ {if(match($8,msisdn)) c=1;}
c>0 {if(c==1&&match(line14,"CallForward")) print "\n" line14"\n" line5"\n" line4"\n" ;
if(b<=5) print $0
if (c++>5) { c=0;};
}' output.abbazabba >> msisdnoutput.abbazabba; echo "The file with your search results is called "msisdnoutput.abbazabba""
##
##
# This script removes files created by the user doing a calltrace.
# if answer is "n" stop the script if the answer is "y" remove all .abbazabba files
# Files have .abbazabba extension so when they are removed vital system files will not accidentally be removed
# Script written by David M. Hagens
# Copyright Airadigm Communication
#! /usr/bin/sh
echo "Are you sure you want to remove these files"
read ANSWER
if [ "$ANSWER" = "n" ]; then sleep 1; break;
elif
[ "$ANSWER" = "y" ]; then rm *.abbazabba;
else
echo "Bad Option"; echo "Please answer y(yes) or n(no)"; read ANSWER
fi