Changeset 5562
- Timestamp:
- Mar 3, 2017 2:11:02 AM (8 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjnath/include/pjnath/ice_strans.h
r5339 r5562 339 339 { 340 340 /** 341 * Warning: this field is deprecated and will be ignored. Please specify 342 * transport address family in STUN and TURN transport setting, i.e: 343 * \a stun_tp and \a turn_tp. 341 * The address family which will be used as the default address 342 * in the SDP offer. Setting this to pj_AF_UNSPEC() means that 343 * the address family will not be considered during the process 344 * of default candidate selection. 345 * 346 * The default value is pj_AF_INET() (IPv4). 344 347 */ 345 348 int af; -
pjproject/trunk/pjnath/src/pjnath/ice_strans.c
r5521 r5562 232 232 pj_bzero(cfg, sizeof(*cfg)); 233 233 234 cfg->af = pj_AF_INET(); 234 235 pj_stun_config_init(&cfg->stun_cfg, NULL, 0, NULL, NULL); 235 236 pj_ice_strans_stun_cfg_default(&cfg->stun); … … 346 347 if (comp->cand_list[i].type == PJ_ICE_CAND_TYPE_SRFLX) { 347 348 comp->default_cand = i; 348 break; 349 if (ice_st->cfg.af == pj_AF_UNSPEC() || 350 comp->cand_list[i].base_addr.addr.sa_family == 351 ice_st->cfg.af) 352 { 353 break; 354 } 349 355 } 350 356 } … … 548 554 549 555 /* Set default candidate to srflx */ 550 comp->default_cand = (unsigned)(cand - comp->cand_list); 556 if (comp->cand_list[comp->default_cand].type != PJ_ICE_CAND_TYPE_SRFLX 557 || (ice_st->cfg.af != pj_AF_UNSPEC() && 558 comp->cand_list[comp->default_cand].base_addr.addr.sa_family 559 != ice_st->cfg.af)) 560 { 561 comp->default_cand = (unsigned)(cand - comp->cand_list); 562 } 551 563 552 564 pj_log_pop_indent(); … … 639 651 cand->type, &cand->base_addr); 640 652 653 /* Set default candidate with the preferred default 654 * address family 655 */ 656 if (comp->ice_st->cfg.af != pj_AF_UNSPEC() && 657 comp->cand_list[comp->default_cand].addr.addr.sa_family != 658 ice_st->cfg.af) 659 { 660 comp->default_cand = (unsigned)(cand - comp->cand_list); 661 } 662 641 663 PJ_LOG(4,(ice_st->obj_name, 642 664 "Comp %d/%d: host candidate %s (tpid=%d) added", … … 2004 2026 2005 2027 /* Set default candidate to relay */ 2006 comp->default_cand = (unsigned)(cand - comp->cand_list); 2028 if (comp->cand_list[comp->default_cand].type!=PJ_ICE_CAND_TYPE_RELAYED 2029 || (comp->ice_st->cfg.af != pj_AF_UNSPEC() && 2030 comp->cand_list[comp->default_cand].addr.addr.sa_family 2031 != comp->ice_st->cfg.af)) 2032 { 2033 comp->default_cand = (unsigned)(cand - comp->cand_list); 2034 } 2007 2035 2008 2036 /* Prefer IPv4 relay as default candidate for better connectivity 2009 2037 * with IPv4 endpoints. 2010 2038 */ 2039 /* 2011 2040 if (cand->addr.addr.sa_family != pj_AF_INET()) { 2012 2041 for (i=0; i<comp->cand_cnt; ++i) { … … 2020 2049 } 2021 2050 } 2051 */ 2022 2052 2023 2053 PJ_LOG(4,(comp->ice_st->obj_name, -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
r5535 r5562 852 852 853 853 ice_cfg.opt = acc_cfg->ice_cfg.ice_opt; 854 855 if (call_med->call->async_call.rem_sdp) { 856 /* Match the default address family according to the offer */ 857 const pj_str_t ID_IP6 = { "IP6", 3}; 858 const pjmedia_sdp_media *m; 859 const pjmedia_sdp_conn *c; 860 861 m = call_med->call->async_call.rem_sdp->media[call_med->idx]; 862 c = m->conn? m->conn : call_med->call->async_call.rem_sdp->conn; 863 864 if (pj_stricmp(&c->addr_type, &ID_IP6) == 0) 865 ice_cfg.af = pj_AF_INET6(); 866 } else if (use_ipv6) { 867 ice_cfg.af = pj_AF_INET6(); 868 } 854 869 855 870 /* If STUN transport is configured, initialize STUN transport settings */
Note: See TracChangeset
for help on using the changeset viewer.