diff --git a/p2pproxy/Makefile.am b/p2pproxy/Makefile.am
index fb4500f02..aaa51ae78 100644
--- a/p2pproxy/Makefile.am
+++ b/p2pproxy/Makefile.am
@@ -3,10 +3,10 @@ EXTRA_DIST=dependencies dependencies-src src test-src
SUBDIRS=launcher plugin-src
ALL_JARS= \
- antbuild/dist/p2pproxy_0.1/bcprov-jdk14.jar antbuild/dist/p2pproxy_0.1/log4j.jar \
- antbuild/dist/p2pproxy_0.1/javax.servlet.jar antbuild/dist/p2pproxy_0.1/org.mortbay.jetty.jar \
- antbuild/dist/p2pproxy_0.1/jstun-0.7.0.jar antbuild/dist/p2pproxy_0.1/p2pproxy.jar \
- antbuild/dist/p2pproxy_0.1/junit-4.3.1.jar antbuild/dist/p2pproxy_0.1/sip.jar
+ $(top_builddir)/antbuild/dist/p2pproxy_0.1/bcprov-jdk14.jar $(top_builddir)/antbuild/dist/p2pproxy_0.1/log4j.jar \
+ $(top_builddir)/antbuild/dist/p2pproxy_0.1/javax.servlet.jar $(top_builddir)/antbuild/dist/p2pproxy_0.1/org.mortbay.jetty.jar \
+ $(top_builddir)/antbuild/dist/p2pproxy_0.1/jstun-0.7.0.jar $(top_builddir)/antbuild/dist/p2pproxy_0.1/p2pproxy.jar \
+ $(top_builddir)/antbuild/dist/p2pproxy_0.1/junit-4.3.1.jar $(top_builddir)/antbuild/dist/p2pproxy_0.1/sip.jar
$(ALL_JARS): src/org/linphone/p2pproxy/*/*.java
$(ANT) dist
diff --git a/p2pproxy/build.xml b/p2pproxy/build.xml
index 76a4c0fb7..02d3a759f 100644
--- a/p2pproxy/build.xml
+++ b/p2pproxy/build.xml
@@ -34,7 +34,7 @@
-
+
@@ -66,13 +66,13 @@
-
+
-
+
@@ -160,7 +160,7 @@
-
+
diff --git a/p2pproxy/configure.ac b/p2pproxy/configure.ac
index 5d290f7a1..94f8d420f 100644
--- a/p2pproxy/configure.ac
+++ b/p2pproxy/configure.ac
@@ -46,6 +46,8 @@ AC_SUBST(javadir)
AC_PATH_PROG(ANT,ant,false)
+AC_PATH_PROG(SWIG,swig,false)
+
if test x$ANT = xfalse ; then
AC_MSG_ERROR([ant not found: you must install ant to build this package.])
fi
diff --git a/p2pproxy/launcher/src/p2pproxy.c b/p2pproxy/launcher/src/p2pproxy.c
index a383806c7..224ad443f 100644
--- a/p2pproxy/launcher/src/p2pproxy.c
+++ b/p2pproxy/launcher/src/p2pproxy.c
@@ -20,6 +20,7 @@ JavaVM *p2pproxy_application_jvm = 0;
jint lResult = 0 ;\
JNIEnv *lJniEnv = 0;\
jclass lMainClass = 0;\
+ if (p2pproxy_application_jvm==0) return P2PPROXY_ERROR_APPLICATION_NOT_STARTED; \
lResult = (*p2pproxy_application_jvm)->AttachCurrentThread(p2pproxy_application_jvm,(void**)&lJniEnv,NULL);\
if (lResult != 0) { \
fprintf(stderr,"cannot attach VM\n");\
@@ -176,7 +177,6 @@ int p2pproxy_resourcemgt_revoke_sip_proxy(const char* proxy_uri) {
int p2pproxy_application_get_state() {
jmethodID stateMethod;
GET_JNI_ENV
-
stateMethod = (*lJniEnv)->GetStaticMethodID(lJniEnv, lMainClass, "getState", "()I");
lResult = (*lJniEnv)->CallStaticIntMethod(lJniEnv, lMainClass, stateMethod);
(*p2pproxy_application_jvm)->DetachCurrentThread(p2pproxy_application_jvm);
diff --git a/p2pproxy/plugin-src/fonis.c b/p2pproxy/plugin-src/fonis.c
index a35228e45..dd207c55b 100644
--- a/p2pproxy/plugin-src/fonis.c
+++ b/p2pproxy/plugin-src/fonis.c
@@ -40,8 +40,11 @@ static bool_t fonis_init(void){
if (!initd){
ms_thread_create(&fonis_thread,NULL,fonis_thread_func,NULL);
initd=TRUE;
+ while( p2pproxy_application_get_state()==P2PPROXY_ERROR_APPLICATION_NOT_STARTED){
+ usleep(200000);
+ ms_message("Waiting for p2pproxy to start");
+ }
}
- sleep(4);
return TRUE;
}