diff --git a/lib/installer-exclude/libjitsi.jar b/lib/installer-exclude/libjitsi.jar index 3a63713e7..9a9aa1106 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/AbstractCallPeerMediaHandlerJabberGTalkImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/AbstractCallPeerMediaHandlerJabberGTalkImpl.java index 95204811f..41c6e9070 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/AbstractCallPeerMediaHandlerJabberGTalkImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/AbstractCallPeerMediaHandlerJabberGTalkImpl.java @@ -193,7 +193,7 @@ protected void addSDesAdvertisedEncryptions( } else { - sdesControl.cleanup(); + sdesControl.cleanup(null); srtpControls.remove(mediaType, SrtpControlType.SDES); } } @@ -207,7 +207,7 @@ else if(isInitiator) = getSrtpControls().remove(mediaType, SrtpControlType.SDES); if (sdesControl != null) - sdesControl.cleanup(); + sdesControl.cleanup(null); } } @@ -479,7 +479,7 @@ protected boolean setSDesEncryptionOnDescription( { // none of the offered suites match, destroy the sdes // control - sdesControl.cleanup(); + sdesControl.cleanup(null); srtpControls.remove(mediaType, SrtpControlType.SDES); logger.warn( "Received unsupported sdes crypto attribute"); @@ -489,7 +489,7 @@ protected boolean setSDesEncryptionOnDescription( { // peer doesn't offer any SDES attribute, destroy the sdes // control - sdesControl.cleanup(); + sdesControl.cleanup(null); srtpControls.remove(mediaType, SrtpControlType.SDES); } } @@ -538,8 +538,6 @@ protected void setAndAddPreferredEncryptionProtocol( * Selects a specific encryption protocol if it is the preferred (only used * by the callee). * - * @param protoName the name of the encryption protocol which is to be - * selected * @param mediaType The type of media (AUDIO or VIDEO). * @param localDescription The element containing the media DESCRIPTION and * its encryption. 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 60d8d5350..0ef118e91 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/CallPeerMediaHandlerJabberImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/CallPeerMediaHandlerJabberImpl.java @@ -2423,7 +2423,7 @@ boolean addDtlsAdvertisedEncryptions( if (dtlsControl != null) { srtpControls.remove(mediaType, SrtpControlType.DTLS_SRTP); - dtlsControl.cleanup(); + dtlsControl.cleanup(null); } } return b; @@ -2590,7 +2590,7 @@ private boolean setDtlsEncryptionOnContent( if (dtlsControl != null) { srtpControls.remove(mediaType, SrtpControlType.DTLS_SRTP); - dtlsControl.cleanup(); + dtlsControl.cleanup(null); } } return b; diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/extensions/colibri/ColibriConferenceIQ.java b/src/net/java/sip/communicator/impl/protocol/jabber/extensions/colibri/ColibriConferenceIQ.java index fcd467adc..eb6449cf2 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/extensions/colibri/ColibriConferenceIQ.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/extensions/colibri/ColibriConferenceIQ.java @@ -54,6 +54,13 @@ public class ColibriConferenceIQ */ private final List contents = new LinkedList(); + /** + * The list of {@link ChannelBundle}s included into this conference + * IQ. + */ + private final List channelBundles + = new LinkedList(); + /** * The ID of the conference represented by this IQ. */ @@ -112,6 +119,22 @@ public boolean addContent(Content content) return contents.contains(content) ? false : contents.add(content); } + /** + * Adds a specific {@link Content} instance to the list of Content + * instances included into this conference IQ. + * @param the ChannelBundle to add. + */ + public boolean addChannelBundle(ChannelBundle channelBundle) + { + if (channelBundle == null) + throw new NullPointerException("channelBundle"); + + return channelBundles.contains(channelBundles) + ? false + : channelBundles.add(channelBundle); + + } + /** * Returns an XML String representation of this IQ. * @@ -132,12 +155,14 @@ public String getChildElementXML() .append('\''); List contents = getContents(); + List channelBundles = getChannelBundles(); - int childrenCount = contents.size(); - if (recording != null) - childrenCount++; + boolean hasChildren = recording != null + || rtcpTerminationStrategy != null + || contents.size() > 0 + || channelBundles.size() > 0; - if (childrenCount == 0) + if (!hasChildren) { xml.append(" />"); } @@ -146,6 +171,8 @@ public String getChildElementXML() xml.append('>'); for (Content content : contents) content.toXML(xml); + for (ChannelBundle channelBundle : channelBundles) + channelBundle.toXML(xml); if (recording != null) recording.toXML(xml); @@ -187,6 +214,18 @@ public List getContents() return Collections.unmodifiableList(contents); } + /** + * Returns a list of the ChannelBundles included into this + * conference IQ. + * + * @return an unmodifiable List of the ChannelBundles + * included into this conference IQ. + */ + public List getChannelBundles() + { + return Collections.unmodifiableList(channelBundles); + } + /** * Gets the ID of the conference represented by this IQ. * @@ -318,6 +357,12 @@ public static abstract class ChannelCommon */ public static final String EXPIRE_ATTR_NAME = "expire"; + /** + * The name of the "channel-bundle-id" attribute. + */ + public static final String CHANNEL_BUNDLE_ID_ATTR_NAME + = "channel-bundle-id"; + /** * The value of the expire property of * ColibriConferenceIQ.Channel which indicates that no actual @@ -359,6 +404,11 @@ public static abstract class ChannelCommon */ private String elementName; + /** + * The channel-bundle-id attribute of this CommonChannel. + */ + private String channelBundleId = null; + /** * Initializes this class with given XML elementName. * @param elementName XML element name to be used for producing XML @@ -414,6 +464,16 @@ public Boolean isInitiator() return initiator; } + /** + * Get the channel-bundle-id attribute of this CommonChannel. + * @return the channel-bundle-id attribute of this + * CommonChannel. + */ + public String getChannelBundleId() + { + return channelBundleId; + } + /** * Sets the identifier of the endpoint of the conference participant * associated with this Channel. @@ -465,6 +525,15 @@ public void setTransport(IceUdpTransportPacketExtension transport) this.transport = transport; } + /** + * Sets the channel-bundle-id attribute of this CommonChannel. + * @param channelBundleId the value to set. + */ + public void setChannelBundleId(String channelBundleId) + { + this.channelBundleId = channelBundleId; + } + /** * Derived class implements this method in order to print additional * attributes to main XML element. @@ -534,6 +603,13 @@ public void toXML(StringBuilder xml) .append(initiator).append('\''); } + String channelBundleId = getChannelBundleId(); + if (channelBundleId != null) + { + xml.append(' ').append(CHANNEL_BUNDLE_ID_ATTR_NAME) + .append("='").append(channelBundleId).append('\''); + } + // Print derived class attributes printAttributes(xml); @@ -582,6 +658,99 @@ public void toXML(StringBuilder xml) } } + /** + * Represents a "channel-bundle" element. + */ + public static class ChannelBundle + { + /** + * The name of the "channel-bundle" element. + */ + public static final String ELEMENT_NAME = "channel-bundle"; + + /** + * The name of the "id" attribute. + */ + public static final String ID_ATTR_NAME = "id"; + + /** + * The ID of this ChannelBundle. + */ + private String id; + + /** + * The transport element of this ChannelBundle. + */ + private IceUdpTransportPacketExtension transport; + + /** + * Initializes a new ChannelBundle with the given ID. + * @param id the ID. + */ + public ChannelBundle(String id) + { + this.id = id; + } + + /** + * Returns the transport element of this ChannelBundle. + * @return the transport element of this ChannelBundle. + */ + public IceUdpTransportPacketExtension getTransport() + { + return transport; + } + + /** + * Sets the transport element of this ChannelBundle. + * @param transport the transport to set. + */ + public void setTransport(IceUdpTransportPacketExtension transport) + { + this.transport = transport; + } + + /** + * Returns the ID of this ChannelBundle. + * @return the ID of this ChannelBundle. + */ + public String getId() + { + return id; + } + + /** + * Sets the ID of this ChannelBundle. + * @param id the ID to set. + */ + public void setId(String id) + { + this.id = id; + } + + /** + * Appends an XML representation of this ChannelBundle to + * xml. + * @param xml the StringBuilder to append to. + */ + public void toXML(StringBuilder xml) + { + xml.append('<').append(ELEMENT_NAME).append(' ') + .append(ID_ATTR_NAME).append("='").append(id).append('\''); + + if (transport != null) + { + xml.append('>'); + xml.append(transport.toXML()); + xml.append("'); + } + else + { + xml.append(" />"); + } + } + } + /** * Represents a channel included into a content of a Jitsi * Videobridge conference IQ. diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/extensions/colibri/ColibriIQProvider.java b/src/net/java/sip/communicator/impl/protocol/jabber/extensions/colibri/ColibriIQProvider.java index d5b2d37e6..8ce696733 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/extensions/colibri/ColibriIQProvider.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/extensions/colibri/ColibriIQProvider.java @@ -271,6 +271,14 @@ else if (ColibriConferenceIQ.Recording.ELEMENT_NAME.equals( if ((endpoint != null) && (endpoint.length() != 0)) channel.setEndpoint(endpoint); + String channelBundleId + = parser.getAttributeValue( + "", + ColibriConferenceIQ.ChannelCommon + .CHANNEL_BUNDLE_ID_ATTR_NAME); + if (!StringUtils.isNullOrEmpty(channelBundleId)) + channel.setChannelBundleId(channelBundleId); + // expire String expire = parser.getAttributeValue( @@ -438,9 +446,17 @@ else if (ColibriConferenceIQ.SctpConnection.ELEMENT_NAME = parser.getAttributeValue( "", ColibriConferenceIQ.SctpConnection.PORT_ATTR_NAME); - if(!StringUtils.isNullOrEmpty(port)) + if (!StringUtils.isNullOrEmpty(port)) sctpConnection.setPort(Integer.parseInt(port)); + String channelBundleId + = parser.getAttributeValue( + "", + ColibriConferenceIQ.ChannelCommon + .CHANNEL_BUNDLE_ID_ATTR_NAME); + if (!StringUtils.isNullOrEmpty(channelBundleId)) + sctpConnection.setChannelBundleId(channelBundleId); + // initiator String initiator = parser.getAttributeValue( diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/extensions/colibri/ColibriStatsExtension.java b/src/net/java/sip/communicator/impl/protocol/jabber/extensions/colibri/ColibriStatsExtension.java index ef23bb6e7..d264f170f 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/extensions/colibri/ColibriStatsExtension.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/extensions/colibri/ColibriStatsExtension.java @@ -14,15 +14,14 @@ import org.jivesoftware.smack.util.*; /** - * Implements the Jitsi Videobridge stats extension within the - * COnferencing with LIghtweight BRIdging that will provide various statistics. + * Implements the Jitsi Videobridge stats extension within COnferencing + * with LIghtweight BRIdging that will provide various statistics. * * @author Hristo Terezov */ public class ColibriStatsExtension extends AbstractPacketExtension { - /** * The XML element name of the Jitsi Videobridge stats extension. */ @@ -38,9 +37,9 @@ public class ColibriStatsExtension /** * Constructs new ColibriStatsExtension */ - public ColibriStatsExtension() { + public ColibriStatsExtension() + { super(NAMESPACE, ELEMENT_NAME); - } /** @@ -58,7 +57,8 @@ public List getChildExtensions() return Collections.unmodifiableList(super.getChildExtensions()); } - public static class Stat implements PacketExtension + public static class Stat + implements PacketExtension { /** * The XML element name of a content of a Jitsi Videobridge @@ -67,16 +67,16 @@ public static class Stat implements PacketExtension public static final String ELEMENT_NAME = "stat"; /** - * The XML name of the name attribute of a stat of - * a stats IQ which represents the name property - * of the statistic. + * The XML name of the name attribute of a stat of a + * stats IQ which represents the name property of the + * statistic. */ public static final String NAME_ATTR_NAME = "name"; /** - * The XML name of the name attribute of a stat of - * a stats IQ which represents the value property - * of the statistic. + * The XML name of the name attribute of a stat of a + * stats IQ which represents the value property of the + * statistic. */ public static final String VALUE_ATTR_NAME = "value"; @@ -90,7 +90,9 @@ public static class Stat implements PacketExtension */ private Object value; - public Stat() { } + public Stat() + { + } /** * Constructs new Stat by given name and value. @@ -103,6 +105,12 @@ public Stat(String name, Object value) this.setValue(value); } + @Override + public String getElementName() + { + return ELEMENT_NAME; + } + /** * @return the name */ @@ -111,12 +119,10 @@ public String getName() return name; } - /** - * @param name the name to set - */ - public void setName(String name) + @Override + public String getNamespace() { - this.name = name; + return NAMESPACE; } /** @@ -128,33 +134,39 @@ public Object getValue() } /** - * @param value the value to set + * @param name the name to set */ - public void setValue(Object value) + public void setName(String name) { - this.value = value; + this.name = name; } - public String toXML() + /** + * @param value the value to set + */ + public void setValue(Object value) { - if(name == null || value == null) - return ""; - - return "<" + ELEMENT_NAME + " " + NAME_ATTR_NAME + "='" + - StringUtils.escapeForXML(getName()) + "' " + VALUE_ATTR_NAME + - "='" + StringUtils.escapeForXML(getValue().toString()) + "' />"; + this.value = value; } @Override - public String getElementName() + public String toXML() { - return ELEMENT_NAME; - } + String name = getName(); + Object value = getValue(); - @Override - public String getNamespace() - { - return NAMESPACE; + if ((name == null) || (value == null)) + { + return ""; + } + else + { + return + "<" + ELEMENT_NAME + " " + NAME_ATTR_NAME + "='" + + StringUtils.escapeForXML(name) + "' " + + VALUE_ATTR_NAME + "='" + + StringUtils.escapeForXML(value.toString()) + "' />"; + } } } } diff --git a/src/net/java/sip/communicator/impl/protocol/sip/CallPeerMediaHandlerSipImpl.java b/src/net/java/sip/communicator/impl/protocol/sip/CallPeerMediaHandlerSipImpl.java index 6f6b98001..f7a84045c 100644 --- a/src/net/java/sip/communicator/impl/protocol/sip/CallPeerMediaHandlerSipImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/sip/CallPeerMediaHandlerSipImpl.java @@ -952,7 +952,7 @@ else if (remoteMd != null) // answer SrtpControlType.DTLS_SRTP); if (dtlsControl != null) - dtlsControl.cleanup(); + dtlsControl.cleanup(null); } } } @@ -1069,7 +1069,7 @@ private void updateSrtpControlsForDtls( else { srtpControls.remove(mediaType, SrtpControlType.DTLS_SRTP); - dtlsControl.cleanup(); + dtlsControl.cleanup(null); } } @@ -1149,7 +1149,7 @@ private boolean updateMediaDescriptionForSDes( else { // None of the offered suites match, destroy the SDES control. - sdesControl.cleanup(); + sdesControl.cleanup(null); srtpControls.remove(mediaType, SrtpControlType.SDES); logger.warn("Received unsupported sdes crypto attribute."); } @@ -1498,7 +1498,7 @@ private void doNonSynchronisedProcessAnswer(SessionDescription answer) sdesControl, mediaDescription) == null) { - sdesControl.cleanup(); + sdesControl.cleanup(null); srtpControls.remove(mediaType, SrtpControlType.SDES); logger.warn("Received unsupported sdes crypto attribute."); } diff --git a/src/net/java/sip/communicator/plugin/ircaccregwizz/IrcAccRegWizzActivator.java b/src/net/java/sip/communicator/plugin/ircaccregwizz/IrcAccRegWizzActivator.java index ae678be1a..d9f1c414f 100644 --- a/src/net/java/sip/communicator/plugin/ircaccregwizz/IrcAccRegWizzActivator.java +++ b/src/net/java/sip/communicator/plugin/ircaccregwizz/IrcAccRegWizzActivator.java @@ -87,7 +87,7 @@ public Class getDependentServiceClass() @Override public void setBundleContext(final BundleContext context) { - this.bundleContext = context; + IrcAccRegWizzActivator.bundleContext = context; } /** 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 f9edff48f..5caf298c7 100644 --- a/src/net/java/sip/communicator/service/protocol/media/CallPeerMediaHandler.java +++ b/src/net/java/sip/communicator/service/protocol/media/CallPeerMediaHandler.java @@ -1525,7 +1525,7 @@ protected void removeAndCleanupOtherSrtpControls( SrtpControl e = srtpControls.remove(mediaType, i); if (e != null) - e.cleanup(); + e.cleanup(null); } } }