Commits work in progress on enabling ICE support in Jingle calls. Reduces post-pickup delay.

cusax-fix
Lyubomir Marinov 15 years ago
parent bf918b9409
commit b77cdcb053

Binary file not shown.

@ -22,6 +22,7 @@
* Implements a Jabber <tt>CallPeer</tt>.
*
* @author Emil Ivov
* @author Lyubomir Marinov
*/
public class CallPeerJabberImpl
extends MediaAwareCallPeer<CallJabberImpl,
@ -180,8 +181,8 @@ protected synchronized void processSessionInitiate(JingleIQ sessionInitIQ)
if (logger.isTraceEnabled())
logger.trace("will send ringing response: ");
JingleIQ ringing = JinglePacketFactory.createRinging(sessionInitIQ);
getProtocolProvider().getConnection().sendPacket(ringing);
getProtocolProvider().getConnection().sendPacket(
JinglePacketFactory.createRinging(sessionInitIQ));
}
/**
@ -229,7 +230,7 @@ protected synchronized void initiateSession()
public synchronized void answer()
throws OperationFailedException
{
List<ContentPacketExtension> answer;
Iterable<ContentPacketExtension> answer;
try
{
@ -239,20 +240,27 @@ public synchronized void answer()
{
logger.info("Failed to answer an incoming call", exc);
//send an error response;
JingleIQ errResp = JinglePacketFactory.createSessionTerminate(
sessionInitIQ.getTo(), sessionInitIQ.getFrom(),
sessionInitIQ.getSID(), Reason.FAILED_APPLICATION,
"Error: " + exc.getMessage());
//send an error response
String reasonText = "Error: " + exc.getMessage();
JingleIQ errResp
= JinglePacketFactory.createSessionTerminate(
sessionInitIQ.getTo(),
sessionInitIQ.getFrom(),
sessionInitIQ.getSID(),
Reason.FAILED_APPLICATION,
reasonText);
setState(CallPeerState.FAILED, "Error: " + exc.getMessage());
setState(CallPeerState.FAILED, reasonText);
getProtocolProvider().getConnection().sendPacket(errResp);
return;
}
JingleIQ response = JinglePacketFactory.createSessionAccept(
sessionInitIQ.getTo(), sessionInitIQ.getFrom(),
getJingleSID(), answer);
JingleIQ response
= JinglePacketFactory.createSessionAccept(
sessionInitIQ.getTo(),
sessionInitIQ.getFrom(),
getJingleSID(),
answer);
//send the packet first and start the stream later in case the media
//relay needs to see it before letting hole punching techniques through.
@ -637,8 +645,7 @@ public void processContentAdd(JingleIQ content)
{
List<ContentPacketExtension> contents = content.getContentList();
JingleIQ contentIQ = null;
List<ContentPacketExtension> answerContents =
new ArrayList<ContentPacketExtension>();
Iterable<ContentPacketExtension> answerContents;
try
{
@ -649,17 +656,24 @@ public void processContentAdd(JingleIQ content)
{
logger.warn("Exception occurred", e);
contentIQ = JinglePacketFactory.createContentReject(
getProtocolProvider().getOurJID(),
this.peerJID, getJingleSID(), answerContents);
answerContents = null;
contentIQ
= JinglePacketFactory.createContentReject(
getProtocolProvider().getOurJID(),
this.peerJID,
getJingleSID(),
answerContents);
}
if(contentIQ == null)
{
/* send content-accept */
contentIQ = JinglePacketFactory.
createContentAccept(getProtocolProvider().getOurJID(),
this.peerJID, getJingleSID(), answerContents);
contentIQ
= JinglePacketFactory.createContentAccept(
getProtocolProvider().getOurJID(),
this.peerJID,
getJingleSID(),
answerContents);
}
getProtocolProvider().getConnection().sendPacket(contentIQ);
@ -749,7 +763,7 @@ public void processContentRemove(JingleIQ content)
*/
public void processContentReject(JingleIQ content)
{
if(content.getContentList().size() == 0)
if(content.getContentList().isEmpty())
{
//send an error response;
JingleIQ errResp = JinglePacketFactory.createSessionTerminate(
@ -762,4 +776,25 @@ public void processContentReject(JingleIQ content)
return;
}
}
/**
* Processes the <tt>transport-info</tt> {@link JingleIQ}.
*
* @param jingleIQ the <tt>transport-info</tt> {@link JingleIQ} to process
*/
public void processTransportInfo(JingleIQ jingleIQ)
{
/*
* The transport-info action is used to exchange transport candidates so
* it only concerns the mediaHandler.
*/
try
{
getMediaHandler().processTransportInfo(jingleIQ.getContentList());
}
catch (OperationFailedException ofe)
{
logger.error("Failed to process an incoming transport-info", ofe);
}
}
}

@ -6,9 +6,9 @@
*/
package net.java.sip.communicator.impl.protocol.jabber;
import java.lang.reflect.*;
import java.util.*;
import org.jivesoftware.smack.packet.*;
import org.jivesoftware.smackx.packet.*;
import net.java.sip.communicator.impl.protocol.jabber.extensions.jingle.*;
@ -230,7 +230,7 @@ public void processOffer(List<ContentPacketExtension> offer)
IllegalArgumentException
{
// prepare to generate answers to all the incoming descriptions
List<ContentPacketExtension> answerContentList
List<ContentPacketExtension> answer
= new ArrayList<ContentPacketExtension>(offer.size());
boolean atLeastOneValidDescription = false;
@ -315,11 +315,17 @@ public void processOffer(List<ContentPacketExtension> offer)
}
// create the answer description
ContentPacketExtension ourContent = JingleUtils.createDescription(
content.getCreator(), content.getName(),
JingleUtils.getSenders(direction, !getPeer().isInitiator()) ,
mutuallySupportedFormats, rtpExtensions,
getDynamicPayloadTypes(), getRtpExtensionsRegistry());
ContentPacketExtension ourContent
= JingleUtils.createDescription(
content.getCreator(),
content.getName(),
JingleUtils.getSenders(
direction,
!getPeer().isInitiator()),
mutuallySupportedFormats,
rtpExtensions,
getDynamicPayloadTypes(),
getRtpExtensionsRegistry());
// ZRTP
if(getPeer().getCall().isSipZrtpAttribute())
@ -347,13 +353,13 @@ public void processOffer(List<ContentPacketExtension> offer)
// got an content which have inputevt, it means that peer requests
// a desktop sharing session so tell it we support inputevt
if(content.getChildExtensionsOfType(
InputEvtPacketExtension.class) != null)
if(content.getChildExtensionsOfType(InputEvtPacketExtension.class)
!= null)
{
ourContent.addChildExtension(new InputEvtPacketExtension());
}
answerContentList.add(ourContent);
answer.add(ourContent);
localContentMap.put(content.getName(), ourContent);
atLeastOneValidDescription = true;
@ -369,9 +375,15 @@ public void processOffer(List<ContentPacketExtension> offer)
logger);
}
//now, before we go, tell the transport manager to start our candidate
//harvest
getTransportManager().startCandidateHarvest(offer, answerContentList);
/*
* In order to minimize post-pickup delay, establish the connectivity
* prior to ringing.
*/
List<ContentPacketExtension> candidates
= harvestCandidates(offer, answer);
sendTransportInfo(candidates);
establishConnectivity(offer);
}
/**
@ -384,12 +396,12 @@ public void processOffer(List<ContentPacketExtension> offer)
*
* @throws OperationFailedException if we fail to configure the media stream
*/
protected List<ContentPacketExtension> generateSessionAccept()
public Iterable<ContentPacketExtension> generateSessionAccept()
throws OperationFailedException
{
TransportManagerJabberImpl transportManager = getTransportManager();
List<ContentPacketExtension> sessAccept
= transportManager.wrapupHarvest();
Iterable<ContentPacketExtension> sessAccept
= transportManager.wrapupConnectivityEstablishment();
CallPeerJabberImpl peer = getPeer();
//user answered an incoming call so we go through whatever content
@ -427,9 +439,10 @@ protected List<ContentPacketExtension> generateSessionAccept()
for(PayloadTypePacketExtension payload : payloadTypes)
{
format = JingleUtils.payloadTypeToMediaFormat(
payload,
getDynamicPayloadTypes());
format
= JingleUtils.payloadTypeToMediaFormat(
payload,
getDynamicPayloadTypes());
if(format != null)
break;
@ -458,7 +471,8 @@ protected List<ContentPacketExtension> generateSessionAccept()
// if remote peer requires inputevt, notify UI to capture mouse
// and keyboard events
if(ourContent.getChildExtensionsOfType(
InputEvtPacketExtension.class) != null)
InputEvtPacketExtension.class)
!= null)
{
OperationSetDesktopSharingClientJabberImpl client
= (OperationSetDesktopSharingClientJabberImpl)
@ -569,15 +583,7 @@ public List<ContentPacketExtension> createContentList(MediaType mediaType)
}
//now add the transport elements
TransportManagerJabberImpl transportManager = getTransportManager();
transportManager.startCandidateHarvest(mediaDescs);
/*
* XXX Ideally, we wouldn't wrap up that quickly. We need to revisit
* this.
*/
return transportManager.wrapupHarvest();
return harvestCandidates(null, mediaDescs);
}
/**
@ -672,15 +678,7 @@ public List<ContentPacketExtension> createContentList()
}
//now add the transport elements
TransportManagerJabberImpl transportManager = getTransportManager();
transportManager.startCandidateHarvest(mediaDescs);
/*
* XXX Ideally, we wouldn't wrap up that quickly. We need to revisit
* this.
*/
return transportManager.wrapupHarvest();
return harvestCandidates(null, mediaDescs);
}
/**
@ -939,10 +937,10 @@ public void processAnswer(List<ContentPacketExtension> answer)
}
/*
* Since we've received (the) remote candidates from the peer, we can
* start checking them for connectivity.
* The answer given in session-accept may contain transport-related
* information compatible with that carried in transport-info.
*/
startConnectivityEstablishment(answer);
processTransportInfo(answer);
}
/**
@ -953,7 +951,7 @@ public void processAnswer(List<ContentPacketExtension> answer)
* management
* @see CallPeerMediaHandler#getTransportManager()
*/
public TransportManagerJabberImpl getTransportManager()
protected TransportManagerJabberImpl getTransportManager()
{
if (transportManager == null)
{
@ -1142,57 +1140,57 @@ private MediaDirection calculatePostHoldDirection(MediaStream stream)
}
/**
* Overrides {@link CallPeerMediaHandler#start()}. Prior to starting this
* <tt>CallPeerMediaHandler</tt>, makes sure connectivity establishment
* through the associated <tt>TransportManager</tt> has been started in
* order to determine the <tt>StreamConnector</tt>s and the
* <tt>MediaStreamTarget</tt>s of the <tt>MediaStream</tt>s managed by this
* instance.
* Gathers local candidate addresses.
*
* @throws IllegalStateException if this <tt>CallPeerMediaHandler</tt> has
* not first seen a media description or has not generated an offer
* @see CallPeerMediaHandler#start()
* @param remote the media descriptions received from the remote peer if any
* or <tt>null</tt> if <tt>local</tt> represents an offer from the local
* peer to be sent to the remote peer
* @param local the media descriptions sent or to be sent from the local
* peer to the remote peer. If <tt>remote</tt> is <tt>null</tt>,
* <tt>local</tt> represents an offer from the local peer to be sent to the
* remote peer
* @return the media descriptions of the local peer after the local
* candidate addresses have been gathered as returned by
* {@link TransportManagerJabberImpl#wrapupCandidateHarvest()}
* @throws OperationFailedException if anything goes wrong while starting or
* wrapping up the gathering of local candidate addresses
*/
@Override
public void start()
throws IllegalStateException
private List<ContentPacketExtension> harvestCandidates(
List<ContentPacketExtension> remote,
List<ContentPacketExtension> local)
throws OperationFailedException
{
if (getPeer().isInitiator())
{
try
{
startConnectivityEstablishment(remoteContentMap.values());
}
catch (OperationFailedException ofe)
{
throw new UndeclaredThrowableException(ofe);
}
}
TransportManagerJabberImpl transportManager = getTransportManager();
if (remote == null)
transportManager.startCandidateHarvest(local);
else
transportManager.startCandidateHarvest(remote, local);
super.start();
/*
* XXX Ideally, we wouldn't wrap up that quickly. We need to revisit
* this.
*/
return transportManager.wrapupCandidateHarvest();
}
/**
* Starts the connectivity establishment of the associated
* <tt>TransportManagerJabberImpl</tt> i.e. checks the connectivity between
* the local and the remote peers given the remote counterpart of the
* negotiation between them and sets the respective <tt>connector</tt>s and
* <tt>target</tt>s of the associated <tt>MediaStream</tt>s.
* Establishes connectivity between the candidate addresses of the local and
* the remote peers.
*
* @param remote the collection of <tt>ContentPacketExtension</tt>s which
* represents the remote counterpart of the negotiation between the local
* and the remote peers
* @throws OperationFailedException if anything goes wrong while starting
* the connectivity establishment or setting the <tt>connector</tt>s or
* <tt>target</tt>s of the associated <tt>MediaStream</tt>s
* @param remote the media descriptions received from the remote peer which
* contain the remote candidate addresses to establish connectivity with
* @throws OperationFailedException if anything goes wrong while starting or
* wrapping up the establishment of connectivity between the candidate
* addresses of the local and the remote peers
*/
private void startConnectivityEstablishment(
Collection<ContentPacketExtension> remote)
private void establishConnectivity(Iterable<ContentPacketExtension> remote)
throws OperationFailedException
{
TransportManagerJabberImpl transportManager = getTransportManager();
transportManager.startConnectivityEstablishment(remote);
transportManager.wrapupConnectivityEstablishment();
for (MediaType mediaType : MediaType.values())
{
MediaStream stream = getStream(mediaType);
@ -1205,4 +1203,76 @@ private void startConnectivityEstablishment(
}
}
}
/**
* Sends local candidate addresses from the local peer to the remote peer
* using the <tt>transport-info</tt> {@link JingleIQ}. Since only ICE UDP
* among the supported Jingle transports is documented to utilize
* <tt>transport-info</tt>, the <tt>sendTransportInfo</tt> method does not
* send <tt>ContentPacketExtension</tt>s with transport other than ICE UDP
* and silently ignores them (i.e. no <tt>transport-info</tt>
* <tt>JingleIQ</tt> is sent in the case of all <tt>candidates</tt> not
* being from the ICE UDP transport).
*
* @param candidates the local candidate addresses to be sent from the local
* peer to the remote peer using the <tt>transport-info</tt>
* {@link JingleIQ}
*/
private void sendTransportInfo(Iterable<ContentPacketExtension> candidates)
{
JingleIQ transportInfo = new JingleIQ();
boolean sendTransportInfo = false;
for (ContentPacketExtension content : candidates)
{
IceUdpTransportPacketExtension transport
= content.getFirstChildOfType(
IceUdpTransportPacketExtension.class);
if ((transport != null)
&& IceUdpTransportPacketExtension.NAMESPACE.equals(
transport.getNamespace()))
{
List<CandidatePacketExtension> candidateList
= transport.getCandidateList();
if ((candidateList != null) && !candidateList.isEmpty())
{
transportInfo.addContent(content);
sendTransportInfo = true;
}
}
}
if (sendTransportInfo)
{
CallPeerJabberImpl peer = getPeer();
ProtocolProviderServiceJabberImpl protocolProvider
= peer.getProtocolProvider();
transportInfo.setAction(JingleAction.TRANSPORT_INFO);
transportInfo.setFrom(protocolProvider.getOurJID());
transportInfo.setSID(peer.getJingleSID());
transportInfo.setTo(peer.getAddress());
transportInfo.setType(IQ.Type.SET);
protocolProvider.getConnection().sendPacket(transportInfo);
}
}
/**
* Processes the transport-related information provided by the remote
* <tt>peer</tt> in a specific set of <tt>ContentPacketExtension</tt>s.
*
* @param contents the <tt>ContentPacketExtenion</tt>s provided by the
* remote <tt>peer</tt> and containing the transport-related information to
* be processed
* @throws OperationFailedException if anything goes wrong while processing
* the transport-related information provided by the remote <tt>peer</tt> in
* the specified set of <tt>ContentPacketExtension</tt>s
*/
public void processTransportInfo(Iterable<ContentPacketExtension> contents)
throws OperationFailedException
{
establishConnectivity(contents);
}
}

@ -384,7 +384,6 @@ public void startCandidateHarvest(List<ContentPacketExtension> theirOffer,
RtpDescriptionPacketExtension rtpDesc
= ourContent.getFirstChildOfType(
RtpDescriptionPacketExtension.class);
IceMediaStream stream = createIceStream(rtpDesc.getMedia());
//we now generate the XMPP code containing the candidates.
@ -476,13 +475,12 @@ private IceMediaStream createIceStream(String media)
/**
* Simply returns the list of local candidates that we gathered during the
* harvest. This is a raw udp transport manager so there's no real wrapping
* up to do.
*
* @return the list of local candidates that we gathered during the
* harvest.
*
* @return the list of local candidates that we gathered during the harvest
* @see TransportManagerJabberImpl#wrapupCandidateHarvest()
*/
public List<ContentPacketExtension> wrapupHarvest()
public List<ContentPacketExtension> wrapupCandidateHarvest()
{
return cpeList;
}
@ -504,17 +502,26 @@ private static NetworkAddressManagerService getNetAddrMgr()
* Implements
* {@link TransportManagerJabberImpl#startConnectivityEstablishment(Collection)}.
* Starts the connectivity establishment of the associated ICE
* <tt>Agent</tt> and waits for it to complete.
* <tt>Agent</tt>.
*
* @param remote the collection of <tt>ContentPacketExtension</tt>s which
* represents the remote counterpart of the negotiation between the local
* and the remote peers
* @see TransportManagerJabberImpl#startConnectivityEstablishment(Collection)
* @see TransportManagerJabberImpl#startConnectivityEstablishment(Iterable)
*/
public void startConnectivityEstablishment(
Collection<ContentPacketExtension> remote)
Iterable<ContentPacketExtension> remote)
{
/*
* At the time of this writing, the implementation of the ICE Agent does
* not support adding candidates after the connectivity establishment
* has been started.
*/
if (!IceProcessingState.WAITING.equals(iceAgent.getState()))
return;
int generation = iceAgent.getGeneration();
boolean startConnectivityEstablishment = false;
for (ContentPacketExtension content : remote)
{
@ -565,10 +572,28 @@ public void startConnectivityEstablishment(
candidate.getType().toString()),
Integer.toString(candidate.getFoundation()),
candidate.getPriority()));
startConnectivityEstablishment = true;
}
}
if (startConnectivityEstablishment)
iceAgent.startConnectivityEstablishment();
}
final Object[] iceProcessingState = new Object[1];
/**
* Implements
* {@link TransportManagerJabberImpl#wrapupConnectivityEstablishment()}.
* Waits for the associated ICE <tt>Agent</tt> to finish any started
* connectivity checks and returns the collection of
* <tt>ContentPacketExtension</tt>s which represents the local counterpart
* of the negotiation between the local and the remote peers.
*
* @return the collection of <tt>ContentPacketExtension</tt>s which
* represents the local counterpart of the negotiation between the local and
* the remote peer after the end of any started connectivity establishment
*/
public Iterable<ContentPacketExtension> wrapupConnectivityEstablishment()
{
final Object iceProcessingStateSyncRoot = new Object();
PropertyChangeListener stateChangeListener
= new PropertyChangeListener()
{
@ -589,10 +614,9 @@ public void propertyChange(PropertyChangeEvent evt)
if (iceAgent == IceUdpTransportManager.this.iceAgent)
{
synchronized (iceProcessingState)
synchronized (iceProcessingStateSyncRoot)
{
iceProcessingState[0] = newValue;
iceProcessingState.notify();
iceProcessingStateSyncRoot.notify();
}
}
}
@ -600,18 +624,17 @@ public void propertyChange(PropertyChangeEvent evt)
};
iceAgent.addStateChangeListener(stateChangeListener);
iceAgent.startConnectivityEstablishment();
// Wait for the connectivity checks to finish.
// Wait for the connectivity checks to finish if they have been started.
boolean interrupted = false;
synchronized (iceProcessingState)
synchronized (iceProcessingStateSyncRoot)
{
while (iceProcessingState[0] == null)
while (IceProcessingState.RUNNING.equals(iceAgent.getState()))
{
try
{
iceProcessingState.wait();
iceProcessingStateSyncRoot.wait();
}
catch (InterruptedException ie)
{
@ -621,5 +644,13 @@ public void propertyChange(PropertyChangeEvent evt)
}
if (interrupted)
Thread.currentThread().interrupt();
/*
* Make sure stateChangeListener is removed from iceAgent in case its
* #propertyChange(PropertyChangeEvent) has never been executed.
*/
iceAgent.removeStateChangeListener(stateChangeListener);
return cpeList;
}
}

@ -443,7 +443,7 @@ public void processPacket(Packet packet)
try
{
processJinglePacket(jingleIQ);
processJingleIQ(jingleIQ);
}
catch(Throwable t)
{
@ -465,7 +465,7 @@ public void processPacket(Packet packet)
*
* @param jingleIQ the {@link JingleIQ} packet we need to be analyzing.
*/
private void processJinglePacket(JingleIQ jingleIQ)
private void processJingleIQ(JingleIQ jingleIQ)
{
//let's first see whether we have a peer that's concerned by this IQ
CallPeerJabberImpl callPeer
@ -548,6 +548,10 @@ else if (action == JingleAction.CONTENT_REMOVE)
{
callPeer.processContentRemove(jingleIQ);
}
else if (action == JingleAction.TRANSPORT_INFO)
{
callPeer.processTransportInfo(jingleIQ);
}
}
/**

@ -34,7 +34,7 @@ public class RawUdpTransportManager
* remote counterpart of the negotiation between the local and the remote
* peers.
*/
private Collection<ContentPacketExtension> remote;
private Iterable<ContentPacketExtension> remote;
/**
* Creates a new instance of this transport manager, binding it to the
@ -230,17 +230,17 @@ private RawUdpTransportPacketExtension createTransport(
* harvest. This is a raw UDP transport manager so there's no real wrapping
* up to do.
*
* @return the list of local candidates that we gathered during the
* harvest.
* @return the list of local candidates that we gathered during the harvest
* @see TransportManagerJabberImpl#wrapupCandidateHarvest()
*/
public List<ContentPacketExtension> wrapupHarvest()
public List<ContentPacketExtension> wrapupCandidateHarvest()
{
return local;
}
/**
* Implements
* {@link TransportManagerJabberImpl#startConnectivityEstablishment(Collection)}.
* {@link TransportManagerJabberImpl#startConnectivityEstablishment(Iterable)}.
* Since this represents a raw UDP transport, performs no connectivity
* checks and just remembers the remote counterpart of the negotiation
* between the local and the remote peers in order to be able to report the
@ -249,11 +249,27 @@ public List<ContentPacketExtension> wrapupHarvest()
* @param remote the collection of <tt>ContentPacketExtension</tt>s which
* represent the remote counterpart of the negotiation between the local and
* the remote peers
* @see TransportManagerJabberImpl#startConnectivityEstablishment(Collection)
* @see TransportManagerJabberImpl#startConnectivityEstablishment(Iterable)
*/
public void startConnectivityEstablishment(
Collection<ContentPacketExtension> remote)
Iterable<ContentPacketExtension> remote)
{
this.remote = remote;
}
/**
* Implements
* {@link TransportManagerJabberImpl#wrapupConnectivityEstablishment()}.
* Since this represents a raw UDP transport i.e. no connectivity checks are
* performed, just returns the local counterpart of the negotiation between
* the local and the remote peers.
*
* @return the local counterpart of the negotiation between the local and
* the remote peers
* @see TransportManagerJabberImpl#wrapupConnectivityEstablishment()
*/
public Iterable<ContentPacketExtension> wrapupConnectivityEstablishment()
{
return local;
}
}

@ -162,13 +162,13 @@ public abstract void startCandidateHarvest(
/**
* Notifies the transport manager that it should conclude candidate
* harvesting as soon as possible an return the lists of candidates
* harvesting as soon as possible and return the lists of candidates
* gathered so far.
*
* @return the content list that we received earlier (possibly cloned into
* a new instance) and that we have updated with transport lists.
*/
public abstract List<ContentPacketExtension> wrapupHarvest();
public abstract List<ContentPacketExtension> wrapupCandidateHarvest();
/**
* Looks through the <tt>cpExtList</tt> and returns the {@link
@ -203,5 +203,16 @@ protected ContentPacketExtension findContentByName(
* and the remote peer
*/
public abstract void startConnectivityEstablishment(
Collection<ContentPacketExtension> remote);
Iterable<ContentPacketExtension> remote);
/**
* Notifies this <tt>TransportManagerJabberImpl</tt> that it should conclude
* any started connectivity establishment and return (at least) the
* transport-related media descriptions of the local peer.
*
* @return the transport-related media descriptions of the local peer after
* the end of the connectivity establishment
*/
public abstract Iterable<ContentPacketExtension>
wrapupConnectivityEstablishment();
}

@ -180,10 +180,10 @@ public static JingleIQ createSessionTerminate(String from,
* .
*/
public static JingleIQ createSessionAccept(
String from,
String to,
String sid,
List<ContentPacketExtension> contentList)
String from,
String to,
String sid,
Iterable<ContentPacketExtension> contentList)
{
JingleIQ sessionAccept = new JingleIQ();
@ -196,9 +196,7 @@ public static JingleIQ createSessionAccept(
sessionAccept.setAction(JingleAction.SESSION_ACCEPT);
for(ContentPacketExtension content : contentList)
{
sessionAccept.addContent(content);
}
return sessionAccept;
}
@ -270,9 +268,7 @@ public static JingleIQ createContentAdd(
contentAdd.setAction(JingleAction.CONTENT_ADD);
for(ContentPacketExtension content : contentList)
{
contentAdd.addContent(content);
}
return contentAdd;
}
@ -291,10 +287,10 @@ public static JingleIQ createContentAdd(
* packet.
*/
public static JingleIQ createContentAccept(
String from,
String to,
String sid,
List<ContentPacketExtension> contentList)
String from,
String to,
String sid,
Iterable<ContentPacketExtension> contentList)
{
JingleIQ contentAccept = new JingleIQ();
@ -307,9 +303,7 @@ public static JingleIQ createContentAccept(
contentAccept.setAction(JingleAction.CONTENT_ACCEPT);
for(ContentPacketExtension content : contentList)
{
contentAccept.addContent(content);
}
return contentAccept;
}
@ -328,10 +322,10 @@ public static JingleIQ createContentAccept(
* packet.
*/
public static JingleIQ createContentReject(
String from,
String to,
String sid,
List<ContentPacketExtension> contentList)
String from,
String to,
String sid,
Iterable<ContentPacketExtension> contentList)
{
JingleIQ contentReject = new JingleIQ();
@ -343,9 +337,10 @@ public static JingleIQ createContentReject(
contentReject.setSID(sid);
contentReject.setAction(JingleAction.CONTENT_REJECT);
for(ContentPacketExtension content : contentList)
if (contentList != null)
{
contentReject.addContent(content);
for(ContentPacketExtension content : contentList)
contentReject.addContent(content);
}
return contentReject;

@ -119,7 +119,7 @@ public static MediaFormat payloadTypeToMediaFormat(
List<ParameterPacketExtension> params = payloadType.getParameters();
//convert params to a name:value map
Map<String, String> paramsMap = new Hashtable<String, String>();
Map<String, String> paramsMap = new HashMap<String, String>();
for(ParameterPacketExtension param : params)
paramsMap.put(param.getName(), param.getValue());
@ -576,6 +576,12 @@ private static CandidatePacketExtension createCandidate(Candidate candidate)
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;
}
}

@ -715,7 +715,7 @@ protected void throwOperationFailedException( String message,
*
* @return the transport manager that is handling our address management.
*/
public TransportManagerSipImpl getTransportManager()
protected TransportManagerSipImpl getTransportManager()
{
return transportManager;
}

@ -1609,5 +1609,5 @@ protected abstract void throwOperationFailedException( String message,
* @return the <tt>TransportManager</tt> implementation handling our address
* management
*/
public abstract TransportManager<T> getTransportManager();
protected abstract TransportManager<T> getTransportManager();
}

Loading…
Cancel
Save