From 42e52fd1d61a19cd8872bfc509e5ae19224164ae Mon Sep 17 00:00:00 2001 From: Morten Tryfoss Date: Mon, 2 Sep 2024 14:46:04 +0200 Subject: [PATCH] MT#55283 Reject OSRTP answer when not offered Closes #1854 Change-Id: I3020166b67005b0ecf7970104dbecb36885b021e --- daemon/call.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/daemon/call.c b/daemon/call.c index 1b818b66a..3dbd1437b 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -2359,8 +2359,12 @@ static void __update_media_protocol(struct call_media *media, struct call_media media->protocol = NULL; // reject } // pass through any other protocol change? - else if (!flags->protocol_accept) - ; + else if (!flags->protocol_accept) { + if (media->protocol && sp->protocol && !media->protocol->osrtp && sp->protocol->osrtp) { + ilog(LOG_WARNING, "Ignore OSRTP answer since this was not offered"); + other_media->protocol = media->protocol; + } + } else media->protocol = NULL; }