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.



git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@721 74dad513-b988-da41-8d7b-12977e46ad98
diff --git a/pjlib/include/pj/addr_resolv.h b/pjlib/include/pj/addr_resolv.h
index 3d75798..45194b3 100644
--- a/pjlib/include/pj/addr_resolv.h
+++ b/pjlib/include/pj/addr_resolv.h
@@ -21,10 +21,10 @@
 
 /**
  * @file addr_resolv.h
- * @brief Address resolve (pj_gethostbyname()).
+ * @brief IP address resolution.
  */
 
-#include <pj/types.h>
+#include <pj/sock.h>
 
 PJ_BEGIN_DECL
 
@@ -84,6 +84,17 @@
 PJ_DECL(pj_status_t) pj_gethostbyname(const pj_str_t *name, pj_hostent *he);
 
 
+/**
+ * Resolve the primary IP address of local host. 
+ *
+ * @param ip_addr   On successful resolution, this will be filled up with
+ *		    the host IP address, in network byte order.
+ *
+ * @return	    PJ_SUCCESS on success, or the appropriate error code.
+ */
+PJ_DECL(pj_status_t) pj_gethostip(pj_in_addr *ip_addr);
+
+
 /** @} */
 
 PJ_END_DECL