From 994c439df8e33967de377cd99cb6256eefdeee22 Mon Sep 17 00:00:00 2001 From: "tanish.jadhav" Date: Thu, 22 Feb 2024 16:39:58 +0530 Subject: [PATCH 1/2] Fix #2383: [switch_core_media] Fix audio mode when SDP has recvonly in Session Attribute(a) instead of Media Attribute(a) #comment The switch_core_media_negotiate_sdp function was setting the media_audio_mode to sendonly when the SDP had a recvonly attribute, regardless of the current media mode. This caused one-way audio issues when renegotiating SDP while unhold. This patch adds an extra check to avoid overriding the existing media mode. --- src/switch_core_media.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/switch_core_media.c b/src/switch_core_media.c index 58ef94a53e..386b4314b5 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -5279,7 +5279,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s switch_channel_set_variable(session->channel, "media_audio_mode", "recvonly"); } else if (sendonly < 2 && !strcasecmp(attr->a_name, "inactive")) { switch_channel_set_variable(session->channel, "media_audio_mode", "inactive"); - } else if (!strcasecmp(attr->a_name, "recvonly")) { + } else if (!strcasecmp(attr->a_name, "recvonly") && m->m_mode != SWITCH_MEDIA_FLOW_RECVONLY;) { switch_channel_set_variable(session->channel, "media_audio_mode", "sendonly"); recvonly = 1; From 6255098d788ef2f5c132d32bbd92ac622a3afb2d Mon Sep 17 00:00:00 2001 From: "tanish.jadhav" Date: Thu, 22 Feb 2024 16:52:17 +0530 Subject: [PATCH 2/2] typo fix --- src/switch_core_media.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/switch_core_media.c b/src/switch_core_media.c index 386b4314b5..5f4615cf0f 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -5279,7 +5279,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s switch_channel_set_variable(session->channel, "media_audio_mode", "recvonly"); } else if (sendonly < 2 && !strcasecmp(attr->a_name, "inactive")) { switch_channel_set_variable(session->channel, "media_audio_mode", "inactive"); - } else if (!strcasecmp(attr->a_name, "recvonly") && m->m_mode != SWITCH_MEDIA_FLOW_RECVONLY;) { + } else if (!strcasecmp(attr->a_name, "recvonly") && m->m_mode != SWITCH_MEDIA_FLOW_RECVONLY) { switch_channel_set_variable(session->channel, "media_audio_mode", "sendonly"); recvonly = 1;