Skip to content

Commit

Permalink
MT#58535 rtpp_flags: add support for generic 'rtcp-mux-*'
Browse files Browse the repository at this point in the history
Add generic parsing for 'rtcp-mux-*' flags in
`call_ng_flags_flags()`.

Additionally add tests for:
- rtcp-mux
- SDES
- T.38

Change-Id: I675a9de455fa87a8dfdc4453e010141cee2f294d
  • Loading branch information
zenichev committed Apr 4, 2024
1 parent 09f129f commit f695e77
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 3 deletions.
3 changes: 3 additions & 0 deletions daemon/call_interfaces.c
Original file line number Diff line number Diff line change
Expand Up @@ -1196,6 +1196,9 @@ void call_ng_flags_flags(sdp_ng_flags *out, str *s, helper_arg dummy) {
/* replacing SDP body parts */
if (call_ng_flags_prefix(out, s, "replace-", call_ng_flags_replace, NULL))
return;
/* rtcp-mux */
if (call_ng_flags_prefix(out, s, "rtcp-mux-", call_ng_flags_rtcp_mux, NULL))
return;

/* codec manipulations */
{
Expand Down
4 changes: 1 addition & 3 deletions daemon/control_ng_flags_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,11 +267,9 @@ void parse_rtpp_flags(const str * rtpp_flags, bencode_buffer_t * buf,
if (!get_key_val(&key, &val, start, &eptr))
break;

/* check for items which have their own sub-list */
/* specific received-from parsing */
if (parse_received_from(&key, &val, buf, out, opmode))
{
goto next;
}

/* codecs have own specific parsing as well */
if (parse_codecs(opmode, out, buf, &key, &val))
Expand Down
106 changes: 106 additions & 0 deletions t/auto-daemon-tests-rtpp-flags.pl
Original file line number Diff line number Diff line change
Expand Up @@ -196,4 +196,110 @@
a=rtcp:PORT
SDP

new_call;

offer('remove rtcp-mux support',
{ 'rtpp-flags' => 'rtcp-mux-demux replace-origin replace-session-connection strict-source label=caller OSRTP-accept address-family=IP4 transport-protocol=RTP/AVP' }, <<SDP);
v=0
o=- 1545997027 1 IN IP4 198.51.100.1
s=tester
t=0 0
c=IN IP4 198.51.100.1
m=audio 4024 RTP/AVP 0
a=rtcp-mux
a=inactive
----------------------------------
v=0
o=- 1545997027 1 IN IP4 203.0.113.1
s=tester
t=0 0
c=IN IP4 203.0.113.1
m=audio PORT RTP/AVP 0
a=rtpmap:0 PCMU/8000
a=inactive
a=rtcp:PORT
SDP

new_call;

offer('SDES only allowed crypto suites, but not offered',
{ 'rtpp-flags' => 'SDES-only-AES_CM_128_HMAC_SHA1_80 ICE=remove DTLS=off replace-origin replace-session-connection strict-source label=caller address-family=IP4 transport-protocol=RTP/SAVP' }, <<SDP);
v=0
o=- 1545997027 1 IN IP4 198.51.100.1
s=tester
t=0 0
m=audio 2000 RTP/SAVP 0
c=IN IP4 198.51.100.1
a=sendrecv
a=crypto:1 AES_CM_128_HMAC_SHA1_32 inline:cJOJ7kxQjhFBp2fP6AYjs3vKw7CeBdWZCj0isbJv
a=crypto:2 AES_256_CM_HMAC_SHA1_80 inline:8AbZePWwsKhLGX3GlXA+yHYPQ3cgraer/9DkFJYCOPZZy3o9wC0NIbIFYZfyHw==
a=crypto:3 AES_256_CM_HMAC_SHA1_32 inline:2GLk3p/csdno4KlGO1TxCVaEt+bifmDlQ5NjnCb5cJYPURiGRSTBEtEq37db8g==
----------------------------------
v=0
o=- 1545997027 1 IN IP4 203.0.113.1
s=tester
t=0 0
m=audio PORT RTP/SAVP 0
c=IN IP4 203.0.113.1
a=rtpmap:0 PCMU/8000
a=sendrecv
a=rtcp:PORT
a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:CRYPTO128
SDP

answer('SDES only allowed crypto suites, but not offered',
{ 'rtpp-flags' => 'ICE=remove replace-origin replace-session-connection strict-source label=callee address-family=IP4 transport-protocol=RTP/SAVP' }, <<SDP);
v=0
o=- 1545997027 1 IN IP4 198.51.100.3
s=tester
t=0 0
m=audio 2002 RTP/SAVP 0
c=IN IP4 198.51.100.3
a=sendrecv
a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:dfgadgdfgdfgdfgd6AYjs3vKw7CeBdWZCj0isbJv
--------------------------------------
v=0
o=- 1545997027 1 IN IP4 203.0.113.1
s=tester
t=0 0
m=audio PORT RTP/SAVP 0
c=IN IP4 203.0.113.1
a=rtpmap:0 PCMU/8000
a=sendrecv
a=rtcp:PORT
a=crypto:1 AES_CM_128_HMAC_SHA1_32 inline:CRYPTO128
SDP


new_call();

offer('forward T.38 invite without codecs given',
{ 'rtpp-flags' => 'T.38-decode ICE=remove DTLS=off replace-origin replace-session-connection strict-source label=caller address-family=IP4 transport-protocol=RTP/AVP' }, <<SDP);
v=0
o=- 1545997027 1 IN IP4 198.51.100.1
s=tester
t=0 0
m=image 6000 udptl t38
c=IN IP4 198.51.100.1
a=sendrecv
a=T38FaxVersion:0
a=T38MaxBitRate:14400
a=T38FaxRateManagement:transferredTCF
a=T38FaxMaxBuffer:262
a=T38FaxMaxDatagram:300
a=T38FaxUdpEC:t38UDPRedundancy
----------------------------------
v=0
o=- 1545997027 1 IN IP4 203.0.113.1
s=tester
t=0 0
m=audio PORT RTP/AVP 0 8
c=IN IP4 203.0.113.1
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=sendrecv
a=rtcp:PORT
SDP

#done_testing;NGCP::Rtpengine::AutoTest::terminate('f00');exit;
done_testing();

0 comments on commit f695e77

Please sign in to comment.