From e1847cadc55bd376392609f4f2926cd28a997bc4 Mon Sep 17 00:00:00 2001 From: Julien Chavanton Date: Tue, 24 Nov 2020 18:40:39 +0000 Subject: [PATCH] RTT per call leg --- daemon/call_interfaces.c | 1 + daemon/ssrc.c | 2 ++ include/ssrc.h | 1 + 3 files changed, 4 insertions(+) diff --git a/daemon/call_interfaces.c b/daemon/call_interfaces.c index 6318860f6..436fd3705 100644 --- a/daemon/call_interfaces.c +++ b/daemon/call_interfaces.c @@ -1536,6 +1536,7 @@ static void ng_stats_ssrc_mos_entry_common(bencode_item_t *subent, struct ssrc_s { bencode_dictionary_add_integer(subent, "MOS", sb->mos / div); bencode_dictionary_add_integer(subent, "round-trip time", sb->rtt / div); + bencode_dictionary_add_integer(subent, "round-trip time leg", sb->rtt_leg / div); bencode_dictionary_add_integer(subent, "jitter", sb->jitter / div); bencode_dictionary_add_integer(subent, "packet loss", sb->packetloss / div); } diff --git a/daemon/ssrc.c b/daemon/ssrc.c index 535e8c957..94d6252b3 100644 --- a/daemon/ssrc.c +++ b/daemon/ssrc.c @@ -357,6 +357,7 @@ void ssrc_receiver_report(struct call_media *m, const struct ssrc_receiver_repor *ssb = (struct ssrc_stats_block) { .jitter = jitter, .rtt = rtt + other_e->last_rtt, + .rtt_leg = rtt, .reported = *tv, .packetloss = (unsigned int) rr->fraction_lost * 100 / 256, }; @@ -386,6 +387,7 @@ void ssrc_receiver_report(struct call_media *m, const struct ssrc_receiver_repor // running tally other_e->average_mos.jitter += ssb->jitter; other_e->average_mos.rtt += ssb->rtt; + other_e->average_mos.rtt_leg += ssb->rtt_leg; other_e->average_mos.packetloss += ssb->packetloss; other_e->average_mos.mos += ssb->mos; diff --git a/include/ssrc.h b/include/ssrc.h index e3d34e1b9..6698d7c22 100644 --- a/include/ssrc.h +++ b/include/ssrc.h @@ -71,6 +71,7 @@ struct ssrc_stats_block { struct timeval reported; u_int64_t jitter; // ms u_int64_t rtt; // us - combined from both sides + u_int32_t rtt_leg; // RTT only for the leg receiving the RTCP report u_int64_t packetloss; // percent u_int64_t mos; // nominal range of 10 - 50 for MOS values 1.0 to 5.0 };