Module: kamailio
Branch: master
Commit: a378f97adac89077de2fb162ec20295f6e4352fe
URL:
https://github.com/kamailio/kamailio/commit/a378f97adac89077de2fb162ec20295…
Author: Julien Chavanton <jchavanton(a)gmail.com>
Committer: GitHub <noreply(a)github.com>
Date: 2021-06-10T08:03:13-04:00
rtpengine: ignore mos 0 when selecting min-mos (#2771)
and computing average mos
---
Modified: src/modules/rtpengine/rtpengine.c
---
Diff:
https://github.com/kamailio/kamailio/commit/a378f97adac89077de2fb162ec20295…
Patch:
https://github.com/kamailio/kamailio/commit/a378f97adac89077de2fb162ec20295…
---
diff --git a/src/modules/rtpengine/rtpengine.c b/src/modules/rtpengine/rtpengine.c
index 6f91c222b2..6266520578 100644
--- a/src/modules/rtpengine/rtpengine.c
+++ b/src/modules/rtpengine/rtpengine.c
@@ -3588,13 +3588,15 @@ static void parse_call_stats_1(struct minmax_mos_label_stats
*mmls, bencode_item
continue;
if (decode_mos_vals_dict(&vals_decoded, ssrc_dict, "average MOS")) {
- average_vals.avg_samples++;
- average_vals.mos += vals_decoded.mos;
- average_vals.packetloss += vals_decoded.packetloss;
- average_vals.jitter += vals_decoded.jitter;
- average_vals.roundtrip += vals_decoded.roundtrip;
- average_vals.roundtrip_leg += vals_decoded.roundtrip_leg;
- average_vals.samples += vals_decoded.samples;
+ if (vals_decoded.mos > 0) {
+ average_vals.avg_samples++;
+ average_vals.mos += vals_decoded.mos;
+ average_vals.packetloss += vals_decoded.packetloss;
+ average_vals.jitter += vals_decoded.jitter;
+ average_vals.roundtrip += vals_decoded.roundtrip;
+ average_vals.roundtrip_leg += vals_decoded.roundtrip_leg;
+ average_vals.samples += vals_decoded.samples;
+ }
}
if (decode_mos_vals_dict(&vals_decoded, ssrc_dict, "highest MOS")) {
@@ -3602,7 +3604,7 @@ static void parse_call_stats_1(struct minmax_mos_label_stats *mmls,
bencode_item
max_vals = vals_decoded;
}
if (decode_mos_vals_dict(&vals_decoded, ssrc_dict, "lowest MOS")) {
- if (vals_decoded.mos < min_vals.mos)
+ if (vals_decoded.mos > 0 && vals_decoded.mos < min_vals.mos)
min_vals = vals_decoded;
}
}