Revision: 8657bb86785a
Author:   Sergey Vetyutnev <[email protected]>
Date:     Fri Aug  2 12:18:24 2013
Log:      Fixing CancelLocationRequest encoding bug
http://code.google.com/p/jss7/source/detail?r=8657bb86785a

Modified:
/map/map-api/src/main/java/org/mobicents/protocols/ss7/map/api/service/mobility/locationManagement/CancelLocationRequest.java /map/map-api/src/main/java/org/mobicents/protocols/ss7/map/api/service/mobility/locationManagement/CancellationType.java /map/map-impl/src/main/java/org/mobicents/protocols/ss7/map/service/mobility/locationManagement/CancelLocationRequestImpl.java /map/map-impl/src/test/java/org/mobicents/protocols/ss7/map/service/mobility/locationManagement/CancelLocationRequestTest.java

=======================================
--- /map/map-api/src/main/java/org/mobicents/protocols/ss7/map/api/service/mobility/locationManagement/CancelLocationRequest.java Mon May 20 13:09:00 2013 +++ /map/map-api/src/main/java/org/mobicents/protocols/ss7/map/api/service/mobility/locationManagement/CancelLocationRequest.java Fri Aug 2 12:18:24 2013
@@ -31,24 +31,50 @@
 /**
  *
  MAP V1-2-3:
- *
- * MAP V3: cancelLocation OPERATION ::= { --Timer m ARGUMENT CancelLocationArg RESULT CancelLocationRes -- optional ERRORS {
- * dataMissing | unexpectedDataValue} CODE local:3 }
- *
- * MAP V2: CancelLocation ::= OPERATION --Timer m ARGUMENT cancelLocationArg CancelLocationArg RESULT ERRORS { DataMissing, -- - * DataMissing must not be used in version 1 UnexpectedDataValue, UnidentifiedSubscriber} -- UnidentifiedSubscriber must not be
- * used in version -- greater 1
- *
- *
- * MAP V3: CancelLocationArg ::= [3] SEQUENCE { identity Identity, cancellationType CancellationType OPTIONAL, - * extensionContainer ExtensionContainer OPTIONAL, ..., typeOfUpdate [0] TypeOfUpdate OPTIONAL, mtrf-SupportedAndAuthorized [1] - * NULL OPTIONAL, mtrf-SupportedAndNotAuthorized [2] NULL OPTIONAL, newMSC-Number [3] ISDN-AddressString OPTIONAL, newVLR-Number - * [4] ISDN-AddressString OPTIONAL, new-lmsi [5] LMSI OPTIONAL } --mtrf-SupportedAndAuthorized and
- * mtrf-SupportedAndNotAuthorized shall not -- both be present
- *
- * MAP V2: CancelLocationArg ::= CHOICE { imsi IMSI, imsi-WithLMSI IMSI-WithLMSI }
- *
- * Identity ::= CHOICE { imsi IMSI, imsi-WithLMSI IMSI-WithLMSI}
+
+MAP V3: cancelLocation OPERATION ::= {
+-- Timer m
+ARGUMENT CancelLocationArg
+RESULT CancelLocationRes
+-- optional ERRORS { dataMissing | unexpectedDataValue }
+CODE local:3 }
+
+MAP V2: CancelLocation ::= OPERATION
+--Timer m
+ARGUMENT cancelLocationArg CancelLocationArg
+RESULT ERRORS {
+  DataMissing,
+  -- DataMissing must not be used in version 1
+  UnexpectedDataValue,
+  UnidentifiedSubscriber
+}
+-- UnidentifiedSubscriber must not be used in version greater 1
+
+
+MAP V3: CancelLocationArg ::= [3] SEQUENCE {
+  identity                       Identity,
+  cancellationType               CancellationType OPTIONAL,
+  extensionContainer             ExtensionContainer OPTIONAL,
+  ...,
+  typeOfUpdate                   [0] TypeOfUpdate OPTIONAL,
+  mtrf-SupportedAndAuthorized    [1] NULL OPTIONAL,
+  mtrf-SupportedAndNotAuthorized [2] NULL OPTIONAL,
+  newMSC-Number                  [3] ISDN-AddressString OPTIONAL,
+  newVLR-Number                  [4] ISDN-AddressString OPTIONAL,
+  new-lmsi                       [5] LMSI OPTIONAL
+}
+-- mtrf-SupportedAndAuthorized and mtrf-SupportedAndNotAuthorized shall not
+-- both be present
+
+MAP V2: CancelLocationArg ::= CHOICE {
+  imsi            IMSI,
+  imsi-WithLMSI   IMSI-WithLMSI
+}
+
+Identity ::= CHOICE {
+  imsi            IMSI,
+  imsi-WithLMSI   IMSI-WithLMSI
+}
  *
  *
  * @author sergey vetyutnev
=======================================
--- /map/map-api/src/main/java/org/mobicents/protocols/ss7/map/api/service/mobility/locationManagement/CancellationType.java Mon May 20 13:09:00 2013 +++ /map/map-api/src/main/java/org/mobicents/protocols/ss7/map/api/service/mobility/locationManagement/CancellationType.java Fri Aug 2 12:18:24 2013
@@ -24,8 +24,9 @@

 /**
  *
- CancellationType ::= ENUMERATED { updateProcedure (0), subscriptionWithdraw (1), ..., initialAttachProcedure (2)} -- The HLR
- * shall not send values other than listed above
+ CancellationType ::= ENUMERATED {
+ updateProcedure (0), subscriptionWithdraw (1), ..., initialAttachProcedure (2)}
+ -- The HLR shall not send values other than listed above
  *
  *
  * @author sergey vetyutnev
=======================================
--- /map/map-impl/src/main/java/org/mobicents/protocols/ss7/map/service/mobility/locationManagement/CancelLocationRequestImpl.java Mon May 20 13:09:00 2013 +++ /map/map-impl/src/main/java/org/mobicents/protocols/ss7/map/service/mobility/locationManagement/CancelLocationRequestImpl.java Fri Aug 2 12:18:24 2013
@@ -264,7 +264,7 @@
                     switch (ais.getTagClass()) {
                         case Tag.CLASS_UNIVERSAL:
                             switch (tag) {
-                                case Tag.INTEGER:
+                                case Tag.ENUMERATED:
                                     if (!ais.isTagPrimitive()) {
throw new MAPParsingComponentException("Error while decoding " + _PrimitiveName + ".cancellationType: is not primitive",
@@ -429,7 +429,7 @@

             if (this.cancellationType != null) {
                 try {
-                    asnOs.writeInteger(this.cancellationType.getCode());
+ asnOs.writeInteger(Tag.CLASS_UNIVERSAL, Tag.ENUMERATED, this.cancellationType.getCode());
                 } catch (IOException e) {
throw new MAPException("IOException while encoding " + _PrimitiveName + " parameter cancellationType", e);
                 } catch (AsnException e) {
=======================================
--- /map/map-impl/src/test/java/org/mobicents/protocols/ss7/map/service/mobility/locationManagement/CancelLocationRequestTest.java Mon May 20 13:09:00 2013 +++ /map/map-impl/src/test/java/org/mobicents/protocols/ss7/map/service/mobility/locationManagement/CancelLocationRequestTest.java Fri Aug 2 12:18:24 2013
@@ -59,16 +59,15 @@
 public class CancelLocationRequestTest {

     private byte[] getEncodedData() {
- return new byte[] { -93, 72, 4, 5, 17, 17, 33, 34, 34, 2, 1, 1, 48, 39, -96, 32, 48, 10, 6, 3, 42, 3, 4, 11, 12, 13, - 14, 15, 48, 5, 6, 3, 42, 3, 6, 48, 11, 6, 3, 42, 3, 5, 21, 22, 23, 24, 25, 26, -95, 3, 31, 32, 33, -128, 1, 0, - -125, 4, -111, 34, 34, -8, -124, 4, -111, 34, 34, -7, -123, 4, 0, 3, 98, 39 }; + return new byte[] { -93, 72, 4, 5, 17, 17, 33, 34, 34, 10, 1, 1, 48, 39, -96, 32, 48, 10, 6, 3, 42, 3, 4, 11, 12, 13, 14, 15, 48, 5, 6, 3, 42, 3, 6, + 48, 11, 6, 3, 42, 3, 5, 21, 22, 23, 24, 25, 26, -95, 3, 31, 32, 33, -128, 1, 0, -125, 4, -111, 34, 34, -8, -124, 4, -111, 34, 34, -7, -123, 4,
+                0, 3, 98, 39 };
     }

     private byte[] getEncodedData1() {
- return new byte[] { -93, 84, 48, 13, 4, 5, 17, 17, 33, 34, 34, 4, 4, 0, 3, 98, 39, 2, 1, 1, 48, 39, -96, 32, 48, 10, 6, - 3, 42, 3, 4, 11, 12, 13, 14, 15, 48, 5, 6, 3, 42, 3, 6, 48, 11, 6, 3, 42, 3, 5, 21, 22, 23, 24, 25, 26, -95, 3, - 31, 32, 33, -128, 1, 0, -127, 0, -126, 0, -125, 4, -111, 34, 34, -8, -124, 4, -111, 34, 34, -7, -123, 4, 0, 3,
-                98, 39 };
+ return new byte[] { -93, 84, 48, 13, 4, 5, 17, 17, 33, 34, 34, 4, 4, 0, 3, 98, 39, 10, 1, 1, 48, 39, -96, 32, 48, 10, 6, 3, 42, 3, 4, 11, 12, 13, 14, + 15, 48, 5, 6, 3, 42, 3, 6, 48, 11, 6, 3, 42, 3, 5, 21, 22, 23, 24, 25, 26, -95, 3, 31, 32, 33, -128, 1, 0, -127, 0, -126, 0, -125, 4, -111, 34,
+                34, -8, -124, 4, -111, 34, 34, -7, -123, 4, 0, 3, 98, 39 };
     }

     private byte[] getEncodedData2() {

--

--- You received this message because you are subscribed to the Google Groups "mobicents-commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to