TT#14008 add MOS-LQ option

Change-Id: I2cacceda1f910fb2ed74ccd9f17cde1bf50031b0
pull/1287/head
Richard Fuchs 5 years ago
parent 891f45b4df
commit 3eae4b3af3

@ -434,6 +434,7 @@ static void options(int *argc, char ***argv) {
#ifdef HAVE_MQTT
AUTO_CLEANUP_GBUF(mqtt_publish_scope);
#endif
AUTO_CLEANUP_GBUF(mos);
rwlock_lock_w(&rtpe_config.config_lock);
@ -554,6 +555,7 @@ static void options(int *argc, char ***argv) {
{ "mqtt-publish-interval",0,0,G_OPTION_ARG_INT, &rtpe_config.mqtt_publish_interval,"Publish timer interval", "MILLISECONDS"},
{ "mqtt-publish-scope",0,0,G_OPTION_ARG_STRING, &mqtt_publish_scope, "Scope for published mosquitto messages","global|call|media"},
#endif
{ "mos",0,0, G_OPTION_ARG_STRING, &mos, "Type of MOS calculation","CQ|LQ"},
{ NULL, }
};
@ -820,6 +822,14 @@ static void options(int *argc, char ***argv) {
die("Invalid --mqtt-publish-scope option ('%s')", mqtt_publish_scope);
}
#endif
if (mos) {
if (!strcasecmp(mos, "cq"))
rtpe_config.mos = MOS_CQ;
else if (!strcmp(mos, "lq"))
rtpe_config.mos = MOS_LQ;
else
die("Invalid --mos option ('%s')", mos);
}
rwlock_unlock_w(&rtpe_config.config_lock);
}

@ -978,6 +978,13 @@ call participant, so usually 2 media per call) will be published to Mosquitto
with stats for that call media every I<interval> milliseconds, plus one message
every I<interval> milliseconds with global stats.
=item B<--mos=>B<CQ>|B<LQ>
MOS calculation formula. Defaults to B<CQ> (conversational quality) which takes
RTT into account and therefore requires peers to correctly send RTCP. If set to
B<LQ> (listening quality) RTT is ignored, allowing a MOS to be calculated in
the absence of RTCP.
=back
=head1 INTERFACES

@ -61,8 +61,11 @@ static void ssrc_entry_put(void *ep) {
// returned as mos * 10 (i.e. 10 - 50 for 1.0 to 5.0)
static void mos_calc(struct ssrc_stats_block *ssb) {
if (!ssb->rtt)
uint64_t rtt = ssb->rtt;
if (rtpe_config.mos == MOS_CQ && !rtt)
return; // can not compute the MOS-CQ unless we have a valid RTT
else if (rtpe_config.mos == MOS_LQ)
rtt = 0; // ignore RTT
// as per https://www.pingman.com/kb/article/how-is-mos-calculated-in-pingplotter-pro-50.html
int eff_rtt = ssb->rtt / 1000 + ssb->jitter * 2 + 10;

@ -143,6 +143,10 @@ struct rtpengine_config {
MPS_CALL,
MPS_MEDIA,
} mqtt_publish_scope;
enum {
MOS_CQ = 0,
MOS_LQ,
} mos;
};

Loading…
Cancel
Save