Ignore:
Timestamp:
Aug 9, 2012 5:21:25 AM (12 years ago)
Author:
nanang
Message:

Close #1567: Added option to use STUN2 format for resolving mapped address in pjsua_config.

File:
1 edited

Legend:

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

    r4219 r4224  
    19231923 
    19241924    } else if (stun_srv.slen) { 
     1925        pjstun_setting stun_opt; 
     1926 
    19251927        /* 
    19261928         * STUN is specified, resolve the address with STUN. 
     
    19321934        } 
    19331935 
    1934         status = pjstun_get_mapped_addr(&pjsua_var.cp.factory, 1, &sock, 
    1935                                          &stun_srv, pj_ntohs(pjsua_var.stun_srv.ipv4.sin_port), 
    1936                                          &stun_srv, pj_ntohs(pjsua_var.stun_srv.ipv4.sin_port), 
    1937                                          &p_pub_addr->ipv4); 
     1936        pj_bzero(&stun_opt, sizeof(stun_opt)); 
     1937        stun_opt.use_stun2 = pjsua_var.ua_cfg.stun_map_use_stun2; 
     1938        stun_opt.srv1  = stun_opt.srv2  = stun_srv; 
     1939        stun_opt.port1 = stun_opt.port2 =  
     1940                         pj_ntohs(pjsua_var.stun_srv.ipv4.sin_port); 
     1941        status = pjstun_get_mapped_addr2(&pjsua_var.cp.factory, &stun_opt, 
     1942                                         1, &sock, &p_pub_addr->ipv4); 
    19381943        if (status != PJ_SUCCESS) { 
    19391944            pjsua_perror(THIS_FILE, "Error contacting STUN server", status); 
Note: See TracChangeset for help on using the changeset viewer.