only negotiate codecs that were previously negotiated on re-invites unless its intentional to change codecs

This commit is contained in:
Anthony Minessale 2014-12-11 13:22:43 -06:00 committed by Brian West
parent 06c241a233
commit be0e09bd7f
1 changed files with 7 additions and 0 deletions

View File

@ -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);