diff --git a/src/switch_core_media.c b/src/switch_core_media.c index 1c7c369474..f6e7b32b39 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -3442,6 +3442,12 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s reneg = 0; } + if (sdp_type == SDP_TYPE_RESPONSE && smh->num_negotiated_codecs) { + /* response to re-invite or update, only negotiated codecs are valid */ + reneg = 0; + } + + if (!reneg && smh->num_negotiated_codecs) { codec_array = smh->negotiated_codecs; total_codecs = smh->num_negotiated_codecs; @@ -8002,6 +8008,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_receive_message(switch_core_se a_engine->codec_negotiated = 0; v_engine->codec_negotiated = 0; + smh->num_negotiated_codecs = 0; switch_channel_clear_flag(session->channel, CF_VIDEO_POSSIBLE); switch_core_media_prepare_codecs(session, SWITCH_TRUE); switch_core_media_check_video_codecs(session);