Examples of IceUdpTransportPacketExtension


Examples of net.java.sip.communicator.impl.protocol.jabber.extensions.jingle.IceUdpTransportPacketExtension

   * @throws IllegalArgumentException if the content list contains streams that are not found here.
   */
  public void addLocalCandidateToContents(List<ContentPacketExtension> contentList) throws IllegalArgumentException {
    for( ContentPacketExtension cpe : contentList ) {
      String streamName = cpe.getName();
      IceUdpTransportPacketExtension ext = getLocalCandidatePacketExtensionForStream( streamName );
      if( ext == null )
        throw new IllegalArgumentException("No Stream found for " + streamName );
      cpe.addChildExtension(ext);
    }
  }
View Full Code Here

Examples of net.java.sip.communicator.impl.protocol.jabber.extensions.jingle.IceUdpTransportPacketExtension

        throw new IllegalArgumentException("No Stream found for " + streamName );
      cpe.addChildExtension(ext);
    }
  }
  public IceUdpTransportPacketExtension getLocalCandidatePacketExtensionForStream( String streamName ) {
    IceUdpTransportPacketExtension transport = new IceUdpTransportPacketExtension();
    transport.setPassword( agent.getLocalPassword() );
    transport.setUfrag( agent.getLocalUfrag() );

    try {
      IceMediaStream ims = agent.getStream(streamName);
      if( ims == null )
        return null;
     
      for( Component c : ims.getComponents() ) {
        for( Candidate<?> can : c.getLocalCandidates() ) {
          CandidatePacketExtension candidate = new CandidatePacketExtension();
          candidate.setComponent(c.getComponentID());
          candidate.setFoundation(Integer.parseInt(can.getFoundation()));
          candidate.setGeneration(agent.getGeneration());
          candidate.setID(nextCandidateId());
          candidate.setNetwork(0); //FIXME: we need to identify the network card properly.
          TransportAddress ta = can.getTransportAddress();
          candidate.setIP( ta.getHostAddress() );
          candidate.setPort( ta.getPort() );
          candidate.setPriority(can.getPriority());
          candidate.setProtocol(can.getTransport().toString());
          if( can.getRelatedAddress() != null ) {
            candidate.setRelAddr(can.getRelatedAddress().getHostAddress());
            candidate.setRelPort(can.getRelatedAddress().getPort());
          }
          candidate.setType(convertType(can.getType()));
         
          transport.addCandidate(candidate);
        }
      }
    } catch( Exception e ) {
      e.printStackTrace();
      System.exit(0);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.