MT#65392 add ssrc-reporting config option

Change-Id: I5ea25c5a6dfb845a0d45d9e41162ef5bc151fe36
pull/2127/head
Richard Fuchs 6 days ago
parent e61f5c8b9a
commit ccdd5398c7

@ -1094,6 +1094,9 @@ static void ng_stats_ssrc_1(const ng_parser_t *parser, parser_arg ent, struct ss
static void ng_stats_ssrc(const ng_parser_t *parser, parser_arg dict, parser_arg list,
const struct ssrc_hash *ht)
{
if (rtpe_config.ssrc_reporting == SRP_NONE)
return;
for (GList *l = ht->nq.head; l; l = l->next) {
struct ssrc_entry_call *se = l->data;
char tmp[12];
@ -1103,7 +1106,8 @@ static void ng_stats_ssrc(const ng_parser_t *parser, parser_arg dict, parser_arg
parser->dict_add_int(ent, "SSRC", se->h.ssrc);
ng_stats_ssrc_1(parser, ent, se);
if ((rtpe_config.ssrc_reporting & 0x2) == 0)
ng_stats_ssrc_1(parser, ent, se);
if (dict.gen && !parser->dict_contains(dict, tmp)) {
ent = parser->dict_add_dict_dup(dict, tmp);
@ -1142,7 +1146,9 @@ void ng_call_stats(ng_command_ctx_t *ctx, call_t *call, const str *fromtag, cons
if (call->metadata.s)
parser->dict_add_str(ctx->resp, "metadata", &call->metadata);
ssrc = parser->dict_add_dict(ctx->resp, "SSRC");
if ((rtpe_config.ssrc_reporting & 0x1) == 0)
ssrc = parser->dict_add_dict(ctx->resp, "SSRC");
tags = parser->dict_add_dict(ctx->resp, "tags");
stats:

@ -754,6 +754,7 @@ static void options(int *argc, char ***argv, charp_ht templates) {
g_autoptr(char) templates_section = NULL;
g_autoptr(char) interfaces_config = NULL;
g_autoptr(char) transcode_config = NULL;
g_autoptr(char) ssrc_reporting = NULL;
int silent_timeout = 0;
int timeout = 0;
int final_timeout = 0;
@ -954,6 +955,7 @@ static void options(int *argc, char ***argv, charp_ht templates) {
#endif
{ "mos",0,0, G_OPTION_ARG_STRING_ARRAY,&mos_options, "MOS calculation options", "CQ|LQ"},
{ "measure-rtp",0,0, G_OPTION_ARG_NONE, &rtpe_config.measure_rtp,"Enable measuring RTP statistics and VoIP metrics",NULL},
{ "ssrc-reporting",0,0, G_OPTION_ARG_STRING, &ssrc_reporting, "Format of SSRC stats returned by delete/query","full|inline|global|none"},
#ifdef SO_INCOMING_CPU
{ "socket-cpu-affinity",0,0,G_OPTION_ARG_INT, &rtpe_config.cpu_affinity,"CPU affinity for media sockets","INT"},
#endif
@ -1538,6 +1540,19 @@ static void options(int *argc, char ***argv, charp_ht templates) {
die("Invalid --control-pmtu option ('%s')", control_pmtu);
}
if (ssrc_reporting) {
if (!strcasecmp(ssrc_reporting, "full"))
rtpe_config.ssrc_reporting = SRP_FULL;
else if (!strcasecmp(ssrc_reporting, "inline"))
rtpe_config.ssrc_reporting = SRP_INLINE;
else if (!strcasecmp(ssrc_reporting, "global"))
rtpe_config.ssrc_reporting = SRP_GLOBAL;
else if (!strcasecmp(ssrc_reporting, "none"))
rtpe_config.ssrc_reporting = SRP_NONE;
else
die("Invalid --ssrc-reporting option ('%s')", ssrc_reporting);
}
#define STR_LEN_INIT(x) if (rtpe_config.x.s) rtpe_config.x.len = strlen(rtpe_config.x.s)
STR_LEN_INIT(vsc_start_rec);
STR_LEN_INIT(vsc_stop_rec);

@ -1593,6 +1593,25 @@ call to inject-DTMF won't be sent to __\-\-dtmf-log-dest=__ or __\-\-listen-tcp-
Enable measuring RTP metrics even for plain RTP passthrough scenarios. Without
that option, RTP metrics are measured only in transcoding scenarios.
- __\-\ssrc-reporting=full__\|__inline__\|__global__\|__none__
Controls the format the SSRC statistics (primarily relevant for MOS and
other RTP metrics) in the responses to __delete__ and __query__ messages.
The __inline__ format puts the statistics of media sources relevant to a
media stream within the reporting section that belongs to that media
stream.
The __global__ format only lists the numeric SSRC identifiers relevant to a
media stream within its own section, and puts the actual statistics in a
global section, indexed by the SSRC identifiers.
The __full__ format combines both of the above, resulting in a duplication
of all statistics and therefore a significant increase in message size.
The current default is __full__ as this is the legacy format, and is
required by some controlling agents.
- __\-\-rtcp-interval=__*INT*
Delay in milliseconds between RTCP packets when generate-rtcp flag is on. The

@ -157,6 +157,7 @@ recording-method = proc
# mqtt-publish-scope = media
# mos = CQ
# ssrc-reporting = inline
# poller-per-thread = false
# io-uring = false
# socket-cpu-affinity = -1

@ -222,7 +222,8 @@ enum endpoint_learning {
X(dtls_signature) \
X(use_audio_player) \
X(mqtt_publish_scope) \
X(mos)
X(mos) \
X(ssrc_reporting) \
struct rtpengine_config {
rwlock_t keyspaces_lock;
@ -305,6 +306,12 @@ RTPE_CONFIG_CHARPP_PARAMS
MOS_CQ = 0,
MOS_LQ,
} mos;
enum {
SRP_FULL = 0x0, // none disabled
SRP_INLINE = 0x1, // global (0x1) disabled - shall become the default in a future version
SRP_GLOBAL = 0x2, // inline (0x2) disabled
SRP_NONE = 0x3, // both disabled
} ssrc_reporting;
};

Loading…
Cancel
Save