Ignore:
Timestamp:
Jul 25, 2018 11:56:39 PM (6 years ago)
Author:
ming
Message:

Fixed #2133: Skip IPv4 STUN resolution if account is using NAT64

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c

    r5833 r5839  
    11251125 
    11261126    /* Start resolving STUN server */ 
    1127     status = resolve_stun_server(PJ_FALSE, PJ_FALSE); 
     1127    status = resolve_stun_server(PJ_FALSE, PJ_FALSE, 0); 
    11281128    if (status != PJ_SUCCESS && status != PJ_EPENDING) { 
    11291129        pjsua_perror(THIS_FILE, "Error resolving STUN server", status); 
     
    14531453        pj_assert(sess->idx < sess->count); 
    14541454 
     1455        if (pjsua_var.ua_cfg.stun_try_ipv6 && 
     1456            pjsua_var.stun_opt != PJSUA_NAT64_DISABLED && 
     1457            sess->af == pj_AF_INET()) 
     1458        { 
     1459            /* Skip IPv4 STUN resolution if NAT64 is not disabled. */ 
     1460            continue; 
     1461        } 
     1462 
    14551463        pj_ansi_snprintf(target, sizeof(target), "%.*s", 
    14561464                         (int)sess->srv[sess->idx].slen, 
     
    15491557    PJSUA_UNLOCK(); 
    15501558     
    1551     status = resolve_stun_server(wait, PJ_FALSE); 
     1559    status = resolve_stun_server(wait, PJ_FALSE, 0); 
    15521560    if (wait == PJ_FALSE && status == PJ_EPENDING) 
    15531561        status = PJ_SUCCESS; 
     
    16931701 * Resolve STUN server. 
    16941702 */ 
    1695 pj_status_t resolve_stun_server(pj_bool_t wait, pj_bool_t retry_if_cur_error) 
    1696 { 
     1703pj_status_t resolve_stun_server(pj_bool_t wait, pj_bool_t retry_if_cur_error, 
     1704                                unsigned options) 
     1705{ 
     1706    pjsua_var.stun_opt = options; 
     1707 
    16971708    /* Retry resolving if currently the STUN status is error */ 
    16981709    if (pjsua_var.stun_status != PJ_EPENDING && 
     
    21952206 
    21962207    /* Make sure STUN server resolution has completed */ 
    2197     status = resolve_stun_server(PJ_TRUE, PJ_TRUE); 
     2208    status = resolve_stun_server(PJ_TRUE, PJ_TRUE, 0); 
    21982209    if (status != PJ_SUCCESS) { 
    21992210        pjsua_perror(THIS_FILE, "Error resolving STUN server", status); 
     
    31033114 
    31043115    /* Make sure STUN server resolution has completed */ 
    3105     status = resolve_stun_server(PJ_TRUE, PJ_TRUE); 
     3116    status = resolve_stun_server(PJ_TRUE, PJ_TRUE, 0); 
    31063117    if (status != PJ_SUCCESS) { 
    31073118        pjsua_var.nat_status = status; 
Note: See TracChangeset for help on using the changeset viewer.