MT#55283 Report the fixed egress SSRC in `query`

The SSRC only appears in the response to the offer or answer that picked it.
The `egress SSRCs` list fills in after the first forwarded packet, so a query
at signalling time returns nothing.

Report the value as its own per-media key. It is set when the offer is
processed, so it can be read before media flows.

Closes #2171

Change-Id: I738d702ab13fd71b56269960bce16994ddb3c8a0
pull/2173/head
dnygate 6 days ago committed by Richard Fuchs
parent ad2dca04c4
commit 25ac052c35

@ -961,6 +961,11 @@ static void ng_stats_media(ng_command_ctx_t *ctx, parser_arg list, const struct
if (rtp_pt)
parser->dict_add_str_dup(dict, "codec", &rtp_pt->encoding_with_params);
/* available right away, unlike the `egress SSRCs` list below, which only
* fills in once a packet has been forwarded */
if (m->fixed_egress_ssrc)
parser->dict_add_int(dict, "fixed egress SSRC", m->fixed_egress_ssrc);
streams = parser->dict_add_list(dict, "streams");
flags = parser->dict_add_list(dict, "flags");

@ -1385,6 +1385,8 @@ Spaces in each string may be replaced by hyphens.
its own SSRC mid-call is still forwarded under the same one, with the
sequence numbering carried across the change.
The same values are reported per media in the `query` response.
Intended for feeding media into a system that has to bind a receiver to an
SSRC up front, such as a WebRTC selective forwarding unit.
@ -2050,6 +2052,12 @@ The response dictionary contains the following keys:
If the protocol is recognized by *rtpengine*, this string contains it.
Usually `RTP/AVP` or `RTP/SAVPF`.
+ `fixed egress SSRC`
The SSRC used for all RTP sent towards this media, if the
`fixed egress SSRC` flag was given. Reported as soon as the flag
takes effect, before any media has been forwarded.
+ `flags`
A list of strings containing various status flags. Contains zero of more

@ -78,6 +78,16 @@ a=rtcp:PORT
SDP
# the same values are reported per media by `query`, before any media has flowed
$resp = rtpe_req('query', 'egress SSRC in query', { 'call-id' => cid() });
is $resp->{tags}{tt()}{medias}[0]{'fixed egress SSRC'}, $egress,
'query reports the fixed egress SSRC facing the answerer';
ok(($resp->{tags}{ft()}{medias}[0]{'fixed egress SSRC'} // 0) > 0,
'query reports a fixed egress SSRC facing the offerer as well');
# RTP towards the answerer carries the reported SSRC, not the one the sender used
snd($sock_a, $port_b, rtp(8, 1000, 3000, 0x1234, "\x00" x 160));

Loading…
Cancel
Save