Ignore:
Timestamp:
Dec 20, 2007 11:23:07 AM (12 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_media.c

    r1625 r1636  
    347347 
    348348        } else { 
    349             pj_sockaddr addr; 
    350  
    351             /* Get local IP address. */ 
    352             status = pj_gethostip(pj_AF_INET(), &addr); 
    353             if (status != PJ_SUCCESS) 
    354                 goto on_error; 
     349 
     350            if (bound_addr.sin_addr.s_addr == 0) { 
     351                pj_sockaddr addr; 
     352 
     353                /* Get local IP address. */ 
     354                status = pj_gethostip(pj_AF_INET(), &addr); 
     355                if (status != PJ_SUCCESS) 
     356                    goto on_error; 
     357 
     358                bound_addr.sin_addr.s_addr = addr.ipv4.sin_addr.s_addr; 
     359            } 
    355360 
    356361            for (i=0; i<2; ++i) { 
    357362                pj_sockaddr_in_init(&mapped_addr[i], NULL, 0); 
    358                 mapped_addr[i].sin_addr.s_addr = addr.ipv4.sin_addr.s_addr; 
     363                mapped_addr[i].sin_addr.s_addr = bound_addr.sin_addr.s_addr; 
    359364            } 
    360365 
Note: See TracChangeset for help on using the changeset viewer.