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/pjsip/src/pjsua-lib/pjsua_core.c

    r690 r721  
    813813    } else { 
    814814 
    815         const pj_str_t *hostname = pj_gethostname(); 
    816         struct pj_hostent he; 
    817  
    818         status = pj_gethostbyname(hostname, &he); 
     815        pj_bzero(p_pub_addr, sizeof(pj_sockaddr_in)); 
     816 
     817        status = pj_gethostip(&p_pub_addr->sin_addr); 
    819818        if (status != PJ_SUCCESS) { 
    820             pjsua_perror(THIS_FILE, "Unable to resolve local host", status); 
    821819            pj_sock_close(sock); 
    822820            return status; 
    823821        } 
    824822 
    825         pj_bzero(p_pub_addr, sizeof(pj_sockaddr_in)); 
    826823        p_pub_addr->sin_family = PJ_AF_INET; 
    827824        p_pub_addr->sin_port = pj_htons((pj_uint16_t)port); 
    828         p_pub_addr->sin_addr = *(pj_in_addr*)he.h_addr; 
    829825    } 
    830826 
Note: See TracChangeset for help on using the changeset viewer.