diff options
4 files changed, 53 insertions, 11 deletions
diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/CallPeerMediaHandlerJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/CallPeerMediaHandlerJabberImpl.java index 0ef118e..3dc1c8c 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/CallPeerMediaHandlerJabberImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/CallPeerMediaHandlerJabberImpl.java @@ -1469,7 +1469,7 @@ public class CallPeerMediaHandlerJabberImpl RtpDescriptionPacketExtension description = JingleUtils.getRtpDescription(content); MediaType mediaType - = MediaType.parseString(description.getMedia()); + = JingleUtils.getMediaType(content); //stream target TransportManagerJabberImpl transportManager = getTransportManager(); @@ -1666,7 +1666,7 @@ public class CallPeerMediaHandlerJabberImpl RtpDescriptionPacketExtension description = JingleUtils.getRtpDescription(content); MediaType mediaType - = MediaType.parseString( description.getMedia() ); + = JingleUtils.getMediaType(content); List<MediaFormat> remoteFormats = JingleUtils.extractFormats( diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/IceUdpTransportManager.java b/src/net/java/sip/communicator/impl/protocol/jabber/IceUdpTransportManager.java index 73f1b0b..5ed365f 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/IceUdpTransportManager.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/IceUdpTransportManager.java @@ -890,15 +890,23 @@ public class IceUdpTransportManager if (iceAgentStateIsRunning && (candidates.size() == 0)) return false; + String media = e.getKey(); + IceMediaStream stream = iceAgent.getStream(media); + + if (stream == null) + { + logger.warn( + "No ICE media stream for media: " + media + + " - ignored candidates."); + continue; + } + // Sort the remote candidates (host < reflexive < relayed) in order // to create first the host, then the reflexive, the relayed // candidates and thus be able to set the relative-candidate // matching the rel-addr/rel-port attribute. Collections.sort(candidates); - String media = e.getKey(); - IceMediaStream stream = iceAgent.getStream(media); - // Different stream may have different ufrag/password String ufrag = transport.getUfrag(); 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 1c0e565..a8696c7 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 @@ -15,9 +15,11 @@ import net.java.sip.communicator.impl.protocol.jabber.extensions.jingle.ContentP import net.java.sip.communicator.impl.protocol.jabber.extensions.jingle.ContentPacketExtension.SendersEnum; import net.java.sip.communicator.service.protocol.media.*; import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.Logger; import org.jitsi.service.neomedia.*; import org.jitsi.service.neomedia.format.*; +import org.jitsi.util.*; /** * The class contains a number of utility methods that are meant to facilitate @@ -77,6 +79,12 @@ public class JingleUtils DynamicPayloadTypeRegistry ptRegistry) { List<MediaFormat> mediaFmts = new ArrayList<MediaFormat>(); + + if (description == null) + { + return mediaFmts; + } + List<PayloadTypePacketExtension> payloadTypes = description.getPayloadTypes(); @@ -234,6 +242,11 @@ public class JingleUtils { List<RTPExtension> extensionsList = new ArrayList<RTPExtension>(); + if (desc == null) + { + return extensionsList; + } + List<RTPHdrExtPacketExtension> extmapList = desc.getExtmapList(); for (RTPHdrExtPacketExtension extmap : extmapList) @@ -649,15 +662,31 @@ public class JingleUtils { if (content == null) return null; + + // We will use content name for determining media type + // if no RTP description is present(SCTP connection case) + String mediaTypeName = content.getName(); + RtpDescriptionPacketExtension desc = getRtpDescription(content); if (desc != null) { - String mediaTypeStr = desc.getMedia(); - if (mediaTypeStr != null) - return MediaType.parseString(mediaTypeStr); + String rtpMedia = desc.getMedia(); + if (!StringUtils.isNullOrEmpty(rtpMedia)) + { + mediaTypeName = rtpMedia; + } } - - return null; + // SDP: + // 'm=application SCTP/DTLS' + // ... + // 'a=mid:data' + // is used for SCTP connection in Jitsi Meet + // which translates to RtpDescriptionPacketExtension#media + if ("application".equals(mediaTypeName)) + { + return MediaType.DATA; + } + return MediaType.parseString(mediaTypeName); } } diff --git a/src/net/java/sip/communicator/service/protocol/media/CallPeerMediaHandler.java b/src/net/java/sip/communicator/service/protocol/media/CallPeerMediaHandler.java index 5caf298..20822b0 100644 --- a/src/net/java/sip/communicator/service/protocol/media/CallPeerMediaHandler.java +++ b/src/net/java/sip/communicator/service/protocol/media/CallPeerMediaHandler.java @@ -611,6 +611,8 @@ public abstract class CallPeerMediaHandler<T extends MediaAwareCallPeer<?,?,?>> return audioDirectionUserPreference; case VIDEO: return videoDirectionUserPreference; + case DATA: + return MediaDirection.INACTIVE; default: throw new IllegalArgumentException("mediaType"); } @@ -655,7 +657,10 @@ public abstract class CallPeerMediaHandler<T extends MediaAwareCallPeer<?,?,?>> */ protected List<RTPExtension> getExtensionsForType(MediaType type) { - return getDefaultDevice(type).getSupportedExtensions(); + MediaDevice device = getDefaultDevice(type); + return device != null + ? device.getSupportedExtensions() + : new ArrayList<RTPExtension>(); } /** |