diff options
author | Sebastien Vincent <seb@jitsi.org> | 2011-09-08 11:11:26 +0000 |
---|---|---|
committer | Sebastien Vincent <seb@jitsi.org> | 2011-09-08 11:11:26 +0000 |
commit | 9ec09ba8ff6a873f78a649cc2f100f3748dea690 (patch) | |
tree | d903dc88ac530e42fd4e9704d988688fe6f16819 /src/net/java/sip/communicator/impl/protocol/jabber/jinglesdp | |
parent | 4909c5bdffe2251735ca40fe9bbee5fb5e1d0218 (diff) | |
download | jitsi-9ec09ba8ff6a873f78a649cc2f100f3748dea690.zip jitsi-9ec09ba8ff6a873f78a649cc2f100f3748dea690.tar.gz jitsi-9ec09ba8ff6a873f78a649cc2f100f3748dea690.tar.bz2 |
Adds support for Google P2P transport (Gingle) in a Jingle session. Adds also missing id attribute in ICE-UDP candidates. Always call highest priority XMPP contact and if it supports Jingle and Gingle use custom Gingle transport on Jingle session, if it supports only Jingle use Jingle with ICE-UDP and if it only supports Gingle use Gingle session.
Diffstat (limited to 'src/net/java/sip/communicator/impl/protocol/jabber/jinglesdp')
-rw-r--r-- | src/net/java/sip/communicator/impl/protocol/jabber/jinglesdp/JingleUtils.java | 83 |
1 files changed, 0 insertions, 83 deletions
diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/jinglesdp/JingleUtils.java b/src/net/java/sip/communicator/impl/protocol/jabber/jinglesdp/JingleUtils.java index 6864135..0321c7c 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/jinglesdp/JingleUtils.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/jinglesdp/JingleUtils.java @@ -9,12 +9,8 @@ package net.java.sip.communicator.impl.protocol.jabber.jinglesdp; import java.net.*; import java.util.*; -import org.ice4j.*; -import org.ice4j.ice.*; - import net.java.sip.communicator.impl.protocol.jabber.*; import net.java.sip.communicator.impl.protocol.jabber.extensions.jingle.*; -import net.java.sip.communicator.impl.protocol.jabber.extensions.jingle.CandidateType; import net.java.sip.communicator.service.neomedia.*; import net.java.sip.communicator.service.neomedia.format.*; import net.java.sip.communicator.service.protocol.media.*; @@ -577,83 +573,4 @@ public class JingleUtils return ptExt; } - - /** - * Converts the ICE media <tt>stream</tt> and its local candidates into a - * {@link IceUdpTransportPacketExtension}. - * - * @param stream the {@link IceMediaStream} that we'd like to describe in - * XML. - * - * @return the {@link IceUdpTransportPacketExtension} that we - */ - public static IceUdpTransportPacketExtension createTransport( - IceMediaStream stream) - { - IceUdpTransportPacketExtension trans - = new IceUdpTransportPacketExtension(); - Agent iceAgent = stream.getParentAgent(); - - trans.setUfrag(iceAgent.getLocalUfrag()); - trans.setPassword(iceAgent.getLocalPassword()); - - for(Component component : stream.getComponents()) - { - for(Candidate candidate : component.getLocalCandidates()) - trans.addCandidate(createCandidate(candidate)); - } - - return trans; - } - - /** - * Creates a {@link CandidatePacketExtension} and initializes it so that it - * would describe the state of <tt>candidate</tt> - * - * @param candidate the ICE4J {@link Candidate} that we'd like to convert - * into an XMPP packet extension. - * - * @return a new {@link CandidatePacketExtension} corresponding to the state - * of the <tt>candidate</tt> candidate. - */ - private static CandidatePacketExtension createCandidate(Candidate candidate) - { - CandidatePacketExtension packet = new CandidatePacketExtension(); - - //TODO: XMPP expects int values as foundations. Luckily that's exactly - //what ice4j is using under the hood at this time. still, we'd need to - //make sure that doesn't change ... possibly by setting a property there - packet.setFoundation(Integer.parseInt( candidate.getFoundation())); - - Component component = candidate.getParentComponent(); - - packet.setComponent(component.getComponentID()); - packet.setProtocol(candidate.getTransport().toString()); - packet.setPriority(candidate.getPriority()); - packet.setGeneration( - component.getParentStream().getParentAgent().getGeneration()); - - TransportAddress transportAddress = candidate.getTransportAddress(); - - packet.setIP(transportAddress.getHostAddress()); - packet.setPort(transportAddress.getPort()); - - packet.setType(CandidateType.valueOf(candidate.getType().toString())); - - TransportAddress relAddr = candidate.getRelatedAddress(); - - if(relAddr != null) - { - packet.setRelAddr(relAddr.getHostAddress()); - packet.setRelPort(relAddr.getPort()); - } - - /* - * FIXME The XML schema of XEP-0176: Jingle ICE-UDP Transport Method - * specifies the network attribute as required. - */ - packet.setNetwork(0); - - return packet; - } } |