<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 20, 2015 at 12:43 AM, Scott Griepentrog <span dir="ltr"><<a href="mailto:sgriepentrog@digium.com" target="_blank">sgriepentrog@digium.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div style="color:rgb(102,0,0)">I would recommend capturing traffic outside your Asterisk server with Wireshark, then running the Telephony/Rtp/Analysize Streams option to determine if you have packet loss at that point in the network.</div></div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On Mon, Jan 19, 2015 at 1:00 PM, Todd R. <span dir="ltr"><<a href="mailto:tjrlist@live.com" target="_blank">tjrlist@live.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">


<div><div dir="ltr">Thanks but no Adtran here.<div><br></div><div>I do think these stats are indicating an issue, I just don't know how to prove it outside Asterisk.</div><div><br></div><div><br><div><hr>From: <a href="mailto:EWieling@nyigc.com" target="_blank">EWieling@nyigc.com</a><br>To: <a href="mailto:tjrlist@live.com" target="_blank">tjrlist@live.com</a>; <a href="mailto:asterisk-users@lists.digium.com" target="_blank">asterisk-users@lists.digium.com</a><br>Date: Mon, 19 Jan 2015 13:55:33 -0500<br>Subject: RE: [asterisk-users] sip show channelstats reliable?<div><div><br><br><div><div><p><span style="font-size:10.5pt;font-family:Consolas;color:rgb(31,73,125)">I’ve seen something similar with Adtran SIP gateways.    When a re-invite happens the Adtran gets all confused about call stats and marks the pre-reinvite leg of the call as losing large numbers of packets.    BTW, IIRC reinvites happen when a codec changes or the channel switches to T.38.</span></p><p><span style="font-size:10.5pt;font-family:Consolas;color:rgb(31,73,125)"> </span></p></div><p><span style="font-size:11pt;font-family:"Calibri","sans-serif";color:rgb(31,73,125)">Also Adtran SIP gateways appear not to support OPTIONS packets when running in SIP proxy mode, which is very annoying.     At some point I’ll try and arrange a slugfest between Digium and Adtran and they can figure out why it doesn’t work.</span></p><p><span style="font-size:11pt;font-family:"Calibri","sans-serif";color:rgb(31,73,125)"> </span></p><div><div style="border-width:1pt medium medium;border-style:solid none none;border-color:rgb(181,196,223) -moz-use-text-color -moz-use-text-color;padding:3pt 0in 0in"><p><b><span style="font-size:10pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10pt;font-family:"Tahoma","sans-serif""> <a href="mailto:asterisk-users-bounces@lists.digium.com" target="_blank">asterisk-users-bounces@lists.digium.com</a> [mailto:<a href="mailto:asterisk-users-bounces@lists.digium.com" target="_blank">asterisk-users-bounces@lists.digium.com</a>] <b>On Behalf Of </b>Todd R.<br><b>Sent:</b> Monday, January 19, 2015 1:45 PM<br><b>To:</b> Asterisk-Users List<br><b>Subject:</b> Re: [asterisk-users] sip show channelstats reliable?</span></p></div></div><p> </p><div><p><span style="font-family:"Calibri","sans-serif"">Additional info:</span></p><div><p><span style="font-family:"Calibri","sans-serif""> </span></p></div><div><p><span style="font-family:"Calibri","sans-serif"">At the moment I am running 1.8.x but the other day I was getting the same results on 11.x</span></p></div><div><p><span style="font-family:"Calibri","sans-serif""> </span></p></div><div><p><span style="font-family:"Calibri","sans-serif"">Here is a sample from show channelstats. I do think this command is showing that there is trouble between specific IP's and my Asterisk box but I don't know if the numbers are accurate and reliable.</span></p></div><div><p><span style="font-family:"Calibri","sans-serif""> </span></p></div><div><table style="width:801pt;border-collapse:collapse" border="0" cellpadding="0" cellspacing="0" width="1068"><tbody><tr style="height:15pt"><td style="width:83pt;padding:0in;height:15pt" width="111"><p>Peer</p></td><td style="width:107pt;padding:0in;height:15pt" width="143"><p>Call ID</p></td><td style="width:65pt;padding:0in;height:15pt" width="87"><p>Duration</p></td><td style="width:80pt;padding:0in;height:15pt" width="107"><p>Recv: Pack</p></td><td style="width:71pt;padding:0in;height:15pt" width="95"><p>Lost</p></td><td style="width:74pt;padding:0in;height:15pt" width="99"><p>(     %)</p></td><td style="width:50pt;padding:0in;height:15pt" width="67"><p>Jitter</p></td><td style="width:79pt;padding:0in;height:15pt" width="105"><p>Send: Pack</p></td><td style="width:80pt;padding:0in;height:15pt" width="107"><p>Lost</p></td><td style="width:11pt;padding:0in;height:15pt" width="15"><p>(</p></td><td style="width:60pt;padding:0in;height:15pt" width="80"><p>%)</p></td><td style="width:41pt;padding:0in;height:15pt" width="55"><p>Jitter</p></td></tr><tr style="height:15pt"><td style="padding:0in;height:15pt"><p>x.x.x.x</p></td><td style="padding:0in;height:15pt"><p>5531341d06b</p></td><td style="padding:0in;height:15pt"><p>00:07:42</p></td><td style="padding:0in;height:15pt"><p>0000023123</p></td><td style="padding:0in;height:15pt"><p>0000063836</p></td><td style="padding:0in;height:15pt"><p>(73.41%)</p></td><td style="padding:0in;height:15pt"><p>0.0000</p></td><td style="padding:0in;height:15pt"><p>0000023102</p></td><td style="padding:0in;height:15pt"><p>0000000000</p></td><td style="padding:0in;height:15pt"><p>(</p></td><td style="padding:0in;height:15pt"><p>0.00%)</p></td><td style="padding:0in;height:15pt"><p>0.0007</p></td></tr></tbody></table></div><div><p><span style="font-family:"Calibri","sans-serif""> </span></p></div><div><p><span style="font-family:"Calibri","sans-serif"">Peer IP changed to protect the innocent :-)</span></p></div><div><p><span style="font-family:"Calibri","sans-serif""> </span></p><div><div style="text-align:center" align="center"><span style="font-family:"Calibri","sans-serif""><hr align="center" size="2" width="100%"></span></div><p><span style="font-family:"Calibri","sans-serif"">From: <a href="mailto:tjrlist@live.com" target="_blank">tjrlist@live.com</a><br>To: <a href="mailto:asterisk-users@lists.digium.com" target="_blank">asterisk-users@lists.digium.com</a><br>Date: Mon, 19 Jan 2015 12:17:25 -0600<br>Subject: [asterisk-users] sip show channelstats reliable?</span></p><div><p><span style="font-family:"Calibri","sans-serif"">I am seeing lots of lost packets when running the command sip show channelstats at the CLI.</span></p><div><p><span style="font-family:"Calibri","sans-serif""> </span></p></div><div><p><span style="font-family:"Calibri","sans-serif"">There are issues across multiple Asterisk servers I am trying to diagnose but everything I read seems to point to this command being pretty unreliable.</span></p></div><div><p><span style="font-family:"Calibri","sans-serif""> </span></p></div><div><p><span style="font-family:"Calibri","sans-serif"">Can I trust the info this command shows?</span></p></div><div><p><span style="font-family:"Calibri","sans-serif""> </span></p></div><div><p><span style="font-family:"Calibri","sans-serif"">I am showing lots of lost packets in sip show channelstats but I can't see any packet loss when pinging the same IP's to/from.</span></p></div><div><p><span style="font-family:"Calibri","sans-serif""> </span></p></div><div><p><span style="font-family:"Calibri","sans-serif"">Since I don't 100% control the network my gear is on, I need something outside of Asterisk to show the network engineer to convince here and myself that there are network issues.</span></p></div><div><p><span style="font-family:"Calibri","sans-serif""> </span></p></div><div><p><span style="font-family:"Calibri","sans-serif"">All I have is the loss that's shown from this command with no real network stats to back it up.</span></p></div><div><p><span style="font-family:"Calibri","sans-serif""> </span></p></div><div><p><span style="font-family:"Calibri","sans-serif"">Is there a magic command in CentOS anyone can recommend to diagnose and match up the issues shown in Asterisk using this command?</span></p></div><div><p><span style="font-family:"Calibri","sans-serif""> </span></p></div><div><p><span style="font-family:"Calibri","sans-serif"">Moving gear around on the network changes the info Asterisk shows a LOT. For example, if I point traffic to the main physical gateway I get loss to a particular customer's IP (their PBX), if I move it to another place on the network (as a VM) their IP is good and other customers IP's start showing loss using the channelstats info.</span></p></div><div><p><span style="font-family:"Calibri","sans-serif""> </span></p></div><div><p><span style="font-family:"Calibri","sans-serif"">Driving me freakin' crazy. It does appear there are network issues causing my troubles but I can't get help if I can't point to some hard and fast issues outside of Asterisk.</span></p></div><div><p><span style="font-family:"Calibri","sans-serif""> </span></p></div><div><p><span style="font-family:"Calibri","sans-serif"">The only thing I have right now is collissions showing on one of a few of our pfSense devices but they are virtual running on XenServer, still this would indicate a problem in my opinion.</span></p></div><div><p><span style="font-family:"Calibri","sans-serif""> </span></p></div><div><p><span style="font-family:"Calibri","sans-serif"">Thanks in advance for any assistance on this issue. Stepping back from the ledge now LOL</span></p></div><div><p><span style="font-family:"Calibri","sans-serif""> </span></p></div><div><p><span style="font-family:"Calibri","sans-serif""> </span></p></div></div><p><span style="font-family:"Calibri","sans-serif""><br>-- _____________________________________________________________________ -- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> -- New to Asterisk? Join us for a live introductory webinar every Thurs: <a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a> asterisk-users mailing list To UNSUBSCRIBE or update options visit: <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a></span></p></div></div></div></div></div></div></div></div>                                    </div></div>
<br>--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
               <a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br></blockquote></div><br><br clear="all"><div><br></div></div></div><span class=""><font color="#888888">-- <br><div><div dir="ltr"><img alt="Digium logo" src="https://my.digium.com/images/graphics/digium_RGB_signature.gif" style="color: rgb(0, 0, 0); font-family: Arial,Helvetica,sans-serif; font-size: 12px;" height="50" width="288"><div>Scott Griepentrog<br>Digium, Inc · Software Developer<br>445 Jan Davis Drive NW · Huntsville, AL 35806 · US<br>direct/fax: +1 256 428 6239 · mobile: +1 256 580 6090<br>Check us out at: <a href="http://digium.com" target="_blank">http://digium.com</a> · <a href="http://asterisk.org" target="_blank">http://asterisk.org</a><br></div></div></div>
</font></span></div><br></blockquote></div><br><br>You can find out the data loss outside of Asterisk by using tcpdump and tshark(wireshark)<br><br>1. Capture output of Asterisk SIP channels in a log file ax_log_yyyymmdd<br><br>$while :; do  date; asterisk -rnx 'sip show channelstats';  sleep 5 ; done >> ax_log_yyyymmdd<br><br>2. Capture tcpdump traffic on the asterisk server:<br><br>$tcpdump -nq -s 0 -i eth0 -G3600 -w eth_sip_traffic-%F-%H-%M-%S.pcap port 5060 or port 5061<br></div><div class="gmail_extra">[this saves the all the ethernet traffic of ports 5060 & 5061 in the pcap file for every hour(-G 3600) ]<br></div><div class="gmail_extra"><br>3. Once you can see the data loss in the ax_log_yyyymmdd, check for the same time in the eth_sip_traffic.pcap<br><br>Analyze the eth_sip_traffic.pcap <br><br>$tshark -t ad -r  eth_sip_traffic.pcap |grep sip_client_ip | less<br></div><div class="gmail_extra">[ -t ad: is for time format, -r :is for input file]<br></div><div class="gmail_extra"><br>1034847 2000-01-03 22:08:10.239661  sip_client_ip -> asterisk_server_ip  RTP PT=ITU-T G.711 PCMA, SSRC=0x488EDB49, Seq=314, Time=50240<br>1036396 2000-01-03 22:08:11.647404  sip_client_ip -> asterisk_server_ip  RTP PT=ITU-T G.711 PCMA, SSRC=0x488EDB49, Seq=383, Time=61280<br>1036401 2000-01-03 22:08:11.647560  sip_client_ip -> asterisk_server_ip  RTP PT=ITU-T G.711 PCMA, SSRC=0x488EDB49, Seq=384, Time=61440<br><br>You can find the if the packets loss is happening, with the missing sequence numbers.<br><br></div><div class="gmail_extra">PS: I think any loss greater than 3%, will deteriorate the call quality.<br><br><br clear="all"></div><div class="gmail_extra"><br>-- <br><div class="gmail_signature">Regards,<br><br>Tirveni Yadav<br><a href="http://www.udyansh.org" target="_blank">www.udyansh.com</a><br><br>What is this Universe ? From what it arises ? Into what does it go?<br>In freedom it arises, In freedom it rests and into freedom it melts away.<br>Upanishads.</div>
</div></div>