diff --git a/lib/installer-exclude/libjitsi.jar b/lib/installer-exclude/libjitsi.jar index 536a2da04..fcb46ffba 100644 Binary files a/lib/installer-exclude/libjitsi.jar and b/lib/installer-exclude/libjitsi.jar differ diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetDTMFJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetDTMFJabberImpl.java index 020f6e070..bf0024b7a 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetDTMFJabberImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetDTMFJabberImpl.java @@ -12,8 +12,8 @@ import net.java.sip.communicator.service.protocol.OperationFailedException; import net.java.sip.communicator.util.*; -import org.jitsi.impl.neomedia.codec.*; import org.jitsi.service.neomedia.*; +import org.jitsi.service.neomedia.codec.*; import org.jitsi.service.neomedia.format.*; import org.jitsi.service.protocol.*; diff --git a/src/net/java/sip/communicator/impl/protocol/sip/OperationSetDTMFSipImpl.java b/src/net/java/sip/communicator/impl/protocol/sip/OperationSetDTMFSipImpl.java index 7142577d3..ca591b122 100644 --- a/src/net/java/sip/communicator/impl/protocol/sip/OperationSetDTMFSipImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/sip/OperationSetDTMFSipImpl.java @@ -13,8 +13,8 @@ import net.java.sip.communicator.service.protocol.OperationFailedException; import net.java.sip.communicator.util.*; -import org.jitsi.impl.neomedia.codec.*; import org.jitsi.service.neomedia.*; +import org.jitsi.service.neomedia.codec.*; import org.jitsi.service.neomedia.format.*; import org.jitsi.service.protocol.*; 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 dc240b9dd..f5c4c982b 100644 --- a/src/net/java/sip/communicator/service/protocol/media/CallPeerMediaHandler.java +++ b/src/net/java/sip/communicator/service/protocol/media/CallPeerMediaHandler.java @@ -1096,6 +1096,9 @@ public boolean isRemotelyOnHold() * by one of our local MediaDevices and returns a third * List that contains their intersection. * + * Note that it also treats telephone-event as a special case and puts it + * to the end of the intersection, if there is any intersection. + * * @param remoteFormats remote MediaFormat found in the * SDP message * @param localFormats local supported MediaFormat of our device @@ -1106,15 +1109,40 @@ protected List intersectFormats( List localFormats) { List ret = new ArrayList(); + MediaFormat telephoneEvents = null; for(MediaFormat remoteFormat : remoteFormats) { MediaFormat localFormat = findMediaFormat(localFormats, remoteFormat); - if(localFormat != null) + if (localFormat != null) + { + // We ignore telephone-event here as it's not a real media + // format. Therefore we don't want to decide to use it as + // our preferred format. We'll add it back later if we find + // a suitable format. + // + // Note if there are multiple telephone-event formats, we'll + // lose all but the last one. That's fine because it's + // meaningless to have multiple repeated formats. + if (Constants.TELEPHONE_EVENT.equals(localFormat.getEncoding())) + { + telephoneEvents = localFormat; + continue; + } + ret.add(localFormat); + } } + + // If we've found some compatible formats, add telephone-event back + // in to the end of the list if we removed it above. If we didn't + // find any compatible formats, we don't want to add telephone-event + // as the only entry in the list because there'd be no media. + if ((!ret.isEmpty()) && (telephoneEvents != null)) + ret.add(telephoneEvents); + return ret; } @@ -1726,13 +1754,13 @@ public List getLocallySupportedFormats(MediaDevice mediaDevice) { return getLocallySupportedFormats(mediaDevice, null, null); } - + /** - * Returns a list of locally supported MediaFormats for the + * Returns a list of locally supported MediaFormats for the * given MediaDevice, ordered in descending priority. Takes into * account the configuration obtained from the ProtocolProvider - * instance associated this media handler -- if its set up to override the - * global encoding settings, uses that configuration, otherwise uses the + * instance associated this media handler -- if its set up to override the + * global encoding settings, uses that configuration, otherwise uses the * global configuration. * * @param mediaDevice the MediaDevice.