Ignore:
Timestamp:
Dec 20, 2007 11:23:07 AM (16 years ago)
Author:
bennylp
Message:

Related to Ticket #429: when bind address is specified and public address is not, the bind address should be used as the public address (thanks Arie Velthoen)

File:
1 edited

Legend:

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

    r1621 r1636  
    13001300        pj_bzero(p_pub_addr, sizeof(pj_sockaddr)); 
    13011301 
    1302         status = pj_gethostip(af, p_pub_addr); 
    1303         if (status != PJ_SUCCESS) { 
    1304             pjsua_perror(THIS_FILE, "Unable to get local host IP", status); 
    1305             pj_sock_close(sock); 
    1306             return status; 
     1302        if (pj_sockaddr_has_addr(&bind_addr)) { 
     1303            pj_sockaddr_copy_addr(p_pub_addr, &bind_addr); 
     1304        } else { 
     1305            status = pj_gethostip(af, p_pub_addr); 
     1306            if (status != PJ_SUCCESS) { 
     1307                pjsua_perror(THIS_FILE, "Unable to get local host IP", status); 
     1308                pj_sock_close(sock); 
     1309                return status; 
     1310            } 
    13071311        } 
    13081312 
Note: See TracChangeset for help on using the changeset viewer.