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/pjsip/sip_transport_tcp.c

    r635 r721  
    250250     */ 
    251251    if (listener_addr->sin_addr.s_addr == 0) { 
    252         const pj_str_t *hostname; 
    253         struct pj_hostent he; 
    254  
    255         hostname = pj_gethostname(); 
    256         status = pj_gethostbyname(hostname, &he); 
     252        pj_in_addr hostip; 
     253 
     254        status = pj_gethostip(&hostip); 
    257255        if (status != PJ_SUCCESS) 
    258256            goto on_error; 
    259257 
    260         listener_addr->sin_addr = *(pj_in_addr*)he.h_addr; 
     258        listener_addr->sin_addr = hostip; 
    261259    } 
    262260 
Note: See TracChangeset for help on using the changeset viewer.