aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/impl
diff options
context:
space:
mode:
authorpaweldomas <pawel.domas@jitsi.org>2015-05-12 13:39:14 +0200
committerpaweldomas <pawel.domas@jitsi.org>2015-05-12 13:39:14 +0200
commitb690322e6ba1ae7d2708d418eb1513e2f6063451 (patch)
tree39c8e653d8d7363f97e66b7ad298eb05704ef072 /src/net/java/sip/communicator/impl
parent826df1b6002d4ad280af5953cab871bc5341f0c1 (diff)
downloadjitsi-b690322e6ba1ae7d2708d418eb1513e2f6063451.zip
jitsi-b690322e6ba1ae7d2708d418eb1513e2f6063451.tar.gz
jitsi-b690322e6ba1ae7d2708d418eb1513e2f6063451.tar.bz2
Adds utility method to SourcePacketExtension. Does not throw IllegalArgumentException when invalid JingleAction is received in order to avoid interrupting of XMPP connection(caused by unhandled Exception).
Diffstat (limited to 'src/net/java/sip/communicator/impl')
-rw-r--r--src/net/java/sip/communicator/impl/protocol/jabber/extensions/colibri/SourcePacketExtension.java15
-rw-r--r--src/net/java/sip/communicator/impl/protocol/jabber/extensions/jingle/JingleAction.java10
2 files changed, 18 insertions, 7 deletions
diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/extensions/colibri/SourcePacketExtension.java b/src/net/java/sip/communicator/impl/protocol/jabber/extensions/colibri/SourcePacketExtension.java
index a852a9d..87bd597 100644
--- a/src/net/java/sip/communicator/impl/protocol/jabber/extensions/colibri/SourcePacketExtension.java
+++ b/src/net/java/sip/communicator/impl/protocol/jabber/extensions/colibri/SourcePacketExtension.java
@@ -70,6 +70,21 @@ public class SourcePacketExtension
}
/**
+ * Finds the value of SSRC parameter identified by given name.
+ * @param name the name of SSRC parameter to find.
+ * @return value of SSRC parameter
+ */
+ public String getParameter(String name)
+ {
+ for (ParameterPacketExtension param : getParameters())
+ {
+ if (name.equals(param.getName()))
+ return param.getValue();
+ }
+ return null;
+ }
+
+ /**
* Gets the synchronization source (SSRC) ID of this source.
*
* @return the synchronization source (SSRC) ID of this source
diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/extensions/jingle/JingleAction.java b/src/net/java/sip/communicator/impl/protocol/jabber/extensions/jingle/JingleAction.java
index 2e55fce..c00940b 100644
--- a/src/net/java/sip/communicator/impl/protocol/jabber/extensions/jingle/JingleAction.java
+++ b/src/net/java/sip/communicator/impl/protocol/jabber/extensions/jingle/JingleAction.java
@@ -213,19 +213,15 @@ public enum JingleAction
* @param jingleActionStr the action <tt>String</tt> that we'd like to
* parse.
* @return a <tt>JingleAction</tt> value corresponding to the specified
- * <tt>jingleActionStr</tt>.
- *
- * @throws IllegalArgumentException in case <tt>jingleActionStr</tt> is
- * not a valid media direction.
+ * <tt>jingleActionStr</tt> or <tt>null</tt> if given <tt>String</tt> can
+ * not be matched with any of enumeration values.
*/
public static JingleAction parseString(String jingleActionStr)
- throws IllegalArgumentException
{
for (JingleAction value : values())
if (value.toString().equals(jingleActionStr))
return value;
- throw new IllegalArgumentException(
- jingleActionStr + " is not a valid jingle action");
+ return null;
}
}