Changeset 5634


Ignore:
Timestamp:
Jul 28, 2017 9:43:57 AM (7 years ago)
Author:
nanang
Message:

Fix #2033: ICE must use regular nomination when communicating with lite implementations.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia/transport_ice.c

    r5604 r5634  
    10931093 
    10941094    /* Detect our role */ 
    1095     if (current_ice_role==PJ_ICE_SESS_ROLE_CONTROLLING) { 
     1095    if (pjmedia_sdp_attr_find(rem_sdp->attr_count, rem_sdp->attr, 
     1096                              &STR_ICE_LITE, NULL) != NULL) 
     1097    { 
     1098        /* Remote is ICE lite, set our role as controlling */ 
    10961099        sdp_state->local_role = PJ_ICE_SESS_ROLE_CONTROLLING; 
    10971100    } else { 
    1098         if (pjmedia_sdp_attr_find(rem_sdp->attr_count, rem_sdp->attr, 
    1099                                   &STR_ICE_LITE, NULL) != NULL) 
    1100         { 
    1101             /* Remote is ICE Lite */ 
     1101        if (current_ice_role==PJ_ICE_SESS_ROLE_CONTROLLING) { 
    11021102            sdp_state->local_role = PJ_ICE_SESS_ROLE_CONTROLLING; 
    11031103        } else { 
     
    15871587        } 
    15881588 
    1589  
    15901589        /* start ICE */ 
     1590    } 
     1591 
     1592    /* RFC 5245 section 8.1.1: 
     1593     * If its peer has a lite implementation, an agent MUST use 
     1594     * a regular nomination algorithm. 
     1595     */ 
     1596    if (pjmedia_sdp_attr_find(rem_sdp->attr_count, rem_sdp->attr, 
     1597                              &STR_ICE_LITE, NULL) != NULL) 
     1598    { 
     1599        pj_ice_sess_options opt; 
     1600        pj_ice_strans_get_options(tp_ice->ice_st, &opt); 
     1601        if (opt.aggressive) { 
     1602            opt.aggressive = PJ_FALSE; 
     1603            pj_ice_strans_set_options(tp_ice->ice_st, &opt); 
     1604            PJ_LOG(4,(tp_ice->base.name, "Forcefully set ICE to use regular " 
     1605                      "nomination as remote is lite implementation")); 
     1606        } 
    15911607    } 
    15921608 
Note: See TracChangeset for help on using the changeset viewer.