diff --git a/p2pproxy/src/org/linphone/p2pproxy/core/sipproxy/SipProxyRegistrar.java b/p2pproxy/src/org/linphone/p2pproxy/core/sipproxy/SipProxyRegistrar.java index 4195e485d..d8fa8b815 100644 --- a/p2pproxy/src/org/linphone/p2pproxy/core/sipproxy/SipProxyRegistrar.java +++ b/p2pproxy/src/org/linphone/p2pproxy/core/sipproxy/SipProxyRegistrar.java @@ -93,6 +93,9 @@ public class SipProxyRegistrar implements SipProviderListener,SipProxyRegistrarM public String Contact; public final String From; public Registration(String aFrom) {From = aFrom;} + public String toString() { + return "reg date ["+RegistrationDate+"] exp ["+Expiration+"] contact ["+Contact+"] from ["+From+"]"; + } } class SipMessageTask implements Callable { diff --git a/p2pproxy/src/org/linphone/p2pproxy/core/sipproxy/superpeers/SuperPeerProxy.java b/p2pproxy/src/org/linphone/p2pproxy/core/sipproxy/superpeers/SuperPeerProxy.java index b20485e84..fd68158cb 100644 --- a/p2pproxy/src/org/linphone/p2pproxy/core/sipproxy/superpeers/SuperPeerProxy.java +++ b/p2pproxy/src/org/linphone/p2pproxy/core/sipproxy/superpeers/SuperPeerProxy.java @@ -73,11 +73,13 @@ public class SuperPeerProxy implements SipProxy, RegistrationHandler { //need to found the right proxy try { List lAdvList = (List) mJxtaNetworkManager.getAdvertisementList(null, P2pUserRegistrationAdvertisement.USER_NAME_TAG,lTo, true); - lNextHope = new SipURL(lAdvList.get(0).getUserName()); + lNextHope = new SipURL(lAdvList.get(0).getRegistrarAddress()); } catch (Exception e) { throw new P2pProxyUserNotFoundException("user ["+lTo+"] not found",e); } + } else { + //nop } } } @@ -93,7 +95,8 @@ public class SuperPeerProxy implements SipProxy, RegistrationHandler { MultipleHeader lMultipleRoute = aMessage.getRoutes(); if (lMultipleRoute != null && lMultipleRoute.isEmpty()== false) { - lNextHope = ((RecordRouteHeader)lMultipleRoute.getTop()).getNameAddress().getAddress(); + RouteHeader lRouteHeader = new RouteHeader(lMultipleRoute.getTop()); + lNextHope = lRouteHeader.getNameAddress().getAddress(); } else { // last proxy, get route from request uri //check if we know the user diff --git a/p2pproxy/test-src/org/linphone/p2pproxy/test/utils/SipClient.java b/p2pproxy/test-src/org/linphone/p2pproxy/test/utils/SipClient.java index 01086a263..371ddbc93 100644 --- a/p2pproxy/test-src/org/linphone/p2pproxy/test/utils/SipClient.java +++ b/p2pproxy/test-src/org/linphone/p2pproxy/test/utils/SipClient.java @@ -69,7 +69,7 @@ public class SipClient { register(expiration,aTo, 200); } public boolean register(int expiration,String aTo,final int aReturnCode) throws InterruptedException { - final long TryingTimout = 1000; + final long TryingTimout = 2000; NameAddress lContact = new NameAddress(getContact(mProvider)); NameAddress lT0 = new NameAddress(aTo); diff --git a/p2pproxy/test-src/org/linphone/p2pproxy/test/utils/UserInstance.java b/p2pproxy/test-src/org/linphone/p2pproxy/test/utils/UserInstance.java index 3ad02d452..051ebd0e8 100644 --- a/p2pproxy/test-src/org/linphone/p2pproxy/test/utils/UserInstance.java +++ b/p2pproxy/test-src/org/linphone/p2pproxy/test/utils/UserInstance.java @@ -51,7 +51,7 @@ public UserInstance(final String userName,final String aPreferedProxyUri) throws int lSipPort = lSocket.getLocalPort(); lSocket.close(); URI lUserNameUri = URI.create(userName); - final String[] lParam = {"-jxta" ,"userinstance-"+lUserNameUri.getUserInfo() + final String[] lParam = {"-jxta" ,"userinstance-"+lUserNameUri.getSchemeSpecificPart() ,"-edge-only" ,"-seeding-rdv", "tcp://82.67.74.86:9701" ,"-seeding-relay", "tcp://82.67.74.86:9701"}; @@ -73,7 +73,7 @@ public UserInstance(final String userName,final String aPreferedProxyUri) throws throw new P2pProxyException("Cannot connect to fonis network"); } P2pProxyMain.createAccount(userName); - SipStack.log_path = "userinstance-"+lUserNameUri.getUserInfo()+"/logs"; + SipStack.log_path = "userinstance-"+lUserNameUri.getSchemeSpecificPart()+"/logs"; File lFile = new File(SipStack.log_path); if (lFile.exists() == false) lFile.mkdir(); //InetAddress[] lAddresses = InetAddress.getAllByName("localhost");