if (packet->header.type == SWITCH_STUN_BINDING_ERROR_RESPONSE) {
-
- if (ice->flips < 4) {
- if ((ice->type & ICE_CONTROLLED)) {
- switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_WARNING, "Changing role to CONTROLLING\n");
- ice->type &= ~ICE_CONTROLLED;
- ice->flips++;
- } else {
- switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_WARNING, "Changing role to CONTROLLED\n");
- ice->type |= ICE_CONTROLLED;
- ice->flips++;
+ if ((ice->type & ICE_VANILLA)) {
+ if (ice->flips < 4) {
+ if ((ice->type & ICE_CONTROLLED)) {
+ switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_WARNING, "Changing role to CONTROLLING\n");
+ ice->type &= ~ICE_CONTROLLED;
+ ice->flips++;
+ } else {
+ switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_WARNING, "Changing role to CONTROLLED\n");
+ ice->type |= ICE_CONTROLLED;
+ ice->flips++;
+ }
+ packet->header.type = SWITCH_STUN_BINDING_RESPONSE;
}
-
- packet->header.type = SWITCH_STUN_BINDING_RESPONSE;
}
} else {
xlen += 4 + switch_stun_attribute_padded_length(attr);
} while (xlen <= packet->header.length);
- if (ice->type == ICE_GOOGLE_JINGLE && ok) {
+ if ((ice->type && ICE_GOOGLE_JINGLE) && ok) {
ok = !strcmp(ice->user_ice, username);
}
-
+
if ((ice->type & ICE_VANILLA)) {
char foo1[13] = "", foo2[13] = "";
if (!ok) ok = !strncmp(packet->header.id, ice->last_sent_id, 12);
memset(stunbuf, 0, sizeof(stunbuf));
rpacket = switch_stun_packet_build_header(SWITCH_STUN_BINDING_RESPONSE, packet->header.id, stunbuf);
- if (ice->type == ICE_GOOGLE_JINGLE) {
+ if ((ice->type && ICE_GOOGLE_JINGLE)) {
switch_stun_packet_attribute_add_username(rpacket, username, (uint16_t)strlen(username));
}