From 2c2407ccf8da5f60bde6efc415696958ee47ff3d Mon Sep 17 00:00:00 2001 From: Rodin Andrey Date: Mon, 8 Feb 2021 16:46:40 +0200 Subject: [PATCH] #329 Fix problem with decoding/encoding UserCause in DUPU packets --- .../m3ua/impl/parameter/UserCauseImpl.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/m3ua/impl/src/main/java/org/restcomm/protocols/ss7/m3ua/impl/parameter/UserCauseImpl.java b/m3ua/impl/src/main/java/org/restcomm/protocols/ss7/m3ua/impl/parameter/UserCauseImpl.java index 72c4b47d39..521f44bb14 100644 --- a/m3ua/impl/src/main/java/org/restcomm/protocols/ss7/m3ua/impl/parameter/UserCauseImpl.java +++ b/m3ua/impl/src/main/java/org/restcomm/protocols/ss7/m3ua/impl/parameter/UserCauseImpl.java @@ -40,15 +40,15 @@ public class UserCauseImpl extends ParameterImpl implements UserCause { protected UserCauseImpl(byte[] value) { this.tag = Parameter.User_Cause; - this.user = 0; - this.user |= value[0] & 0xFF; - this.user <<= 8; - this.user |= value[1] & 0xFF; - this.cause = 0; - this.cause |= value[2] & 0xFF; + this.cause |= value[0] & 0xFF; this.cause <<= 8; - this.cause |= value[3] & 0xFF; + this.cause |= value[1] & 0xFF; + + this.user = 0; + this.user |= value[2] & 0xFF; + this.user <<= 8; + this.user |= value[3] & 0xFF; this.value = value; } @@ -65,11 +65,11 @@ private void encode() { // indicators; this.value = new byte[4]; // encode routing context - value[0] = (byte) (this.user >> 8); - value[1] = (byte) (this.user); + value[0] = (byte) (this.cause >> 8); + value[1] = (byte) (this.cause); - value[2] = (byte) (this.cause >> 8); - value[3] = (byte) (this.cause); + value[2] = (byte) (this.user >> 8); + value[3] = (byte) (this.user); }