From 2419ab671e6dab9b57efd2d0ab4b5039641b6699 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 15 Nov 2016 17:42:36 -0600 Subject: [PATCH] FS-9699 regression --- src/mod/endpoints/mod_sofia/sofia.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 004b3620c6..f5cb429ae6 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -7638,12 +7638,19 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, } - switch_core_media_gen_local_sdp(session, SDP_TYPE_RESPONSE, NULL, 0, NULL, 1); + switch_core_media_gen_local_sdp(session, SDP_TYPE_RESPONSE, NULL, 0, NULL, + zstr(tech_pvt->mparams.local_sdp_str) && !switch_channel_test_flag(channel, CF_PROXY_MODE)); - nua_respond(tech_pvt->nh, SIP_200_OK, - NUTAG_MEDIA_ENABLE(0), - SIPTAG_CONTACT_STR(tech_pvt->profile->url), - SIPTAG_CONTENT_TYPE_STR("application/sdp"), SIPTAG_PAYLOAD_STR(tech_pvt->mparams.local_sdp_str), TAG_END()); + + if (zstr(tech_pvt->mparams.local_sdp_str)) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Cannot find a SDP\n"); + switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER); + } else { + nua_respond(tech_pvt->nh, SIP_200_OK, + NUTAG_MEDIA_ENABLE(0), + SIPTAG_CONTACT_STR(tech_pvt->profile->url), + SIPTAG_CONTENT_TYPE_STR("application/sdp"), SIPTAG_PAYLOAD_STR(tech_pvt->mparams.local_sdp_str), TAG_END()); + } goto done;