Commit 9f8401e5 authored by jehan's avatar jehan

fix inter proxy communication

git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@129 3f6dc0c8-ddfe-455d-9043-3cd528dc4637
parent 061d5908
......@@ -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<Boolean> {
......
......@@ -73,11 +73,13 @@ public class SuperPeerProxy implements SipProxy, RegistrationHandler {
//need to found the right proxy
try {
List<P2pUserRegistrationAdvertisement> lAdvList = (List<P2pUserRegistrationAdvertisement>) 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
......
......@@ -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);
......
......@@ -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");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment