Changeset 124:36b6d7d9ba1d in mediastreamer2
- Timestamp:
- Oct 28, 2008 10:03:49 PM (5 years ago)
- Branch:
- default
- Location:
- p2pproxy/src/org/linphone/p2pproxy/core/sipproxy
- Files:
-
- 4 edited
-
SipProxyRegistrar.java (modified) (3 diffs)
-
superpeers/JxtaNetworkResources.java (modified) (1 diff)
-
superpeers/P2pUserRegistrationAdvertisement.java (modified) (1 diff)
-
superpeers/SuperPeerProxy.java (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
p2pproxy/src/org/linphone/p2pproxy/core/sipproxy/SipProxyRegistrar.java
r108 r124 25 25 import java.io.IOException; 26 26 import java.net.InetSocketAddress; 27 import java.util.Collection; 27 28 import java.util.HashMap; 28 29 import java.util.Map; … … 82 83 private long mNumberOfUnknownUsersForRegistration; 83 84 private long mNumberOfUnRegistration; 85 84 86 85 87 public static class Registration { … … 191 193 }; 192 194 mTimer.scheduleAtFixedRate(lPublisherTask, 0, ADV_LIFE_TIME-ADV_LIFE_TIME/10); 195 TimerTask lRegistrationTableGC = new TimerTask() { 196 197 @Override 198 public void run() { 199 // copy list 200 Collection<Registration> lCurrentRegistrations = mRegistrationTab.values(); 201 long lCurrentDate = System.currentTimeMillis(); 202 for (Registration lRegistration : lCurrentRegistrations) { 203 if ((lCurrentDate - lRegistration.RegistrationDate - lRegistration.Expiration) > 0) { 204 if (mLog.isInfoEnabled()) mLog.info("registration entry ["+lRegistration+"] has expired"); 205 mRegistrationTab.remove(lRegistration.From); 206 } 207 } 208 } 209 210 }; 211 mTimer.scheduleAtFixedRate(lRegistrationTableGC, 0, 60000); 193 212 194 213 } -
p2pproxy/src/org/linphone/p2pproxy/core/sipproxy/superpeers/JxtaNetworkResources.java
r60 r124 59 59 throw new P2pProxyException(e1); 60 60 } 61 mLog. debug("publishing P2pUserRegistration Advertisement ["+mP2pUserRegistrationAdvertisement+"]published expire ["+aLiveTime+"]");61 mLog.info("publishing P2pUserRegistration Advertisement ["+mP2pUserRegistrationAdvertisement+"]published expire ["+aLiveTime+"]"); 62 62 } 63 63 -
p2pproxy/src/org/linphone/p2pproxy/core/sipproxy/superpeers/P2pUserRegistrationAdvertisement.java
r20 r124 100 100 private String mUserUri; 101 101 public final static String REGISTRAR_ADDRESS_TAG = "registrar-address"; 102 public final static String USER_NAME_TAG = " user-name";102 public final static String USER_NAME_TAG = "registration-user-name"; 103 103 private final static String ID_TAG = "ID"; 104 104 private final static String[] mIndexs = {USER_NAME_TAG}; -
p2pproxy/src/org/linphone/p2pproxy/core/sipproxy/superpeers/SuperPeerProxy.java
r108 r124 20 20 package org.linphone.p2pproxy.core.sipproxy.superpeers; 21 21 22 import java.io.IOException; 23 import java.util.List; 22 24 import java.util.Map; 23 25 … … 27 29 import org.linphone.p2pproxy.api.P2pProxyUserNotFoundException; 28 30 import org.linphone.p2pproxy.core.JxtaNetworkManager; 31 import org.linphone.p2pproxy.core.P2pProxyAdvertisementNotFoundException; 29 32 import org.linphone.p2pproxy.core.sipproxy.RegistrationHandler; 30 33 import org.linphone.p2pproxy.core.sipproxy.SipProxy; … … 67 70 lNextHope = new SipURL(mRegistrationTab.get(lTo).Contact); 68 71 } else { 69 throw new P2pProxyUserNotFoundException("user ["+lTo+"] not found"); 72 if (aMessage.isInvite() || aMessage.isCancel()) { 73 //need to found the right proxy 74 try { 75 List<P2pUserRegistrationAdvertisement> lAdvList = (List<P2pUserRegistrationAdvertisement>) mJxtaNetworkManager.getAdvertisementList(null, P2pUserRegistrationAdvertisement.USER_NAME_TAG,lTo, true); 76 lNextHope = new SipURL(lAdvList.get(0).getUserName()); 77 } catch (Exception e) { 78 throw new P2pProxyUserNotFoundException("user ["+lTo+"] not found",e); 79 } 80 81 } 70 82 } 71 83 }
Note: See TracChangeset
for help on using the changeset viewer.
