From 200199e05f9a89feaed2b18108f3518d5175c644 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Wed, 22 Apr 2015 10:04:23 -0500 Subject: [PATCH] CID:1023990: remove unused code --- src/mod/endpoints/mod_sofia/sofia.c | 18 ------- src/switch_core_media.c | 81 ----------------------------- 2 files changed, 99 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 78a0b58646..230f3789be 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -5932,24 +5932,6 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status } } -#if 0 - if (status == 200 && switch_channel_test_flag(channel, CF_PROXY_MEDIA) && - sip->sip_payload && sip->sip_payload->pl_data && !strcasecmp(tech_pvt->iananame, "PROXY")) { - switch_core_session_t *other_session; - - switch_core_media_proxy_codec(session, sip->sip_payload->pl_data); - - if (switch_core_session_get_partner(session, &other_session) == SWITCH_STATUS_SUCCESS) { - if (switch_core_session_compare(session, other_session)) { - switch_core_media_proxy_codec(other_session, sip->sip_payload->pl_data); - } - switch_core_session_rwunlock(other_session); - } - } -#endif - - - if ((status == 180 || status == 183 || status > 199)) { const char *vval; diff --git a/src/switch_core_media.c b/src/switch_core_media.c index 886e84fa92..a5672dd21d 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -9557,87 +9557,6 @@ SWITCH_DECLARE(void) switch_core_media_check_outgoing_proxy(switch_core_session_ } } -#ifdef _MSC_VER -/* remove this if the break is removed from the following for loop which causes unreachable code loop */ -/* for (m = sdp->sdp_media; m; m = m->m_next) { */ -#pragma warning(push) -#pragma warning(disable:4702) -#endif - -//? -SWITCH_DECLARE(void) switch_core_media_proxy_codec(switch_core_session_t *session, const char *r_sdp) -{ - sdp_media_t *m; - sdp_parser_t *parser = NULL; - sdp_session_t *sdp; - sdp_attribute_t *attr; - int ptime = 0, dptime = 0; - switch_rtp_engine_t *a_engine; - switch_media_handle_t *smh; - - switch_assert(session); - - if (!(smh = session->media_handle)) { - return; - } - - a_engine = &smh->engines[SWITCH_MEDIA_TYPE_AUDIO]; - - if (!(parser = sdp_parse(NULL, r_sdp, (int) strlen(r_sdp), 0))) { - return; - } - - if (!(sdp = sdp_session(parser))) { - sdp_parser_free(parser); - return; - } - - - for (attr = sdp->sdp_attributes; attr; attr = attr->a_next) { - if (zstr(attr->a_name)) { - continue; - } - - if (!strcasecmp(attr->a_name, "ptime")) { - dptime = atoi(attr->a_value); - } - } - - - for (m = sdp->sdp_media; m; m = m->m_next) { - - ptime = dptime; - //maxptime = dmaxptime; - - if (m->m_proto == sdp_proto_rtp) { - sdp_rtpmap_t *map; - for (attr = m->m_attributes; attr; attr = attr->a_next) { - if (!strcasecmp(attr->a_name, "ptime") && attr->a_value) { - ptime = atoi(attr->a_value); - } else if (!strcasecmp(attr->a_name, "maxptime") && attr->a_value) { - //maxptime = atoi(attr->a_value); - } - } - - for (map = m->m_rtpmaps; map; map = map->rm_next) { - a_engine->cur_payload_map->iananame = switch_core_session_strdup(session, map->rm_encoding); - a_engine->cur_payload_map->rm_rate = map->rm_rate; - a_engine->cur_payload_map->adv_rm_rate = map->rm_rate; - a_engine->cur_payload_map->codec_ms = ptime; - switch_core_media_set_codec(session, 0, smh->mparams->codec_flags); - break; - } - - break; - } - } - - sdp_parser_free(parser); - -} -#ifdef _MSC_VER -#pragma warning(pop) -#endif SWITCH_DECLARE (void) switch_core_media_recover_session(switch_core_session_t *session) {