Changeset 18:9f805b075575 in mediastreamer2
- Timestamp:
- Sep 17, 2008 11:39:48 AM (5 years ago)
- Branch:
- default
- Location:
- p2pproxy/src/org/linphone/p2pproxy/core
- Files:
-
- 2 added
- 1 deleted
- 4 edited
-
MessageDispatcher.java (modified) (1 diff)
-
NetworkResources.java (deleted)
-
media/jxtaudpproxy/SdpProcessorImpl.java (modified) (3 diffs)
-
sipproxy/JxtaSipProxy.java (modified) (4 diffs)
-
sipproxy/NetworkResources.java (added)
-
sipproxy/RegistrationHandler.java (added)
-
sipproxy/SipProxyRegistrar.java (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
p2pproxy/src/org/linphone/p2pproxy/core/MessageDispatcher.java
r0 r18 47 47 } 48 48 } 49 synchronized void addPipeMsgListener(PipeMsgListener aPipeMsgListener) {49 public synchronized void addPipeMsgListener(PipeMsgListener aPipeMsgListener) { 50 50 mPipeMsgListenerList.add(aPipeMsgListener); 51 51 } -
p2pproxy/src/org/linphone/p2pproxy/core/media/jxtaudpproxy/SdpProcessorImpl.java
r16 r18 31 31 import org.linphone.p2pproxy.core.Configurator; 32 32 33 import org.linphone.p2pproxy.core. NetworkResources;33 import org.linphone.p2pproxy.core.sipproxy.NetworkResources; 34 34 import org.linphone.p2pproxy.core.sipproxy.SdpProcessor; 35 35 import org.linphone.p2pproxy.core.sipproxy.SipProxyRegistrar; … … 165 165 String lMLineName = lMediaDescriptor.getMedia().getMedia(); 166 166 RtpSessionImpl lRtpSession = null; 167 if ( lRegistration.NetResources.hasRtpSession(lMLineName) == false) {167 if (((NetworkResources) lRegistration.NetResources).hasRtpSession(lMLineName) == false) { 168 168 // first time, just create 169 169 int lPortStart = Integer.parseInt(mProperties.getProperty(SipProxyRegistrar.UDP_MEDIA_RELAY_PORT_START, "15000")); 170 170 lRtpSession = new RtpSessionImpl (lPortStart,lMLineName); 171 lRegistration.NetResources.putRtpSession(lMLineName, lRtpSession);171 ((NetworkResources) lRegistration.NetResources).putRtpSession(lMLineName, lRtpSession); 172 172 } else { 173 lRtpSession = lRegistration.NetResources.getRtpSession(lMLineName);173 lRtpSession = ((NetworkResources) lRegistration.NetResources).getRtpSession(lMLineName); 174 174 } 175 175 if (aRemotePipe != null) { … … 178 178 179 179 } 180 return lRegistration.NetResources;180 return (NetworkResources) lRegistration.NetResources; 181 181 }catch (Exception e) { 182 182 throw new P2pProxyException(e); -
p2pproxy/src/org/linphone/p2pproxy/core/sipproxy/JxtaSipProxy.java
r17 r18 23 23 import java.util.Map; 24 24 25 import net.jxta.discovery.DiscoveryService; 25 26 import net.jxta.document.Advertisement; 26 27 import net.jxta.endpoint.MessageElement; … … 38 39 import org.linphone.p2pproxy.core.P2pProxyAdvertisementNotFoundException; 39 40 import org.linphone.p2pproxy.core.media.rtprelay.SdpProcessorImpl; 41 import org.linphone.p2pproxy.core.sipproxy.SipProxyRegistrar.Registration; 40 42 import org.zoolu.sip.address.NameAddress; 41 43 import org.zoolu.sip.address.SipURL; … … 47 49 import org.zoolu.sip.transaction.TransactionServer; 48 50 49 public class JxtaSipProxy implements SipProxy, PipeMsgListener {51 public class JxtaSipProxy implements SipProxy, PipeMsgListener,RegistrationHandler { 50 52 private final JxtaNetworkManager mJxtaNetworkManager; 51 53 private final Map<String,SipProxyRegistrar.Registration> mRegistrationTab; … … 212 214 // 213 215 } 214 216 public void updateRegistration(Registration aRegistration, Message aRegistrationMessage) throws P2pProxyException { 217 try { 218 if (aRegistration.NetResources == null) { 219 // new registration, create pipe 220 NetworkResources lRegistration = new NetworkResources(aRegistration.From,mJxtaNetworkManager); 221 aRegistration.NetResources = lRegistration; 222 lRegistration.addPipeMsgListener(this); 223 } 224 225 ((NetworkResources) aRegistration.NetResources).publish(aRegistration.Expiration); 226 } catch (Exception e) { 227 throw new P2pProxyException(e); 228 } 229 215 230 } 231 232 } -
p2pproxy/src/org/linphone/p2pproxy/core/sipproxy/SipProxyRegistrar.java
r17 r18 47 47 import org.linphone.p2pproxy.core.Configurator; 48 48 import org.linphone.p2pproxy.core.JxtaNetworkManager; 49 import org.linphone.p2pproxy.core.NetworkResources;50 49 import org.linphone.p2pproxy.core.P2pProxyAccountManagementMBean; 51 50 import org.linphone.p2pproxy.core.P2pProxyAdvertisementNotFoundException; … … 94 93 long RegistrationDate; 95 94 long Expiration; 96 public NetworkResources NetResources; 95 //implementation specific context 96 public Object NetResources; 97 97 public Map<MediaType,InetSocketAddress> RtpRelays = new HashMap<MediaType,InetSocketAddress>() ; 98 98 String Contact; … … 275 275 private void updateRegistration(Registration aRegistration, Message aRegistrationMessage) throws IOException { 276 276 aRegistration.RegistrationDate = System.currentTimeMillis(); 277 // default registration period e277 // default registration period 278 278 aRegistration.Expiration = 3600000; 279 279 if (aRegistrationMessage.getExpiresHeader() != null ) { … … 281 281 } 282 282 283 if (aRegistration.NetResources == null) { 284 // new registration, create pipe 285 aRegistration.NetResources = new NetworkResources(aRegistration.From,mJxtaNetworkManager); 286 aRegistration.NetResources.addPipeMsgListener(this); 287 } 288 289 aRegistration.NetResources.publish(aRegistration.Expiration); 283 //TODO handle registration 290 284 } 291 285
Note: See TracChangeset
for help on using the changeset viewer.
