]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix typo with some flags related to jingle
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 25 Jun 2013 19:54:29 +0000 (14:54 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Tue, 25 Jun 2013 19:54:34 +0000 (14:54 -0500)
src/switch_rtp.c

index 433c44aabaee317b34c86b313880b5eb232b63c6..9a02479e3522832186c70ea231a4486ce4b499fa 100644 (file)
@@ -786,19 +786,19 @@ static void handle_ice(switch_rtp_t *rtp_session, switch_rtp_ice_t *ice, void *d
 
 
        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 {
@@ -840,10 +840,10 @@ static void handle_ice(switch_rtp_t *rtp_session, switch_rtp_ice_t *ice, void *d
                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);
@@ -997,7 +997,7 @@ static void handle_ice(switch_rtp_t *rtp_session, switch_rtp_ice_t *ice, void *d
                        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));
                        }