Index: pjproject/trunk/pjsip-apps/build/Samples-vc.mak
===================================================================
--- pjproject/trunk/pjsip-apps/build/Samples-vc.mak	(revision 1604)
+++ pjproject/trunk/pjsip-apps/build/Samples-vc.mak	(revision 1605)
@@ -66,4 +66,5 @@
 	  $(BINDIR)\stateless_proxy.exe \
 	  $(BINDIR)\streamutil.exe \
+	  $(BINDIR)\strerror.exe \
 	  $(BINDIR)\tonegen.exe
 
Index: pjproject/trunk/pjsip-apps/build/Samples.mak
===================================================================
--- pjproject/trunk/pjsip-apps/build/Samples.mak	(revision 1604)
+++ pjproject/trunk/pjsip-apps/build/Samples.mak	(revision 1605)
@@ -30,4 +30,5 @@
 	   stateless_proxy \
 	   streamutil \
+	   strerror \
 	   tonegen
 
Index: pjproject/trunk/pjsip-apps/build/samples.dsp
===================================================================
--- pjproject/trunk/pjsip-apps/build/samples.dsp	(revision 1604)
+++ pjproject/trunk/pjsip-apps/build/samples.dsp	(revision 1605)
@@ -171,4 +171,8 @@
 # Begin Source File
 
+SOURCE=..\src\samples\strerror.c
+# End Source File
+# Begin Source File
+
 SOURCE=..\src\samples\tonegen.c
 # End Source File
Index: pjproject/trunk/pjsip-apps/build/samples.vcproj
===================================================================
--- pjproject/trunk/pjsip-apps/build/samples.vcproj	(revision 1604)
+++ pjproject/trunk/pjsip-apps/build/samples.vcproj	(revision 1605)
@@ -151,4 +151,8 @@
 			</File>
 			<File
+				RelativePath="..\src\samples\strerror.c"
+				>
+			</File>
+			<File
 				RelativePath="..\src\samples\tonegen.c"
 				>
Index: pjproject/trunk/pjsip-apps/src/samples/proxy.h
===================================================================
--- pjproject/trunk/pjsip-apps/src/samples/proxy.h	(revision 1604)
+++ pjproject/trunk/pjsip-apps/src/samples/proxy.h	(revision 1605)
@@ -236,6 +236,6 @@
 static pj_status_t init_proxy(void)
 {
-    pj_in_addr pri_addr;
-    pj_in_addr addr_list[16];
+    pj_sockaddr pri_addr;
+    pj_sockaddr addr_list[16];
     unsigned addr_cnt = PJ_ARRAY_SIZE(addr_list);
     unsigned i;
@@ -251,7 +251,7 @@
      * to be added in Record-Route.
      */
-    if (pj_gethostip(&pri_addr)==PJ_SUCCESS) {
+    if (pj_gethostip(pj_AF_INET(), &pri_addr)==PJ_SUCCESS) {
 	pj_strdup2(global.pool, &global.name[global.name_cnt].host,
-		   pj_inet_ntoa(pri_addr));
+		   pj_inet_ntoa(pri_addr.ipv4.sin_addr));
 	global.name[global.name_cnt].port = global.port;
 	global.name_cnt++;
@@ -259,12 +259,12 @@
 
     /* Get the rest of IP interfaces */
-    if (pj_enum_ip_interface(&addr_cnt, addr_list) == PJ_SUCCESS) {
+    if (pj_enum_ip_interface(pj_AF_INET(), &addr_cnt, addr_list) == PJ_SUCCESS) {
 	for (i=0; i<addr_cnt; ++i) {
 
-	    if (addr_list[i].s_addr == pri_addr.s_addr)
+	    if (addr_list[i].ipv4.sin_addr.s_addr == pri_addr.ipv4.sin_addr.s_addr)
 		continue;
 
 	    pj_strdup2(global.pool, &global.name[global.name_cnt].host,
-		       pj_inet_ntoa(addr_list[i]));
+		       pj_inet_ntoa(addr_list[i].ipv4.sin_addr));
 	    global.name[global.name_cnt].port = global.port;
 	    global.name_cnt++;
Index: pjproject/trunk/pjsip-apps/src/samples/strerror.c
===================================================================
--- pjproject/trunk/pjsip-apps/src/samples/strerror.c	(revision 1605)
+++ pjproject/trunk/pjsip-apps/src/samples/strerror.c	(revision 1605)
@@ -0,0 +1,70 @@
+/* $Id$ */
+/* 
+ * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
+ */
+
+/**
+ * \page page_strerror_c Samples: Print out error message
+ *
+ * This file is pjsip-apps/src/samples/strerror.c
+ *
+ * \includelineno strerror.c
+ */
+
+
+#include <pjlib.h>
+#include <pjlib-util.h>
+#include <pjsip.h>
+#include <pjmedia.h>
+#include <pjnath.h>
+#include <pjsip_simple.h>
+
+/*
+ * main()
+ */
+int main(int argc, char *argv[])
+{
+    pj_caching_pool cp;
+    pjmedia_endpt *med_ept;
+    pjsip_endpoint *sip_ept;
+    char errmsg[PJ_ERR_MSG_SIZE];
+    pj_status_t code;
+
+    if (argc != 2) {
+	puts("Usage: strerror ERRNUM");
+	return 1;
+    }
+
+    pj_log_set_level(3);
+
+    pj_init();
+    pj_caching_pool_init(&cp, NULL, 0);
+    pjlib_util_init();
+    pjnath_init();
+    pjmedia_endpt_create(&cp.factory, NULL, 0, &med_ept);
+    pjsip_endpt_create(&cp.factory, "localhost", &sip_ept);
+    pjsip_evsub_init_module(sip_ept);
+
+    code = atoi(argv[1]);
+    pj_strerror(code, errmsg, sizeof(errmsg));
+
+    printf("Status %d: %s\n", code, errmsg);
+
+    pj_shutdown();
+    return 0;
+}
+
