From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1ScD9o-0002lQ-W8 for garchives@archives.gentoo.org; Wed, 06 Jun 2012 10:08:05 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DB759E044C; Wed, 6 Jun 2012 10:07:47 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 9EB62E044C for ; Wed, 6 Jun 2012 10:07:47 +0000 (UTC) Received: from flycatcher.gentoo.org (flycatcher.gentoo.org [81.93.255.6]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D30401B4033 for ; Wed, 6 Jun 2012 10:07:46 +0000 (UTC) Received: by flycatcher.gentoo.org (Postfix, from userid 820) id 885752004C; Wed, 6 Jun 2012 10:07:45 +0000 (UTC) From: "Tony Vroon (chainsaw)" To: gentoo-commits@lists.gentoo.org Reply-To: gentoo-dev@lists.gentoo.org, chainsaw@gentoo.org Subject: [gentoo-commits] gentoo-x86 commit in net-misc/asterisk/files/1.8.0: find_call_sip_trace.sh find_call_ids.sh X-VCS-Repository: gentoo-x86 X-VCS-Files: find_call_sip_trace.sh find_call_ids.sh X-VCS-Directories: net-misc/asterisk/files/1.8.0 X-VCS-Committer: chainsaw X-VCS-Committer-Name: Tony Vroon Content-Type: text/plain; charset=utf8 Message-Id: <20120606100745.885752004C@flycatcher.gentoo.org> Date: Wed, 6 Jun 2012 10:07:45 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 01ca6955-c0b9-41d5-aa7d-08387c4dc37a X-Archives-Hash: 3e7c35542444fda3a1de7fcf12e92695 chainsaw 12/06/06 10:07:45 Added: find_call_sip_trace.sh find_call_ids.sh Log: Bugfix releases on both the 1.8 & 10 branches, squelches a warning with= bind address set to "any", prevents an overflow on 32-bit systems for as= t_tvdiff_ms calculation and various rerouting/transfer fixes. Updated hel= per scripts by Jaco Kroon, closes bug #414585. =20 (Portage version: 2.1.10.63/cvs/Linux x86_64) Revision Changes Path 1.1 net-misc/asterisk/files/1.8.0/find_call_sip_trace.sh file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/asterisk/= files/1.8.0/find_call_sip_trace.sh?rev=3D1.1&view=3Dmarkup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/asterisk/= files/1.8.0/find_call_sip_trace.sh?rev=3D1.1&content-type=3Dtext/plain Index: find_call_sip_trace.sh =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D #! /bin/bash logfile=3D$1 callid=3D$2 function usage() { echo "USAGE: $1 logfile Call-ID [Call-ID ...]" exit -1 } [ -r "${logfile}" ] || usage $0 [ -n "${callid}" ] || usage $0 shift; shift; while [ $# -gt 0 ]; do callid=3D"${callid}|$1" shift done # modes: # 0 - searching for SIP start block ... # 1 - transmit of sorts # 2 - receive dos2unix < "${logfile}" | awk ' BEGIN { mode =3D 0 } mode=3D=3D0 && $4~"^VERBOSE" { dt=3D$1" "$2" "$3 } mode!=3D0 && $1 =3D=3D "Call-ID:" { #print if ($2 ~ /('"${callid}"')/) { callidmatch=3D1 } else { #print $2" does not match ^('"${callid}"')$" mode=3D0 } } (mode=3D=3D1 && $0=3D=3D"---") || (mode=3D=3D2 && $0=3D=3D"<------------= ->") { if (callidmatch) { print dt" "sipmode"\n"pckt"---" } mode=3D0 } mode!=3D0 { pckt =3D pckt $0 "\n" } mode=3D=3D0 && $0 ~ "chan_sip[.]c: .*[tT]ransmitting" { #print if ($6 =3D=3D "Retransmitting") { sipmode =3D $6" "$7" to "$NF } else { sipmode =3D "Transmitting to "$NF } mode=3D1 pckt=3D"" callidmatch=3D0 } mode=3D=3D0 && $0 ~ "SIP read from" { #print mode=3D2 pckt=3D"" callidmatch=3D0 sipmode=3D"Received from "$5":" } ' 1.1 net-misc/asterisk/files/1.8.0/find_call_ids.sh file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/asterisk/= files/1.8.0/find_call_ids.sh?rev=3D1.1&view=3Dmarkup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/asterisk/= files/1.8.0/find_call_ids.sh?rev=3D1.1&content-type=3Dtext/plain Index: find_call_ids.sh =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D #! /bin/bash logfile=3D$1 anum=3D$2 bnum=3D$3 function usage() { echo "USAGE: $1 logfile anum bnum" exit -1 } [ -r "${logfile}" ] || usage $0 [ -n "${anum}" ] || usage $0 [ -n "${bnum}" ] || usage $0 #echo "Finding calls from '${anum}' to '${bnum}' in ${logfile}." # modes: # 0 - not processing an INVITE. # 1 - processing an INVITE. # 2 - from matched (processing). dos2unix < "${logfile}" | awk ' BEGIN { mode =3D 0 } mode=3D=3D0 && $4~"^VERBOSE" { dt=3D$1" "$2" "$3 } mode=3D=3D0 && $1=3D=3D"INVITE" && $2 ~ "^sip:'"${bnum}"'@" { #print mode=3D1 split($2, a, "[:@]") bnum=3Da[2] } mode=3D=3D1 && $1=3D=3D"From:" { #print if ($3 ~ "^") { mode=3D2 split($3, a, "[:@]") anum=3Da[2] } else { #print "From does not match ... leaving block." mode =3D 0 } } mode!=3D0 && $1=3D=3D"Call-ID:" { callid=3D$2 if (NF!=3D2) { print "WTF @ Call-ID header having NF!=3D2" } } mode=3D=3D1 && $0=3D=3D"" { #print "Leaving block (no match)" mode =3D 0 } mode=3D=3D2 && $0=3D=3D"" { #print "Leaving block (match)" print dt " " anum " " bnum " " callid mode =3D 0 } '