# VoIP Monitoring and Troubleshooting # (August 2017) Network characteristics that influence call quality: - Latency: how long it takes data to move from A to B - Jitter: unpredictable/variable delays between packet delivery or packets arriving out of order - Packet loss: some packets lost, possibly requiring retransmission - Burstiness of Loss and Jitter: loss and discards (due to jitter) tend to occur in bursts - Callers notice roundtrip latency of 250ms or more. Try to keep it under 150ms. - Most phones have a jitter buffer, but it usually only corrects delay variations of less than 100ms. - VoIP tolerates packet loss poorly. Even loss of 1% can be audible. Different audio codecs tolerate adverse network conditions differently. Explore Opus as a reasonably resilient codec. ## RTCP ## ## Tools built into Asterisk ## --- gab asterisk $ sudo watch "asterisk -rx 'pjsip show channelstats'" gab*CLI> pjsip show channelstats ...........Receive......... .........Transmit.......... BridgeId ChannelId ........ UpTime.. Codec. Count Lost Pct Jitter Count Lost Pct Jitter RTT.... =========================================================================================================== 0e4eb767 413-00000dfc 00:03:03 8965 0 0 0.000 8959 0 0 0.001 999.999 0e4eb767 hs_trunk-00000dfd 00:03:03 ulaw 8959 0 0 0.000 8965 0 0 0.000 0.051 0ea2b02c 302-00000e15 00:01:09 2176 0 0 0.000 3314 5 0 0.000 999.999 0ea2b02c gm_trunk-00000e13 00:01:10 ulaw 3315 0 0 0.000 3320 0 0 0.000 0.074 40225210 303-00000e1a 00:00:29 282 0 0 0.000 282 0 0 0.000 0.000 40225210 bv_trunk-00000e1b 00:00:29 ulaw 282 0 0 0.000 282 0 0 0.000 0.000 4b98b586 404-00000e05 00:01:35 3501 0 0 0.000 4592 1101 23 0.000 999.999 4b98b586 hr_trunk-00000e06 00:01:35 ulaw 4593 0 0 0.000 4597 0 0 0.000 0.065 9c2be061 103-00000e18 00:00:58 2767 0 0 0.000 2764 3 0 0.003 999.999 9c2be061 mo_trunk-00000e19 00:00:58 ulaw 2764 0 0 0.000 2767 0 0 0.000 0.059 c3e6aa2f 382-00000db8 00:09:29 28180 81 0 0.000 28253 0 0 0.000 999.999 c3e6aa2f hv_trunk-00000db9 00:09:28 ulaw 28253 0 0 0.000 28184 0 0 0.000 0.052 gab*CLI> rtcp set debug ip 198.0.107.153 RTCP Debugging Enabled for address: 198.0.107.153:0 gab*CLI> [Aug 8 16:27:27] [Aug 8 16:27:27] [Aug 8 16:27:27] Got RTCP from 198.0.107.153:5990 [Aug 8 16:27:27] PT: 200(Sender Report) [Aug 8 16:27:27] Reception reports: 1 [Aug 8 16:27:27] SSRC of sender: 610329440 [Aug 8 16:27:27] NTP timestamp: 1502224047.3294507008 [Aug 8 16:27:27] RTP timestamp: 45799360 [Aug 8 16:27:27] SPC: 250 SOC: 40000 [Aug 8 16:27:27] ## iperf ## iperf is available in two forked versions: iperf2 and iperf3. Both are good, although they're not entirely compatible. We'll use iperf2. # apt-get install iperf See IPERF(1). iperf measure network throughput. It tests either TCP or UDP. To test, establish both a server (to discard traffic) and a client (to generate traffic). ## Links ## - https://paulgorman.org/technical/asterisk.txt - https://www.voip-info.org/wiki-QoS - https://www.voip-info.org/wiki/view/How+To+Debug+and+Troubleshoot+VOIP - http://support.yealink.com/faq/faqInfo?id=689 - https://iperf.fr/ - https://openmaniak.com/iperf.php - http://software.es.net/iperf/faq.html - https://www.cisco.com/c/en/us/td/docs/ios/solutions_docs/qos_solutions/QoSVoIP/QoSVoIP.html - https://www.opus-codec.org/static/comparison/GoogleTest2.pdf - https://www.thinkmind.org/download.php?articleid=icsnc_2013_4_40_20121 - https://www.cisco.com/c/en/us/td/docs/ios/solutions_docs/qos_solutions/QoSVoIP/QoSVoIP.pdf