Skip to content

Instantly share code, notes, and snippets.

@nickrobinson
Last active August 29, 2015 14:05
Show Gist options
  • Save nickrobinson/e605d1ad9ac0447bf709 to your computer and use it in GitHub Desktop.
Save nickrobinson/e605d1ad9ac0447bf709 to your computer and use it in GitHub Desktop.
SIPHawk
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 { }
@nickrobinson
Copy link
Author

Future Enhancements

  • Provide support to ouput Sequence Diagram like this program

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment