Module: kamailio
Branch: 5.5
Commit: 4399fe52432f4a7c36ee161382bc4a0da3508c9b
URL:
https://github.com/kamailio/kamailio/commit/4399fe52432f4a7c36ee161382bc4a0…
Author: Julien Chavanton <jchavanton(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-06-15T09:28:07+02:00
rtpengine: ignore mos 0 when selecting min-mos (#2771)
and computing average mos
(cherry picked from commit a378f97adac89077de2fb162ec20295f6e4352fe)
---
Modified: src/modules/rtpengine/rtpengine.c
---
Diff:
https://github.com/kamailio/kamailio/commit/4399fe52432f4a7c36ee161382bc4a0…
Patch:
https://github.com/kamailio/kamailio/commit/4399fe52432f4a7c36ee161382bc4a0…
---
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;
}
}