Commit 76fbbf98 authored by jehan's avatar jehan

fix compilation issue

git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@25 3f6dc0c8-ddfe-455d-9043-3cd528dc4637
parent d9fdab37
......@@ -166,7 +166,7 @@ public class SdpProcessorImpl implements SdpProcessor {
RtpSessionImpl lRtpSession = null;
if (((NetworkResources) lRegistration.NetResources).hasRtpSession(lMLineName) == false) {
// first time, just create
int lPortStart = Integer.parseInt(mProperties.getProperty(SipProxyRegistrar.UDP_MEDIA_RELAY_PORT_START, "15000"));
int lPortStart = 15000;
lRtpSession = new RtpSessionImpl (lPortStart,lMLineName);
((NetworkResources) lRegistration.NetResources).putRtpSession(lMLineName, lRtpSession);
} else {
......
......@@ -50,6 +50,7 @@ import org.linphone.p2pproxy.core.P2pProxyAccountManagementMBean;
import org.linphone.p2pproxy.core.P2pProxyAdvertisementNotFoundException;
import org.linphone.p2pproxy.core.media.rtprelay.MediaType;
import org.linphone.p2pproxy.core.media.rtprelay.SdpProcessorImpl;
import org.linphone.p2pproxy.core.sipproxy.superpeers.SuperPeerProxy;
import org.zoolu.sip.address.NameAddress;
import org.zoolu.sip.address.SipURL;
import org.zoolu.sip.header.ExpiresHeader;
......@@ -67,9 +68,8 @@ import org.zoolu.sip.transaction.TransactionServer;
public class SipProxyRegistrar implements SipProviderListener,SipProxyRegistrarMBean {
private final static Logger mLog = Logger.getLogger(SipProxyRegistrar.class);
public final static String REGISTRAR_PORT="org.linphone.p2pproxy.SipListener.registrar.port";
public final static String UDP_PORT_BEGING="org.linphone.p2pproxy.udp.port.begin";
public final static String UDP_MEDIA_RELAY_PORT_START="org.linphone.p2pproxy.udp-media-relay.port.start";
public final static String REGISTRAR_PUBLIC_ADDRESS="org.linphone.p2pproxy.SipListener.registrar.public.address";
//
private final SipProvider mProvider;
private final JxtaNetworkManager mJxtaNetworkManager;
......@@ -80,6 +80,7 @@ public class SipProxyRegistrar implements SipProviderListener,SipProxyRegistrarM
private final P2pProxyAccountManagementMBean mP2pProxyAccountManagement;
private final Configurator mProperties;
private final SuperPeerProxy mSuperPeerProxy;
//private long mNumberOfEstablishedCall;
private long mNumberOfRefusedRegistration;
......@@ -178,12 +179,13 @@ public class SipProxyRegistrar implements SipProviderListener,SipProxyRegistrarM
mProperties = lProperties;
File lFile = new File(SipStack.log_path);
if (lFile.exists() == false) lFile.mkdir();
String lViaAddress = lProperties.getProperty(REGISTRAR_PUBLIC_ADDRESS);
int lPort = Integer.parseInt(lProperties.getProperty(REGISTRAR_PORT, "5060"));
String[] lProto = {SipProvider.PROTO_UDP};
mProvider=new SipProvider(null,lPort,lProto,SipProvider.ALL_INTERFACES);
mProvider=new SipProvider(lViaAddress,lPort,lProto,SipProvider.ALL_INTERFACES);
mProvider.addSipProviderListener(SipProvider.PROMISQUE,this);
mPool = Executors.newCachedThreadPool();
mSuperPeerProxy = new SuperPeerProxy(aJxtaNetworkManager, "sip:"+mProvider.getViaAddress()+":"+mProvider.getPort());
}
public synchronized void onReceivedMessage(SipProvider aProvider, Message aMessage) {
......@@ -272,7 +274,7 @@ public class SipProxyRegistrar implements SipProviderListener,SipProxyRegistrarM
lTransactionServer.respondWith(lresp);
}
private void updateRegistration(Registration aRegistration, Message aRegistrationMessage) throws IOException {
private void updateRegistration(Registration aRegistration, Message aRegistrationMessage) throws P2pProxyException {
aRegistration.RegistrationDate = System.currentTimeMillis();
// default registration period
aRegistration.Expiration = 3600000;
......@@ -280,7 +282,7 @@ public class SipProxyRegistrar implements SipProviderListener,SipProxyRegistrarM
aRegistration.Expiration = aRegistrationMessage.getExpiresHeader().getDeltaSeconds()*1000;
}
//TODO handle registration
mSuperPeerProxy.updateRegistration(aRegistration, aRegistrationMessage);
}
......
......@@ -29,7 +29,7 @@ import org.apache.log4j.Logger;
import org.linphone.p2pproxy.api.P2pProxyException;
import org.linphone.p2pproxy.core.JxtaNetworkManager;
import org.linphone.p2pproxy.core.P2pUserProfileAdvertisement;
import org.zoolu.sip.address.SipURL;
public class JxtaNetworkResources {
private final JxtaNetworkManager mJxtaNetworkManager;
......@@ -43,6 +43,7 @@ public class JxtaNetworkResources {
mP2pUserRegistrationAdvertisement.setID(IDFactory.newCodatID(mJxtaNetworkManager.getPeerGroup().getPeerGroupID(), aUserName.toString().getBytes()));
mP2pUserRegistrationAdvertisement.setUserName(aUserName.toString());
mP2pUserRegistrationAdvertisement.setRegistrarAddress(aRegistrarAddress.toString());
mLog.info("creating network resource for user ["+aUserName+"] on registrar ["+aRegistrarAddress+"]");
}
void publish(long aLiveTime) throws P2pProxyException {
......@@ -57,7 +58,7 @@ public class JxtaNetworkResources {
} catch (IOException e1) {
throw new P2pProxyException(e1);
}
mLog.debug("publishing P2pUserRegistration Advertisement published expire ["+aLiveTime+"]");
mLog.debug("publishing P2pUserRegistration Advertisement ["+mP2pUserRegistrationAdvertisement+"]published expire ["+aLiveTime+"]");
}
}
......@@ -32,7 +32,7 @@ public class SuperPeerProxy implements SipProxy, RegistrationHandler {
private final JxtaNetworkManager mJxtaNetworkManager;
private final String mRegistrarAddress;
SuperPeerProxy(JxtaNetworkManager aJxtaNetworkManager, String aRegistrarAddress) {
public SuperPeerProxy(JxtaNetworkManager aJxtaNetworkManager, String aRegistrarAddress) {
mJxtaNetworkManager = aJxtaNetworkManager;
mRegistrarAddress = aRegistrarAddress;
}
......
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