Changeset 2599


Ignore:
Timestamp:
Apr 15, 2009 1:36:55 PM (15 years ago)
Author:
bennylp
Message:

More ticket #780: updated ICE to issue CreatePermission? on the TURN socket before starting ICE negotiation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjnath/src/pjnath/ice_strans.c

    r2484 r2599  
    901901        return status; 
    902902 
     903    /* If we have TURN candidate, now is the time to create the permissions */ 
     904    if (ice_st->comp[0]->turn_sock) { 
     905        unsigned i; 
     906 
     907        for (i=0; i<ice_st->comp_cnt; ++i) { 
     908            pj_ice_strans_comp *comp = ice_st->comp[i]; 
     909            pj_sockaddr addrs[PJ_ICE_ST_MAX_CAND]; 
     910            unsigned j, count=0; 
     911 
     912            /* Gather remote addresses for this component */ 
     913            for (j=0; j<rem_cand_cnt && count<PJ_ARRAY_SIZE(addrs); ++j) { 
     914                if (rem_cand[j].comp_id==i+1) { 
     915                    pj_memcpy(&addrs[count++], &rem_cand[j].addr, 
     916                              pj_sockaddr_get_len(&rem_cand[j].addr)); 
     917                } 
     918            } 
     919 
     920            if (count) { 
     921                status = pj_turn_sock_set_perm(comp->turn_sock, count,  
     922                                               addrs, 0); 
     923                if (status != PJ_SUCCESS) { 
     924                    pj_ice_strans_stop_ice(ice_st); 
     925                    return status; 
     926                } 
     927            } 
     928        } 
     929    } 
     930 
    903931    /* Start ICE negotiation! */ 
    904932    status = pj_ice_sess_start_check(ice_st->ice); 
    905933    if (status != PJ_SUCCESS) { 
    906934        pj_ice_strans_stop_ice(ice_st); 
     935        return status; 
    907936    } 
    908937 
     
    10611090 
    10621091                    if (check->lcand->transport_id == TP_TURN) { 
     1092                        /* Activate channel binding for the remote address 
     1093                         * for more efficient data transfer using TURN. 
     1094                         */ 
     1095                        status = pj_turn_sock_bind_channel( 
     1096                                        ice_st->comp[i]->turn_sock, 
     1097                                        &check->rcand->addr, 
     1098                                        sizeof(check->rcand->addr)); 
     1099 
    10631100                        /* Disable logging for Send/Data indications */ 
    10641101                        PJ_LOG(5,(ice_st->obj_name,  
Note: See TracChangeset for help on using the changeset viewer.