From 6eab3ca9710af2000429f35754cbba02a1873520 Mon Sep 17 00:00:00 2001 From: Donat Zenichev Date: Wed, 21 Jan 2026 11:09:22 +0100 Subject: [PATCH] MT#64278 AmRtpStream: optionally don't generate direciton Introduce a config option to skip generating the direction paramter in case when SEMS generates local SDP offer or answer. Change-Id: Ifcba27cd6ad0070bead182d60ad3dc5ee57b41bc --- core/AmConfig.cpp | 6 ++++++ core/AmConfig.h | 2 ++ core/AmRtpStream.cpp | 7 ++++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/core/AmConfig.cpp b/core/AmConfig.cpp index f6fb3adc..472a1358 100644 --- a/core/AmConfig.cpp +++ b/core/AmConfig.cpp @@ -106,6 +106,8 @@ bool AmConfig::LogSessions = false; bool AmConfig::LogEvents = false; int AmConfig::UnhandledReplyLoglevel = 0; +bool AmConfig::SkipGenerateDirectionBoth = false; + #ifdef WITH_ZRTP bool AmConfig::enable_zrtp = true; bool AmConfig::enable_zrtp_debuglog = true; @@ -406,6 +408,10 @@ int AmConfig::readConfiguration() ForceSymmetricRtp = (cfg.getParameter("force_symmetric_rtp") == "yes"); } + if(cfg.hasParameter("skip_generate_direction_both")) { + SkipGenerateDirectionBoth = (cfg.getParameter("skip_generate_direction_both") == "yes"); + } + if(cfg.hasParameter("sip_nat_handling")) { SipNATHandling = (cfg.getParameter("sip_nat_handling") == "yes"); } diff --git a/core/AmConfig.h b/core/AmConfig.h index 548b57b1..b32e97f0 100644 --- a/core/AmConfig.h +++ b/core/AmConfig.h @@ -206,6 +206,8 @@ struct AmConfig static bool SingleCodecInOK; static vector CodecOrder; + static bool SkipGenerateDirectionBoth; + enum ApplicationSelector { App_RURIUSER, App_RURIPARAM, diff --git a/core/AmRtpStream.cpp b/core/AmRtpStream.cpp index 2673d70d..30652ce2 100644 --- a/core/AmRtpStream.cpp +++ b/core/AmRtpStream.cpp @@ -385,9 +385,14 @@ void AmRtpStream::getSdp(SdpMedia& m) m.nports = 0; m.send = !hold; m.recv = receiving; - m.dir = SdpMedia::DirBoth; m.type = MT_AUDIO; + // direction + if (AmConfig::SkipGenerateDirectionBoth) + m.dir = SdpMedia::DirUndefined; + else + m.dir = SdpMedia::DirBoth; + // get Transport description if (rtp_transport) rtp_transport->getDescription(m);