complete list of reasons

Daniel Gultsch created

Change summary

src/main/java/eu/siacs/conversations/xmpp/jingle/RtpContentMap.java  |  2 
src/main/java/eu/siacs/conversations/xmpp/jingle/stanzas/Reason.java | 43 
2 files changed, 32 insertions(+), 13 deletions(-)

Detailed changes

src/main/java/eu/siacs/conversations/xmpp/jingle/RtpContentMap.java 🔗

@@ -120,11 +120,13 @@ public class RtpContentMap {
                 rtpDescription = (RtpDescription) description;
             } else {
                 Log.d(Config.LOGTAG, "description was " + description);
+                //todo throw unsupported application
                 throw new IllegalArgumentException("Content does not contain RtpDescription");
             }
             if (transportInfo instanceof IceUdpTransportInfo) {
                 iceUdpTransportInfo = (IceUdpTransportInfo) transportInfo;
             } else {
+                //TODO throw UNSUPPORTED_TRANSPORT exception
                 throw new IllegalArgumentException("Content does not contain ICE-UDP transport");
             }
             return new DescriptionTransport(rtpDescription, iceUdpTransportInfo);

src/main/java/eu/siacs/conversations/xmpp/jingle/stanzas/Reason.java 🔗

@@ -5,19 +5,36 @@ import android.support.annotation.NonNull;
 import com.google.common.base.CaseFormat;
 
 public enum Reason {
-	SUCCESS, DECLINE, BUSY, CANCEL, CONNECTIVITY_ERROR, FAILED_TRANSPORT, FAILED_APPLICATION, TIMEOUT, UNKNOWN;
+    ALTERNATIVE_SESSION,
+    BUSY,
+    CANCEL,
+    CONNECTIVITY_ERROR,
+    DECLINE,
+    EXPIRED,
+    FAILED_APPLICATION,
+    FAILED_TRANSPORT,
+    GENERAL_ERROR,
+    GONE,
+    INCOMPATIBLE_PARAMETERS,
+    MEDIA_ERROR,
+    SECURITY_ERROR,
+    SUCCESS,
+    TIMEOUT,
+    UNSUPPORTED_APPLICATIONS,
+    UNSUPPORTED_TRANSPORTS,
+    UNKNOWN;
 
-	public static Reason of(final String value) {
-		try {
-			return Reason.valueOf(CaseFormat.LOWER_HYPHEN.to(CaseFormat.UPPER_UNDERSCORE, value));
-		} catch (Exception e) {
-			return UNKNOWN;
-		}
-	}
+    public static Reason of(final String value) {
+        try {
+            return Reason.valueOf(CaseFormat.LOWER_HYPHEN.to(CaseFormat.UPPER_UNDERSCORE, value));
+        } catch (Exception e) {
+            return UNKNOWN;
+        }
+    }
 
-	@Override
-	@NonNull
-	public String toString() {
-		return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_HYPHEN, super.toString());
-	}
+    @Override
+    @NonNull
+    public String toString() {
+        return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_HYPHEN, super.toString());
+    }
 }