Created
June 22, 2012 22:22
-
-
Save J-O-N/2975540 to your computer and use it in GitHub Desktop.
A tool for viewing FreeSWITCH SIP logs
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
#!/bin/bash | |
# A useful tool for viewing FreeSWITCH SIP logs | |
# 2600hz - The Future of Cloud Telecom | |
awk 'BEGIN{I=0};/^(send|recv).*$/{SIPPACKET=1}; SIPPACKET==1{PACKET[I++]=$0;}; SIPPACKET==1&&/^\ +(Call-ID:).*$/{CALLID=$2}; SIPPACKET==0{print $0}; /^\ +-+$/{PRINT=(SIPPACKET==1?(PRINT==1?0:1):0);SIPPACKET=(PRINT==1?1:0);if(SIPPACKET==0){for(i=0;i<I;i++){print CALLID, PACKET[i]; delete PACKET[i];}I=0;CALLID="";}};' "$@" <&0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment