This commit is contained in:
Anthony Minessale 2016-06-02 19:13:22 -05:00
parent 79229cdb8a
commit 46b9ace417

View File

@ -3342,10 +3342,10 @@ static switch_bool_t ip_possible(switch_media_handle_t *smh, const char *ip)
static switch_status_t check_ice(switch_media_handle_t *smh, switch_media_type_t type, sdp_session_t *sdp, sdp_media_t *m) static switch_status_t check_ice(switch_media_handle_t *smh, switch_media_type_t type, sdp_session_t *sdp, sdp_media_t *m)
{ {
switch_rtp_engine_t *engine = &smh->engines[type]; switch_rtp_engine_t *engine = &smh->engines[type];
sdp_attribute_t *attr; sdp_attribute_t *attr = NULL, *attrs[2] = { 0 };
int i = 0, got_rtcp_mux = 0; int i = 0, got_rtcp_mux = 0;
const char *val; const char *val;
int ice_seen = 0, cid = 0, ai = 0; int ice_seen = 0, cid = 0, ai = 0, attr_idx = 0, cand_seen = 0;
if (switch_true(switch_channel_get_variable_dup(smh->session->channel, "ignore_sdp_ice", SWITCH_FALSE, -1))) { if (switch_true(switch_channel_get_variable_dup(smh->session->channel, "ignore_sdp_ice", SWITCH_FALSE, -1))) {
return SWITCH_STATUS_BREAK; return SWITCH_STATUS_BREAK;
@ -3364,12 +3364,14 @@ static switch_status_t check_ice(switch_media_handle_t *smh, switch_media_type_t
engine->remote_ssrc = 0; engine->remote_ssrc = 0;
if (m) { if (m) {
attr = m->m_attributes; attrs[0] = m->m_attributes;
attrs[1] = sdp->sdp_attributes;
} else { } else {
attr = sdp->sdp_attributes; attrs[0] = sdp->sdp_attributes;
} }
for (; attr; attr = attr->a_next) { for (attr_idx = 0; attr_idx < 2 && !(ice_seen && cand_seen); attr_idx++) {
for (attr = attrs[attr_idx]; attr; attr = attr->a_next) {
char *data; char *data;
char *fields[15]; char *fields[15];
int argc = 0, j = 0; int argc = 0, j = 0;
@ -3514,9 +3516,11 @@ static switch_status_t check_ice(switch_media_handle_t *smh, switch_media_type_t
j += 2; j += 2;
} }
cand_seen++;
engine->ice_in.cand_idx[cid]++; engine->ice_in.cand_idx[cid]++;
} }
} }
}
if (!ice_seen) { if (!ice_seen) {
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;