Revision: 0a4f32064517
Author:   Sergey Vetyutnev <[email protected]>
Date:     Tue Jul 23 03:28:53 2013
Log:      PurgeMS - adding response optionality
http://code.google.com/p/jss7/source/detail?r=0a4f32064517

Modified:
 /map/MAPMessagesImplemented.ods
/map/map-api/src/main/java/org/mobicents/protocols/ss7/map/api/service/mobility/locationManagement/PurgeMSRequest.java /map/map-api/src/main/java/org/mobicents/protocols/ss7/map/api/service/mobility/locationManagement/PurgeMSResponse.java /map/map-impl/src/main/java/org/mobicents/protocols/ss7/map/service/mobility/MAPDialogMobilityImpl.java /map/map-impl/src/main/java/org/mobicents/protocols/ss7/map/service/mobility/MAPServiceMobilityImpl.java /map/map-impl/src/test/java/org/mobicents/protocols/ss7/map/functional/MAPFunctionalTest.java

=======================================
--- /map/MAPMessagesImplemented.ods     Tue Jun  4 14:56:02 2013
+++ /map/MAPMessagesImplemented.ods     Tue Jul 23 03:28:53 2013
Binary file, no diff available.
=======================================
--- /map/map-api/src/main/java/org/mobicents/protocols/ss7/map/api/service/mobility/locationManagement/PurgeMSRequest.java Mon May 20 13:09:00 2013 +++ /map/map-api/src/main/java/org/mobicents/protocols/ss7/map/api/service/mobility/locationManagement/PurgeMSRequest.java Tue Jul 23 03:28:53 2013
@@ -29,19 +29,34 @@

 /**
  *
- MAP V2-3:
- *
- * MAP V3: purgeMS OPERATION ::= { --Timer m ARGUMENT PurgeMS-Arg RESULT PurgeMS-Res -- optional ERRORS{ dataMissing |
- * unexpectedDataValue| unknownSubscriber} CODE local:67 }
- *
- * MAP V2: PurgeMS ::= OPERATION --Timer m ARGUMENT purgeMS-Arg PurgeMS-Arg RESULT
- *
- *
- * MAP V3: PurgeMS-Arg ::= [3] SEQUENCE { imsi IMSI, vlr-Number [0] ISDN-AddressString OPTIONAL, sgsn-Number [1] - * ISDN-AddressString OPTIONAL, extensionContainer ExtensionContainer OPTIONAL, ...}
- *
- * MAP V2: PurgeMS-Arg ::= SEQUENCE { imsi IMSI, vlr-Number ISDN-AddressString, ...}
- *
+MAP V2-3:
+
+MAP V3: purgeMS OPERATION ::= {
+--Timer m
+ARGUMENT PurgeMS-Arg RESULT
+  PurgeMS-Res  -- optional
+  ERRORS { dataMissing | unexpectedDataValue| unknownSubscriber}
+CODE local:67 }
+
+MAP V2: PurgeMS ::= OPERATION
+--Timer m
+ARGUMENT purgeMS-Arg PurgeMS-Arg
+RESULT
+
+MAP V3: PurgeMS-Arg ::= [3] SEQUENCE {
+  imsi         IMSI,
+  vlr-Number   [0] ISDN-AddressString OPTIONAL,
+  sgsn-Number  [1] ISDN-AddressString OPTIONAL,
+  extensionContainer ExtensionContainer OPTIONAL,
+  ...
+}
+
+MAP V2: PurgeMS-Arg ::= SEQUENCE {
+  imsi         IMSI,
+  vlr-Number   ISDN-AddressString,
+  ...
+}
+
  *
  * @author sergey vetyutnev
  *
=======================================
--- /map/map-api/src/main/java/org/mobicents/protocols/ss7/map/api/service/mobility/locationManagement/PurgeMSResponse.java Mon May 20 13:09:00 2013 +++ /map/map-api/src/main/java/org/mobicents/protocols/ss7/map/api/service/mobility/locationManagement/PurgeMSResponse.java Tue Jul 23 03:28:53 2013
@@ -27,8 +27,13 @@

 /**
  *
- MAP V3: PurgeMS-Res ::= SEQUENCE { freezeTMSI [0] NULL OPTIONAL, freezeP-TMSI [1] NULL OPTIONAL, extensionContainer
- * ExtensionContainer OPTIONAL, ..., freezeM-TMSI [2] NULL OPTIONAL }
+ MAP V3: PurgeMS-Res ::= SEQUENCE {
+   freezeTMSI         [0] NULL OPTIONAL,
+   freezeP-TMSI       [1] NULL OPTIONAL,
+   extensionContainer ExtensionContainer OPTIONAL,
+   ...,
+   freezeM-TMSI       [2] NULL OPTIONAL
+ }
  *
  *
  * @author sergey vetyutnev
=======================================
--- /map/map-impl/src/main/java/org/mobicents/protocols/ss7/map/service/mobility/MAPDialogMobilityImpl.java Fri Jul 19 11:37:01 2013 +++ /map/map-impl/src/main/java/org/mobicents/protocols/ss7/map/service/mobility/MAPDialogMobilityImpl.java Tue Jul 23 03:28:53 2013
@@ -1147,8 +1147,7 @@
MAPExtensionContainer extensionContainer, boolean freezeMTMSI) throws MAPException { if ((this.appCntx.getApplicationContextName() != MAPApplicationContextName.msPurgingContext) || ((this.appCntx.getApplicationContextVersion() != MAPApplicationContextVersion.version3) && (this.appCntx.getApplicationContextVersion() != MAPApplicationContextVersion.version2)))
-            throw new MAPException(
- "Bad application context name for PurgeMSResponse: must be msPurgingContext_V3 OR msPurgingContext_V2"); + throw new MAPException("Bad application context name for PurgeMSResponse: must be msPurgingContext_V3 OR msPurgingContext_V2");

ReturnResultLast resultLast = this.mapProviderImpl.getTCAPProvider().getComponentPrimitiveFactory()
                 .createTCResultLastRequest();
@@ -1160,17 +1159,19 @@
         oc.setLocalOperationCode((long) MAPOperationCode.purgeMS);
         resultLast.setOperationCode(oc);

- PurgeMSResponseImpl req = new PurgeMSResponseImpl(freezeTMSI, freezePTMSI, extensionContainer, freezeMTMSI); + PurgeMSResponseImpl resp = new PurgeMSResponseImpl(freezeTMSI, freezePTMSI, extensionContainer, freezeMTMSI);

-        AsnOutputStream aos = new AsnOutputStream();
-        req.encodeData(aos);
+ if (this.appCntx.getApplicationContextVersion().getVersion() >= 3 && (freezeTMSI || freezePTMSI || extensionContainer != null || freezeMTMSI)) {
+            AsnOutputStream aos = new AsnOutputStream();
+            resp.encodeData(aos);

- Parameter p = this.mapProviderImpl.getTCAPProvider().getComponentPrimitiveFactory().createParameter();
-        p.setTagClass(req.getTagClass());
-        p.setPrimitive(req.getIsPrimitive());
-        p.setTag(req.getTag());
-        p.setData(aos.toByteArray());
-        resultLast.setParameter(p);
+ Parameter p = this.mapProviderImpl.getTCAPProvider().getComponentPrimitiveFactory().createParameter();
+            p.setTagClass(resp.getTagClass());
+            p.setPrimitive(resp.getIsPrimitive());
+            p.setTag(resp.getTag());
+            p.setData(aos.toByteArray());
+            resultLast.setParameter(p);
+        }

         this.sendReturnResultLastComponent(resultLast);
     }
=======================================
--- /map/map-impl/src/main/java/org/mobicents/protocols/ss7/map/service/mobility/MAPServiceMobilityImpl.java Fri Jul 19 11:37:01 2013 +++ /map/map-impl/src/main/java/org/mobicents/protocols/ss7/map/service/mobility/MAPServiceMobilityImpl.java Tue Jul 23 03:28:53 2013
@@ -729,20 +729,16 @@

         PurgeMSResponseImpl ind = new PurgeMSResponseImpl();

-        if (parameter == null)
-            throw new MAPParsingComponentException(
- "Error while decoding PurgeMSResponse: Parameter is mandatory but not found",
-                    MAPParsingComponentExceptionReason.MistypedParameter);
-
- if (parameter.getTag() != Tag.SEQUENCE || parameter.getTagClass() != Tag.CLASS_UNIVERSAL || parameter.isPrimitive())
-            throw new MAPParsingComponentException(
- "Error while decoding PurgeMSResponse V3: Bad tag or tagClass or parameter is primitive, received tag=" - + parameter.getTag(), MAPParsingComponentExceptionReason.MistypedParameter);
+        if (parameter != null) {
+ if (parameter.getTag() != Tag.SEQUENCE || parameter.getTagClass() != Tag.CLASS_UNIVERSAL || parameter.isPrimitive()) + throw new MAPParsingComponentException("Error while decoding PurgeMSResponse V3: Bad tag or tagClass or parameter is primitive, received tag=" + + parameter.getTag(), MAPParsingComponentExceptionReason.MistypedParameter);

-        byte[] buf = parameter.getData();
-        AsnInputStream ais = new AsnInputStream(buf);
+            byte[] buf = parameter.getData();
+            AsnInputStream ais = new AsnInputStream(buf);

-        ind.decodeData(ais, buf.length);
+            ind.decodeData(ais, buf.length);
+        }

         ind.setInvokeId(invokeId);
         ind.setMAPDialog(mapDialogImpl);
=======================================
--- /map/map-impl/src/test/java/org/mobicents/protocols/ss7/map/functional/MAPFunctionalTest.java Fri Jul 19 11:37:01 2013 +++ /map/map-impl/src/test/java/org/mobicents/protocols/ss7/map/functional/MAPFunctionalTest.java Tue Jul 23 03:28:53 2013
@@ -199,7 +199,6 @@
import org.mobicents.protocols.ss7.map.service.mobility.authentication.TripletListTest; import org.mobicents.protocols.ss7.map.service.mobility.imei.CheckImeiRequestImpl; import org.mobicents.protocols.ss7.map.service.mobility.locationManagement.PurgeMSRequestImpl; -import org.mobicents.protocols.ss7.map.service.mobility.locationManagement.PurgeMSResponseImpl; import org.mobicents.protocols.ss7.map.service.mobility.locationManagement.SendIdentificationRequestImpl; import org.mobicents.protocols.ss7.map.service.mobility.locationManagement.UpdateGprsLocationRequestImpl; import org.mobicents.protocols.ss7.map.service.mobility.subscriberManagement.InsertSubscriberDataRequestImpl;
@@ -1195,7 +1194,7 @@
         List<TestEvent> serverExpectedEvents = new ArrayList<TestEvent>();

         server.mapProvider.getMAPServiceSms().deactivate();
-        this.saveTrafficInFile();
+//        this.saveTrafficInFile();

         client.sendAlertServiceCentreRequestV1();
         waitForEnd();
@@ -7199,7 +7198,7 @@
     }

     /**
-     * TC-BEGIN + PurgeMSRequest MAV V3 TC-END + PurgeMSResponse
+     * TC-BEGIN + PurgeMSRequest MAP V2 TC-END + PurgeMSResponse
      */
     @Test(groups = { "functional.flow", "dialog" })
     public void testPurgeMSRequest_V2() throws Exception {
@@ -7209,8 +7208,8 @@
             @Override
             public void onPurgeMSResponse(PurgeMSResponse ind) {
                 super.onPurgeMSResponse(ind);
-                assertTrue(ind.getFreezeMTMSI());
-                assertTrue(ind.getFreezePTMSI());
+                assertFalse(ind.getFreezeMTMSI());
+                assertFalse(ind.getFreezePTMSI());

             }

@@ -7228,7 +7227,7 @@
assertTrue(request.getVlrNumber().getAddress().equals("22228"));

                 try {
- d.addPurgeMSResponse(((PurgeMSRequestImpl) request).getInvokeId(), true, true, null, true); + d.addPurgeMSResponse(((PurgeMSRequestImpl) request).getInvokeId(), false, false, null, false);

                 } catch (MAPException e) {
                     this.error("Error while adding PurgeMSResponse", e);
@@ -7285,7 +7284,7 @@

te = TestEvent.createReceivedEvent(EventType.DialogRelease, null, count++, (stamp + _TCAP_DIALOG_RELEASE_TIMEOUT));
         serverExpectedEvents.add(te);
-
+
         client.sendPurgeMS_V2();

         waitForEnd();

--

--- 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