Changeset 1126 for pjproject/trunk/pjnath/src/pjnath/ice_strans.c
- Timestamp:
- Apr 2, 2007 11:30:14 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjnath/src/pjnath/ice_strans.c
r1114 r1126 66 66 67 67 /* 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) 81 69 82 70 /* … … 345 333 pj_sockaddr_in cand_addr; 346 334 pj_bool_t set_default; 335 pj_uint16_t local_pref; 347 336 348 337 /* Ignore 127.0.0.0/24 address */ … … 359 348 if (ifs[i].s_addr == comp->local_addr.ipv4.sin_addr.s_addr) { 360 349 set_default = PJ_TRUE; 350 local_pref = 65535; 361 351 } else { 362 352 set_default = PJ_FALSE; 353 local_pref = 0; 363 354 } 364 355 365 356 status = add_cand(ice_st, comp, comp_id, 366 357 PJ_ICE_CAND_TYPE_HOST, 367 (pj_uint16_t)(65535-i), &cand_addr, 368 set_default); 358 local_pref, &cand_addr, set_default); 369 359 if (status != PJ_SUCCESS) 370 360 goto on_error; … … 760 750 unsigned i; 761 751 pj_ice_sess_cb ice_cb; 752 const pj_uint8_t srflx_prio[4] = { 100, 126, 110, 0 }; 762 753 763 754 /* Check arguments */ … … 783 774 /* Associate user data */ 784 775 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 785 788 786 789 /* Add candidates */
Note: See TracChangeset
for help on using the changeset viewer.