Skip to content

Commit

Permalink
MT#55283 add SDES-prefer option
Browse files Browse the repository at this point in the history
Change-Id: I8c90c68a2c1a093d0a017d1edb6cac9b2f0bc5a1
  • Loading branch information
rfuchs committed Nov 9, 2023
1 parent 96ae637 commit b265477
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
10 changes: 10 additions & 0 deletions daemon/call.c
Original file line number Diff line number Diff line change
Expand Up @@ -2104,6 +2104,16 @@ static void __dtls_logic(const struct sdp_ng_flags *flags,
&sp->sp_flags, SP_FLAG_SETUP_PASSIVE);

if (flags) {
/* Allow overriding preference of DTLS over SDES */
if ((flags->opmode == OP_OFFER || flags->opmode == OP_PUBLISH)
&& flags->sdes_prefer
&& MEDIA_ISSET(other_media, SDES))
{
MEDIA_CLEAR(other_media, DTLS);
MEDIA_CLEAR(other_media, SETUP_ACTIVE);
MEDIA_CLEAR(other_media, SETUP_PASSIVE);
}

/* Special case: if this is an offer and actpass is being offered (as it should),
* we would normally choose to be active. However, if this is a reinvite and we
* were passive previously, we should retain this role. */
Expand Down
4 changes: 4 additions & 0 deletions daemon/call_interfaces.c
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,10 @@ INLINE void ng_sdes_option(struct sdp_ng_flags *out, str *s, void *dummy) {
case CSH_LOOKUP("nonew"):
out->sdes_nonew = 1;
break;
case CSH_LOOKUP("prefer"):
case CSH_LOOKUP("priority"):
out->sdes_prefer = 1;
break;
default:
ilog(LOG_WARN, "Unknown 'SDES' flag encountered: '"STR_FORMAT"'",
STR_FMT(s));
Expand Down
8 changes: 8 additions & 0 deletions docs/ng_control_protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,14 @@ Optionally included keys are:
and instead leave the previously negotiated crypto suite in place. Only useful in
subsequent `answer` messages and ignored in `offer` messages.

- `prefer`

If an `offer` or `publish` contain both DTLS and SDES options, by
default *rtpengine* prefers DTLS over SDES and would end up accepting
DTLS. With this option set, in this scenario SDES would be preferred
and accepted, while DTLS would be rejected. Useful in combination with
`DTLS=off`.

* `supports`

Contains a list of strings. Each string indicates support for an additional feature
Expand Down
1 change: 1 addition & 0 deletions include/call_interfaces.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ struct sdp_ng_flags {
sdes_pad:1,
sdes_static:1,
sdes_nonew:1,
sdes_prefer:1,
drop_traffic_start:1,
drop_traffic_stop:1,
passthrough_on:1,
Expand Down

0 comments on commit b265477

Please sign in to comment.