Ignore:
Timestamp:
Sep 14, 2006 6:51:01 PM (18 years ago)
Author:
bennylp
Message:

Fix the local IP address resolution issue in PJSIP, PJMEDIA, and PJSUA, by adding a new API pj_gethostip() to resolve the default local IP address of local host. This new function will work even when local hostname resolution is not set correctly, by detecting the default IP interface in the system.

Also fix compile warnings in iLBC.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia/transport_udp.c

    r705 r721  
    246246    /* If address is 0.0.0.0, use host's IP address */ 
    247247    if (tp->rtp_addr_name.sin_addr.s_addr == 0) { 
    248         pj_hostent he; 
    249         const pj_str_t *hostname = pj_gethostname(); 
    250         status = pj_gethostbyname(hostname, &he); 
    251         if (status != PJ_SUCCESS) { 
     248        pj_in_addr hostip; 
     249 
     250        status = pj_gethostip(&hostip); 
     251        if (status != PJ_SUCCESS) 
    252252            goto on_error; 
    253         } 
    254         tp->rtp_addr_name.sin_addr = *(pj_in_addr*)he.h_addr; 
     253 
     254        tp->rtp_addr_name.sin_addr = hostip; 
    255255    } 
    256256 
Note: See TracChangeset for help on using the changeset viewer.