RTP Media Stats

31 views
Skip to first unread message

Kasee Nadh Reddy Bojja

unread,
Aug 28, 2026, 11:42:01 AMAug 28
to Sipwise rtpengine
Hi there, I’m trying to determine if there’s a way to view the RTP media statistics for each leg of ingress and egress.  

Specifically, I’m interested in the following statistics for both ingress and egress: 
- Packets lost 
- Packets received 
- Retransmitted packets (if possible, including out-of-sequence packets)  

The setup involves the RTPEngine acting as a proxy, with the customer communicating directly with the RTPEngine, which then communicates with the Agent. 

customer <-> RTPEngine <-> Agent
RTPEngine acting as proxy

In the call_destroy function I see some stats being printed, but I feel these are extracted from RTCP feedback.

ilog(LOG_INFO, "------ respective (avg/min/max) jitter %" PRIu64 "/%" PRIu64 "/%" PRIu64 " ms, "
"RTT-e2e %" PRIu64 ".%" PRIu64 "/%" PRIu64 ".%" PRIu64
"/%" PRIu64 ".%" PRIu64 " ms, "
"RTT-dsct %" PRIu32 ".%" PRIu32 "/%" PRIu32 ".%" PRIu32
"/%" PRIu32 ".%" PRIu32 " ms, "
"packet loss %" PRIu64 "/%" PRIu64 "/%" PRIu64 "%%",
se->average_mos.jitter / mos_samples,
se->lowest_mos->jitter,
se->highest_mos->jitter,
se->average_mos.rtt / mos_samples / 1000,
(se->average_mos.rtt / mos_samples / 100) % 10,
se->lowest_mos->rtt / 1000,
(se->lowest_mos->rtt / 100) % 10,
se->highest_mos->rtt / 1000,
(se->highest_mos->rtt / 100) % 10,
se->average_mos.rtt_leg / mos_samples / 1000,
(se->average_mos.rtt_leg / mos_samples / 100) % 10,
se->lowest_mos->rtt_leg / 1000,
(se->lowest_mos->rtt_leg / 100) % 10,
se->highest_mos->rtt_leg / 1000,
(se->highest_mos->rtt_leg / 100) % 10,
se->average_mos.packetloss / mos_samples,
se->lowest_mos->packetloss,
se->highest_mos->packetloss);

Thanks
Kaseenadh Reddy Bojja

Kasee Nadh Reddy Bojja

unread,
Aug 28, 2026, 12:20:25 PMAug 28
to Sipwise rtpengine
My main goal is to see if there are any packets lost between Customer <-> RTPEngine or Agent <-> RTPEngine because of network congestion.

Richard Fuchs

unread,
Aug 30, 2026, 9:45:28 AMAug 30
to rtpe...@googlegroups.com
On 28/08/2026 11.42, Kasee Nadh Reddy Bojja wrote:
> In the call_destroy function I see some stats being printed, but I
> feel these are extracted from RTCP feedback.

Not necessarily. You can enable RTP measurements in rtpengine, typically
in combination with enabling local RTCP generation.

Stats are reported out in a number of ways, with most detail returned
from a "query" for a particular call, which are also returned from a
"delete" so that the stats can be consumed and processed (e.g. by the
SIP proxy) at the end of the call. There is also an option for
continuously reporting stats via MQTT. IIRC recently there was a feature
added to also report the contents of locally generated RTCP via Homer.

Cheers

Kasee Nadh Reddy Bojja

unread,
Aug 31, 2026, 3:17:06 PM (13 days ago) Aug 31
to Sipwise rtpengine

Hi, thanks for the reply

I have two questions

1. Do we need to enable the RTCP generation flag as well, I don't see documentation for this flag. Just by looking at this flag, it generates RTCP by RTPEngine. If this flag is enabled in RTPEngine, does it override the actual RTCP reported by the end client? 
2. I have enabled only `measure-rtp = true` and collected these stats and introduced manual packet loss on the iPad receive side (50%). 
If my understanding is correct, enabling measure-rtp calculates stats from the actual RTP stream. In my case, it should not report any loss on the SSRC  `cfc75443`, right? 
Because the packets were lost once RTPEngine sent it to iPad. How does RTPEngine reports this loss, Is it because of RTCP?

Thanks for your help.


IP ADDRESS LEGEND (for analysis purposes):
100.0.0.1 = RTPEngine Gateway (local endpoint)
200.0.0.100 = Mac Customer (Aleg - Caller)
200.0.0.200 = iPad Agent (Bleg - Callee)

CALL DETAILS:
Call ID: call-id-001
Duration: 2:30 (2 minutes 30 seconds)
Media Types: Audio (PCMU/8000) + Video (H264/90000)
Protocol: UDP/TLS/RTP/SAVPF

================================================================================
[core] Final packet stats:
Aug 31 18:41:17 rtpengine-gateway-01.example.com rtpengine[3643712]: INFO: [call-id-001]: [core] --- Tag 'tag-001' (label 'Aleg_label'), created 2:30 ago for branch ''
Aug 31 18:41:17 rtpengine-gateway-01.example.com rtpengine[3643712]: INFO: [call-id-001]: [core] ------ Media #1 (audio over UDP/TLS/RTP/SAVPF) using PCMU/8000
Aug 31 18:41:17 rtpengine-gateway-01.example.com rtpengine[3643712]: INFO: [call-id-001]: [core] --------- Port 100.0.0.1:39376 <> 200.0.0.100:49746, SSRC fc34f1b3, in 5983 p, 1117630 b, 3 e, 29 ts, out 5938 p, 1169401 b, 0 e
Aug 31 18:41:17 rtpengine-gateway-01.example.com rtpengine[3643712]: INFO: [call-id-001]: [core] ------ Media #2 (video over UDP/TLS/RTP/SAVPF) using H264/90000
Aug 31 18:41:17 rtpengine-gateway-01.example.com rtpengine[3643712]: INFO: [call-id-001]: [core] --------- Port 100.0.0.1:37000 <> 200.0.0.100:63410, SSRC 495e34bb, in 12957 p, 9926772 b, 21 e, 29 ts, out 8047 p, 5483275 b, 0 e
Aug 31 18:41:17 rtpengine-gateway-01.example.com rtpengine[3643712]: INFO: [call-id-001]: [core] --- SSRC 495e34bb
Aug 31 18:41:17 rtpengine-gateway-01.example.com rtpengine[3643712]: INFO: [call-id-001]: [core] ------ Average MOS 3.4, lowest MOS 2.0 (at 1:10), highest MOS 3.8 (at 0:10) lost:0
Aug 31 18:41:17 rtpengine-gateway-01.example.com rtpengine[3643712]: INFO: [call-id-001]: [core] ------ respective (avg/min/max) jitter 19/115/3 ms, RTT-e2e 313.7/412.0/288.1 ms, RTT-dsct 152.3/152.5/138.7 ms, packet loss 0/0/0%
Aug 31 18:41:17 rtpengine-gateway-01.example.com rtpengine[3643712]: INFO: [call-id-001]: [core] --- Tag 'tag-002' (label 'Bleg_label'), created 2:30 ago for branch ''
Aug 31 18:41:17 rtpengine-gateway-01.example.com rtpengine[3643712]: INFO: [call-id-001]: [core] ------ Media #1 (audio over UDP/TLS/RTP/SAVPF) using PCMU/8000
Aug 31 18:41:17 rtpengine-gateway-01.example.com rtpengine[3643712]: INFO: [call-id-001]: [core] --------- Port 100.0.0.1:39792 <> 200.0.0.200:51759, SSRC cfc75443, in 5938 p, 1109370 b, 0 e, 30 ts, out 5985 p, 1214467 b, 0 e
Aug 31 18:41:17 rtpengine-gateway-01.example.com rtpengine[3643712]: INFO: [call-id-001]: [core] ------ Media #2 (video over UDP/TLS/RTP/SAVPF) using H264/90000
Aug 31 18:41:17 rtpengine-gateway-01.example.com rtpengine[3643712]: INFO: [call-id-001]: [core] --------- Port 100.0.0.1:38778 <> 200.0.0.200:49343, SSRC ba641c06, in 8066 p, 5401698 b, 0 e, 30 ts, out 12959 p, 10142304 b, 0 e
Aug 31 18:41:17 rtpengine-gateway-01.example.com rtpengine[3643712]: INFO: [call-id-001]: [core] --- SSRC ba641c06
Aug 31 18:41:17 rtpengine-gateway-01.example.com rtpengine[3643712]: INFO: [call-id-001]: [core] ------ Average MOS 2.8, lowest MOS 1.0 (at 1:03), highest MOS 3.7 (at 0:08) lost:73
Aug 31 18:41:17 rtpengine-gateway-01.example.com rtpengine[3643712]: INFO: [call-id-001]: [core] ------ respective (avg/min/max) jitter 91/6/8 ms, RTT-e2e 314.7/302.8/303.0 ms, RTT-dsct 161.3/152.0/153.1 ms, packet loss 7/31/0%
Aug 31 18:41:17 rtpengine-gateway-01.example.com rtpengine[3643712]: INFO: [call-id-001]: [core] --- SSRC cfc75443
Aug 31 18:41:17 rtpengine-gateway-01.example.com rtpengine[3643712]: INFO: [call-id-001]: [core] ------ Average MOS 2.7, lowest MOS 1.0 (at 1:10), highest MOS 3.7 (at 0:08) lost:1247
Aug 31 18:41:17 rtpengine-gateway-01.example.com rtpengine[3643712]: INFO: [call-id-001]: [core] ------ respective (avg/min/max) jitter 7/61/3 ms, RTT-e2e 306.9/305.2/298.7 ms, RTT-dsct 155.9/155.2/150.6 ms, packet loss 21/79/0%


Reply all
Reply to author
Forward
0 new messages