Last active
August 29, 2015 14:05
-
-
Save nickrobinson/e605d1ad9ac0447bf709 to your computer and use it in GitHub Desktop.
SIPHawk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BEGIN {foundMatch = 0; containsId = 0; lineCounter = 0;} | |
{ | |
if($4 == "Tx:" || $4 == "Rx:") { | |
lineCounter = 0; | |
delete lineArray; | |
} | |
if($2 == "SIP.STACK" && ($4 != "Tx:" && $4 != "Rx:")) { | |
containsId = index($0, callID) | |
if(containsId > 0) { | |
foundMatch = 1; | |
} | |
lineArray[lineCounter] = $0; | |
lineCounter++; | |
} | |
else if($2 == "SIP.STACK" && foundMatch == 0){ | |
containsId = index($0, callID) | |
if(containsId > 0) { | |
foundMatch = 1; | |
} | |
lineArray[lineCounter] = $0; | |
lineCounter++; | |
} | |
else { | |
if(foundMatch) { | |
for (x = 0; x < lineCounter; x++) { | |
print lineArray[x]; | |
} | |
} | |
lineCounter = 0; | |
foundMatch = 0; | |
containsId = 0; | |
} | |
} | |
END { } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Future Enhancements