Ignore:
Timestamp:
Apr 2, 2007 11:30:14 AM (17 years ago)
Author:
bennylp
Message:

ICE: work in progress

File:
1 edited

Legend:

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

    r1114 r1126  
    6666 
    6767/* Utility: print error */ 
    68 #if PJ_LOG_MAX_LEVEL >= 3 
    69 static void ice_st_perror(pj_ice_strans *ice_st, const char *title,  
    70                           pj_status_t status) 
    71 { 
    72     char errmsg[PJ_ERR_MSG_SIZE]; 
    73  
    74     pj_strerror(status, errmsg, sizeof(errmsg)); 
    75     PJ_LOG(3,(ice_st->obj_name, "%s: %s", title, errmsg)); 
    76 } 
    77 #else 
    78 #   define ice_st_perror(ice_st, title, status) 
    79 #endif 
    80  
     68#define ice_st_perror(ice_st,msg,rc) pjnath_perror(ice_st->obj_name,msg,rc) 
    8169 
    8270/*  
     
    345333            pj_sockaddr_in cand_addr; 
    346334            pj_bool_t set_default; 
     335            pj_uint16_t local_pref; 
    347336 
    348337            /* Ignore 127.0.0.0/24 address */ 
     
    359348            if (ifs[i].s_addr == comp->local_addr.ipv4.sin_addr.s_addr) { 
    360349                set_default = PJ_TRUE; 
     350                local_pref = 65535; 
    361351            } else { 
    362352                set_default = PJ_FALSE; 
     353                local_pref = 0; 
    363354            } 
    364355 
    365356            status = add_cand(ice_st, comp, comp_id,  
    366357                              PJ_ICE_CAND_TYPE_HOST,  
    367                               (pj_uint16_t)(65535-i), &cand_addr, 
    368                               set_default); 
     358                              local_pref, &cand_addr, set_default); 
    369359            if (status != PJ_SUCCESS) 
    370360                goto on_error; 
     
    760750    unsigned i; 
    761751    pj_ice_sess_cb ice_cb; 
     752    const pj_uint8_t srflx_prio[4] = { 100, 126, 110, 0 }; 
    762753 
    763754    /* Check arguments */ 
     
    783774    /* Associate user data */ 
    784775    ice_st->ice->user_data = (void*)ice_st; 
     776 
     777    /* If default candidate for components are SRFLX one, upload a custom 
     778     * type priority to ICE session so that SRFLX candidates will get 
     779     * checked first. 
     780     */ 
     781    if (ice_st->comp[0]->default_cand >= 0 && 
     782        ice_st->comp[0]->cand_list[ice_st->comp[0]->default_cand].type  
     783            == PJ_ICE_CAND_TYPE_SRFLX) 
     784    { 
     785        pj_ice_sess_set_prefs(ice_st->ice, srflx_prio); 
     786    } 
     787 
    785788 
    786789    /* Add candidates */ 
Note: See TracChangeset for help on using the changeset viewer.