diff options
author | George Politis <gp@jitsi.org> | 2014-07-07 08:13:55 +0200 |
---|---|---|
committer | Georgios Politis <gp@mu> | 2014-07-15 16:55:28 +0200 |
commit | 23504ed55bb05a4fb191681f774958e501abc5c5 (patch) | |
tree | bce08a53ab2074a191fffedc8052fa3c4544e489 /src | |
parent | f42f2953b32b8243d38f1e1300d7bb3285e371ce (diff) | |
download | jitsi-23504ed55bb05a4fb191681f774958e501abc5c5.zip jitsi-23504ed55bb05a4fb191681f774958e501abc5c5.tar.gz jitsi-23504ed55bb05a4fb191681f774958e501abc5c5.tar.bz2 |
Extends the ColibriConferenceIQ to make it possible to specify the RTCP termination strategy to be used in a COLIBRI conference
Diffstat (limited to 'src')
2 files changed, 70 insertions, 0 deletions
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 60b7153..a478e7a 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 @@ -64,6 +64,8 @@ public class ColibriConferenceIQ */ public Recording recording = null; + private RTCPTerminationStrategy rtcpTerminationStrategy = null; + /** Initializes a new <tt>ColibriConferenceIQ</tt> instance. */ public ColibriConferenceIQ() { @@ -141,6 +143,10 @@ public class ColibriConferenceIQ content.toXML(xml); if (recording != null) recording.toXML(xml); + + if (rtcpTerminationStrategy != null) + rtcpTerminationStrategy.toXML(xml); + xml.append("</").append(ELEMENT_NAME).append('>'); } return xml.toString(); @@ -253,6 +259,16 @@ public class ColibriConferenceIQ this.id = id; } + public RTCPTerminationStrategy getRTCPTerminationStrategy() + { + return rtcpTerminationStrategy; + } + + public void setRTCPTerminationStrategy(RTCPTerminationStrategy rtcpTerminationStrategy) + { + this.rtcpTerminationStrategy = rtcpTerminationStrategy; + } + /** * Class contains common code for both <tt>Channel</tt> and * <tt>SctpConnection</tt> IQ classes. @@ -515,6 +531,33 @@ public class ColibriConferenceIQ } } + public static class RTCPTerminationStrategy + { + + public static final String ELEMENT_NAME = "rtcp-termination-strategy"; + public static final String NAME_ATTR_NAME = "name"; + + private String name; + + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + + public void toXML(StringBuilder xml) + { + xml.append('<').append(ELEMENT_NAME); + xml.append(' ').append(NAME_ATTR_NAME).append("='") + .append(name).append('\''); + xml.append("/>"); + } + } + /** * Represents a <tt>channel</tt> included into a <tt>content</tt> of a Jitsi * Videobridge <tt>conference</tt> 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 ec1c182..2e12c19 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 @@ -158,6 +158,8 @@ public class ColibriIQProvider boolean done = false; ColibriConferenceIQ.Channel channel = null; + ColibriConferenceIQ.RTCPTerminationStrategy rtcpTerminationStrategy + = null; ColibriConferenceIQ.SctpConnection sctpConnection = null; ColibriConferenceIQ.Content content = null; ColibriConferenceIQ.Recording recording = null; @@ -215,6 +217,13 @@ public class ColibriIQProvider conference.addContent(content); content = null; } + else if (ColibriConferenceIQ.RTCPTerminationStrategy + .ELEMENT_NAME.equals(name)) + { + conference.setRTCPTerminationStrategy( + rtcpTerminationStrategy); + rtcpTerminationStrategy = null; + } else if (ColibriConferenceIQ.Recording.ELEMENT_NAME.equals( name)) { @@ -336,6 +345,24 @@ public class ColibriIQProvider if ((rtpPort != null) && (rtpPort.length() != 0)) channel.setRTPPort(Integer.parseInt(rtpPort)); } + else if (ColibriConferenceIQ.RTCPTerminationStrategy + .ELEMENT_NAME.equals(name)) + { + rtcpTerminationStrategy = + new ColibriConferenceIQ.RTCPTerminationStrategy(); + + // name + String strategyName + = parser.getAttributeValue( + "", + ColibriConferenceIQ.RTCPTerminationStrategy + .NAME_ATTR_NAME); + + if ((strategyName != null) + && (strategyName.length() != 0)) + rtcpTerminationStrategy.setName(strategyName); + + } else if (ColibriConferenceIQ.Channel.SSRC_ELEMENT_NAME .equals(name)) { |