Changeset 18:9f805b075575 in mediastreamer2


Ignore:
Timestamp:
Sep 17, 2008 11:39:48 AM (5 years ago)
Author:
jehan <jehan@…>
Branch:
default
Message:

extract legacy proxy to package sipproxy

git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@21 3f6dc0c8-ddfe-455d-9043-3cd528dc4637

Location:
p2pproxy/src/org/linphone/p2pproxy/core
Files:
2 added
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • p2pproxy/src/org/linphone/p2pproxy/core/MessageDispatcher.java

    r0 r18  
    4747                } 
    4848        } 
    49         synchronized void addPipeMsgListener(PipeMsgListener aPipeMsgListener) { 
     49        public synchronized void addPipeMsgListener(PipeMsgListener aPipeMsgListener) { 
    5050                mPipeMsgListenerList.add(aPipeMsgListener); 
    5151        } 
  • p2pproxy/src/org/linphone/p2pproxy/core/media/jxtaudpproxy/SdpProcessorImpl.java

    r16 r18  
    3131import org.linphone.p2pproxy.core.Configurator; 
    3232 
    33 import org.linphone.p2pproxy.core.NetworkResources; 
     33import org.linphone.p2pproxy.core.sipproxy.NetworkResources; 
    3434import org.linphone.p2pproxy.core.sipproxy.SdpProcessor; 
    3535import org.linphone.p2pproxy.core.sipproxy.SipProxyRegistrar; 
     
    165165            String lMLineName = lMediaDescriptor.getMedia().getMedia(); 
    166166            RtpSessionImpl lRtpSession = null; 
    167             if (lRegistration.NetResources.hasRtpSession(lMLineName) == false) { 
     167            if (((NetworkResources) lRegistration.NetResources).hasRtpSession(lMLineName) == false) { 
    168168               // first time, just create 
    169169               int lPortStart = Integer.parseInt(mProperties.getProperty(SipProxyRegistrar.UDP_MEDIA_RELAY_PORT_START, "15000")); 
    170170               lRtpSession = new RtpSessionImpl (lPortStart,lMLineName); 
    171                lRegistration.NetResources.putRtpSession(lMLineName, lRtpSession); 
     171               ((NetworkResources) lRegistration.NetResources).putRtpSession(lMLineName, lRtpSession); 
    172172            } else { 
    173                lRtpSession = lRegistration.NetResources.getRtpSession(lMLineName); 
     173               lRtpSession = ((NetworkResources) lRegistration.NetResources).getRtpSession(lMLineName); 
    174174            } 
    175175            if (aRemotePipe != null) { 
     
    178178 
    179179         } 
    180          return lRegistration.NetResources; 
     180         return (NetworkResources) lRegistration.NetResources; 
    181181      }catch (Exception e) { 
    182182         throw new P2pProxyException(e); 
  • p2pproxy/src/org/linphone/p2pproxy/core/sipproxy/JxtaSipProxy.java

    r17 r18  
    2323import java.util.Map; 
    2424 
     25import net.jxta.discovery.DiscoveryService; 
    2526import net.jxta.document.Advertisement; 
    2627import net.jxta.endpoint.MessageElement; 
     
    3839import org.linphone.p2pproxy.core.P2pProxyAdvertisementNotFoundException; 
    3940import org.linphone.p2pproxy.core.media.rtprelay.SdpProcessorImpl; 
     41import org.linphone.p2pproxy.core.sipproxy.SipProxyRegistrar.Registration; 
    4042import org.zoolu.sip.address.NameAddress; 
    4143import org.zoolu.sip.address.SipURL; 
     
    4749import org.zoolu.sip.transaction.TransactionServer; 
    4850 
    49 public class JxtaSipProxy implements SipProxy, PipeMsgListener { 
     51public class JxtaSipProxy implements SipProxy, PipeMsgListener,RegistrationHandler { 
    5052   private final JxtaNetworkManager mJxtaNetworkManager; 
    5153   private final Map<String,SipProxyRegistrar.Registration> mRegistrationTab; 
     
    212214     // 
    213215  } 
    214  
     216public 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    
    215230} 
     231 
     232} 
  • p2pproxy/src/org/linphone/p2pproxy/core/sipproxy/SipProxyRegistrar.java

    r17 r18  
    4747import org.linphone.p2pproxy.core.Configurator; 
    4848import org.linphone.p2pproxy.core.JxtaNetworkManager; 
    49 import org.linphone.p2pproxy.core.NetworkResources; 
    5049import org.linphone.p2pproxy.core.P2pProxyAccountManagementMBean; 
    5150import org.linphone.p2pproxy.core.P2pProxyAdvertisementNotFoundException; 
     
    9493      long RegistrationDate; 
    9594      long Expiration; 
    96       public NetworkResources NetResources; 
     95      //implementation specific context 
     96      public Object NetResources; 
    9797      public  Map<MediaType,InetSocketAddress> RtpRelays = new HashMap<MediaType,InetSocketAddress>() ; 
    9898      String Contact; 
     
    275275   private void updateRegistration(Registration aRegistration, Message aRegistrationMessage) throws IOException { 
    276276      aRegistration.RegistrationDate = System.currentTimeMillis(); 
    277       // default registration periode 
     277      // default registration period 
    278278      aRegistration.Expiration = 3600000; 
    279279      if (aRegistrationMessage.getExpiresHeader() != null ) { 
     
    281281      } 
    282282       
    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  
    290284   } 
    291285    
Note: See TracChangeset for help on using the changeset viewer.