From eaca798979feb8440bfb60d3a210b7340499e3e4 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 11 Dec 2018 20:10:02 +0000 Subject: [PATCH] [core] add orig session check --- src/switch_core_media.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/switch_core_media.c b/src/switch_core_media.c index 011851686f..5e73a32862 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -10341,6 +10341,13 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess switch_core_session_get_partner(session, &orig_session); + if (orig_session) { + switch_core_media_set_smode(smh->session, SWITCH_MEDIA_TYPE_AUDIO, + switch_core_session_remote_media_flow(orig_session, SWITCH_MEDIA_TYPE_AUDIO), sdp_type); + switch_core_media_set_smode(smh->session, SWITCH_MEDIA_TYPE_VIDEO, + switch_core_session_remote_media_flow(orig_session, SWITCH_MEDIA_TYPE_VIDEO), sdp_type); + } + for (i = 0; i < smh->mparams->num_codecs; i++) { const switch_codec_implementation_t *imp = smh->codecs[i]; switch_payload_t orig_pt = 0;