2 new revisions:

Revision: c0883204e864
Author:   Sergey Vetyutnev <[email protected]>
Date:     Thu Jul 18 12:14:42 2013
Log:      TCAP ANSI FunctionalTest update
http://code.google.com/p/jss7/source/detail?r=c0883204e864

Revision: bf37f76bb13a
Author:   Sergey Vetyutnev <[email protected]>
Date:     Fri Jul 19 09:59:05 2013
Log: TCAP option: do not send ProtocolVersion in Request, Response and Uni...
http://code.google.com/p/jss7/source/detail?r=bf37f76bb13a

==============================================================================
Revision: c0883204e864
Author:   Sergey Vetyutnev <[email protected]>
Date:     Thu Jul 18 12:14:42 2013
Log:      TCAP ANSI FunctionalTest update
http://code.google.com/p/jss7/source/detail?r=c0883204e864

Modified:
/tcap-ansi/tcap-ansi-impl/src/test/java/org/mobicents/protocols/ss7/tcapAnsi/Client.java /tcap-ansi/tcap-ansi-impl/src/test/java/org/mobicents/protocols/ss7/tcapAnsi/Server.java /tcap-ansi/tcap-ansi-impl/src/test/java/org/mobicents/protocols/ss7/tcapAnsi/TCAPFunctionalTest.java

=======================================
--- /tcap-ansi/tcap-ansi-impl/src/test/java/org/mobicents/protocols/ss7/tcapAnsi/Client.java Mon Jul 15 06:53:19 2013 +++ /tcap-ansi/tcap-ansi-impl/src/test/java/org/mobicents/protocols/ss7/tcapAnsi/Client.java Thu Jul 18 12:14:42 2013
@@ -66,7 +66,7 @@
Invoke invoke = cpFactory.createTCInvokeRequestNotLast(InvokeClass.Class1);
         invoke.setInvokeId(this.dialog.getNewInvokeId());
         OperationCode oc = cpFactory.createOperationCode();
-        oc.setNationalOperationCode(12L);
+        oc.setPrivateOperationCode(12L);
         invoke.setOperationCode(oc);
         // no parameter
         this.dialog.sendComponent(invoke);
@@ -75,7 +75,7 @@
         invoke = cpFactory.createTCInvokeRequestLast(InvokeClass.Class1);
         invoke.setInvokeId(this.dialog.getNewInvokeId());
         oc = cpFactory.createOperationCode();
-        oc.setNationalOperationCode(13L);
+        oc.setPrivateOperationCode(13L);
         invoke.setOperationCode(oc);
         // no parameter
         this.dialog.sendComponent(invoke);
@@ -115,7 +115,7 @@

         OperationCode oc = TcapFactory.createOperationCode();

-        oc.setNationalOperationCode(59L);
+        oc.setPrivateOperationCode(59L);
         invoke.setOperationCode(oc);

         Parameter p1 = TcapFactory.createParameter();
@@ -144,7 +144,7 @@
Invoke invoke = this.tcapProvider.getComponentPrimitiveFactory().createTCInvokeRequestNotLast();
             invoke.setInvokeId(invokeId);
OperationCode opCode = this.tcapProvider.getComponentPrimitiveFactory().createOperationCode();
-            opCode.setNationalOperationCode(0L);
+            opCode.setPrivateOperationCode(0L);
             invoke.setOperationCode(opCode);
             this.dialog.sendComponent(invoke);
         }
=======================================
--- /tcap-ansi/tcap-ansi-impl/src/test/java/org/mobicents/protocols/ss7/tcapAnsi/Server.java Mon Jul 15 06:53:19 2013 +++ /tcap-ansi/tcap-ansi-impl/src/test/java/org/mobicents/protocols/ss7/tcapAnsi/Server.java Thu Jul 18 12:14:42 2013
@@ -80,7 +80,7 @@
         super.dialog.sendComponent(rrlast);

         c = comps[1];
-        if (c.getType() != ComponentType.InvokeNotLast) {
+        if (c.getType() != ComponentType.InvokeLast) {
             throw new TCAPSendException("Bad type: " + c.getType());
         }

@@ -90,7 +90,7 @@
         invoke2.setInvokeId(this.dialog.getNewInvokeId());
         invoke2.setCorrelationId(invoke.getInvokeId());
OperationCode oc = this.tcapProvider.getComponentPrimitiveFactory().createOperationCode();
-        oc.setNationalOperationCode(14L);
+        oc.setPrivateOperationCode(14L);
         invoke2.setOperationCode(oc);
         // no parameter
         this.dialog.sendComponent(invoke2);
=======================================
--- /tcap-ansi/tcap-ansi-impl/src/test/java/org/mobicents/protocols/ss7/tcapAnsi/TCAPFunctionalTest.java Sun Jul 7 08:39:29 2013 +++ /tcap-ansi/tcap-ansi-impl/src/test/java/org/mobicents/protocols/ss7/tcapAnsi/TCAPFunctionalTest.java Thu Jul 18 12:14:42 2013
@@ -22,10 +22,7 @@

 package org.mobicents.protocols.ss7.tcapAnsi;

-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertNull;
-import static org.testng.Assert.fail;
+import static org.testng.Assert.*;

 import java.util.ArrayList;
 import java.util.List;
@@ -93,26 +90,26 @@
      */
     @BeforeMethod
     public void setUp() throws Exception {
-//        System.out.println("setUp");
-//        super.setUp();
-//
-// peer1Address = new SccpAddress(RoutingIndicator.ROUTING_BASED_ON_DPC_AND_SSN, 1, null, 8); -// peer2Address = new SccpAddress(RoutingIndicator.ROUTING_BASED_ON_DPC_AND_SSN, 2, null, 8);
-//
-//        this.tcapStack1 = new TCAPStackImpl(this.sccpProvider1, 8);
-//        this.tcapStack2 = new TCAPStackImpl(this.sccpProvider2, 8);
-//
-//        this.tcapListenerWrapper = new TCAPListenerWrapper();
-//        this.tcapStack1.getProvider().addTCListener(tcapListenerWrapper);
-//
-//        this.tcapStack1.setInvokeTimeout(0);
-//        this.tcapStack2.setInvokeTimeout(0);
-//
-//        this.tcapStack1.start();
-//        this.tcapStack2.start();
-//        // create test classes
-// this.client = new Client(this.tcapStack1, peer1Address, peer2Address); -// this.server = new Server(this.tcapStack2, peer2Address, peer1Address);
+        System.out.println("setUp");
+        super.setUp();
+
+ peer1Address = new SccpAddress(RoutingIndicator.ROUTING_BASED_ON_DPC_AND_SSN, 1, null, 8); + peer2Address = new SccpAddress(RoutingIndicator.ROUTING_BASED_ON_DPC_AND_SSN, 2, null, 8);
+
+        this.tcapStack1 = new TCAPStackImpl(this.sccpProvider1, 8);
+        this.tcapStack2 = new TCAPStackImpl(this.sccpProvider2, 8);
+
+        this.tcapListenerWrapper = new TCAPListenerWrapper();
+        this.tcapStack1.getProvider().addTCListener(tcapListenerWrapper);
+
+        this.tcapStack1.setInvokeTimeout(0);
+        this.tcapStack2.setInvokeTimeout(0);
+
+        this.tcapStack1.start();
+        this.tcapStack2.start();
+        // create test classes
+ this.client = new Client(this.tcapStack1, peer1Address, peer2Address); + this.server = new Server(this.tcapStack2, peer2Address, peer1Address);

     }

@@ -123,84 +120,85 @@
      */
     @AfterMethod
     public void tearDown() {
-//        this.tcapStack1.stop();
-//        this.tcapStack2.stop();
-//        super.tearDown();
+        this.tcapStack1.stop();
+        this.tcapStack2.stop();
+        super.tearDown();

     }

     @Test(groups = { "functional.flow" })
     public void simpleTCWithDialogTest() throws Exception {

-//        long stamp = System.currentTimeMillis();
-// List<TestEvent> clientExpectedEvents = new ArrayList<TestEvent>(); -// TestEvent te = TestEvent.createSentEvent(EventType.Begin, null, 0, stamp);
-//        clientExpectedEvents.add(te);
-// te = TestEvent.createReceivedEvent(EventType.Continue, null, 1, stamp + WAIT_TIME);
-//        clientExpectedEvents.add(te);
-// te = TestEvent.createSentEvent(EventType.End, null, 2, stamp + WAIT_TIME * 2);
-//        clientExpectedEvents.add(te);
-// // te = TestEvent.createReceivedEvent(EventType.DialogRelease, null, 3,stamp+WAIT_TIME*2+_WAIT_REMOVE); -// te = TestEvent.createReceivedEvent(EventType.DialogRelease, null, 3, stamp + WAIT_TIME * 2);
-//        clientExpectedEvents.add(te);
-//
-// List<TestEvent> serverExpectedEvents = new ArrayList<TestEvent>(); -// te = TestEvent.createReceivedEvent(EventType.Begin, null, 0, stamp);
-//        serverExpectedEvents.add(te);
-// te = TestEvent.createSentEvent(EventType.Continue, null, 1, stamp + WAIT_TIME);
-//        serverExpectedEvents.add(te);
-// te = TestEvent.createReceivedEvent(EventType.End, null, 2, stamp + WAIT_TIME * 2);
-//        serverExpectedEvents.add(te);
-// // te = TestEvent.createReceivedEvent(EventType.DialogRelease, null, 3,stamp+WAIT_TIME*2+_WAIT_REMOVE); -// te = TestEvent.createReceivedEvent(EventType.DialogRelease, null, 3, stamp + WAIT_TIME * 2);
-//        serverExpectedEvents.add(te);
-//
-//        client.startClientDialog();
-//        assertNotNull(client.dialog.getLocalAddress());
-//        assertNull(client.dialog.getRemoteDialogId());
-//
-//        client.sendBegin();
-//        client.waitFor(WAIT_TIME);
-//
-//        server.sendContinue();
-//        assertNotNull(server.dialog.getLocalAddress());
-//        assertNotNull(server.dialog.getRemoteDialogId());
-//
-//        client.waitFor(WAIT_TIME);
-//        client.sendEnd(TerminationType.Basic);
-//        assertNotNull(client.dialog.getLocalAddress());
-//        assertNotNull(client.dialog.getRemoteDialogId());
-//
-//        client.waitFor(WAIT_TIME);
-//        // waitForEnd();
-//
-//        client.compareEvents(clientExpectedEvents);
-//        server.compareEvents(serverExpectedEvents);
+        long stamp = System.currentTimeMillis();
+        List<TestEvent> clientExpectedEvents = new ArrayList<TestEvent>();
+ TestEvent te = TestEvent.createSentEvent(EventType.Begin, null, 0, stamp);
+        clientExpectedEvents.add(te);
+ te = TestEvent.createReceivedEvent(EventType.Continue, null, 1, stamp + WAIT_TIME);
+        clientExpectedEvents.add(te);
+ te = TestEvent.createSentEvent(EventType.End, null, 2, stamp + WAIT_TIME * 2);
+        clientExpectedEvents.add(te);
+ // te = TestEvent.createReceivedEvent(EventType.DialogRelease, null, 3,stamp+WAIT_TIME*2+_WAIT_REMOVE); + te = TestEvent.createReceivedEvent(EventType.DialogRelease, null, 3, stamp + WAIT_TIME * 2);
+        clientExpectedEvents.add(te);
+
+        List<TestEvent> serverExpectedEvents = new ArrayList<TestEvent>();
+ te = TestEvent.createReceivedEvent(EventType.Begin, null, 0, stamp);
+        serverExpectedEvents.add(te);
+ te = TestEvent.createSentEvent(EventType.Continue, null, 1, stamp + WAIT_TIME);
+        serverExpectedEvents.add(te);
+ te = TestEvent.createReceivedEvent(EventType.End, null, 2, stamp + WAIT_TIME * 2);
+        serverExpectedEvents.add(te);
+ // te = TestEvent.createReceivedEvent(EventType.DialogRelease, null, 3,stamp+WAIT_TIME*2+_WAIT_REMOVE); + te = TestEvent.createReceivedEvent(EventType.DialogRelease, null, 3, stamp + WAIT_TIME * 2);
+        serverExpectedEvents.add(te);
+
+        client.startClientDialog();
+        assertNotNull(client.dialog.getLocalAddress());
+        assertNull(client.dialog.getRemoteDialogId());
+
+        client.sendBegin();
+        client.waitFor(WAIT_TIME);
+
+        server.sendContinue();
+        assertNotNull(server.dialog.getLocalAddress());
+        assertNotNull(server.dialog.getRemoteDialogId());
+
+        client.waitFor(WAIT_TIME);
+        client.dialog.sendComponent(client.createNewInvoke());
+        client.sendEnd();
+        assertNotNull(client.dialog.getLocalAddress());
+        assertNotNull(client.dialog.getRemoteDialogId());
+
+        client.waitFor(WAIT_TIME);
+        // waitForEnd();
+
+        client.compareEvents(clientExpectedEvents);
+        server.compareEvents(serverExpectedEvents);

     }

     @Test(groups = { "functional.flow" })
     public void uniMsgTest() throws Exception {

-//        long stamp = System.currentTimeMillis();
-// List<TestEvent> clientExpectedEvents = new ArrayList<TestEvent>(); -// TestEvent te = TestEvent.createSentEvent(EventType.Uni, null, 0, stamp);
-//        clientExpectedEvents.add(te);
-// te = TestEvent.createReceivedEvent(EventType.DialogRelease, null, 1, stamp);
-//        clientExpectedEvents.add(te);
-//
-// List<TestEvent> serverExpectedEvents = new ArrayList<TestEvent>(); -// te = TestEvent.createReceivedEvent(EventType.Uni, null, 0, stamp);
-//        serverExpectedEvents.add(te);
-// te = TestEvent.createReceivedEvent(EventType.DialogRelease, null, 1, stamp);
-//        serverExpectedEvents.add(te);
-//
-//        client.startUniDialog();
-//        client.sendUni();
-//        client.waitFor(WAIT_TIME);
-//
-//        client.compareEvents(clientExpectedEvents);
-//        server.compareEvents(serverExpectedEvents);
+        long stamp = System.currentTimeMillis();
+        List<TestEvent> clientExpectedEvents = new ArrayList<TestEvent>();
+ TestEvent te = TestEvent.createSentEvent(EventType.Uni, null, 0, stamp);
+        clientExpectedEvents.add(te);
+ te = TestEvent.createReceivedEvent(EventType.DialogRelease, null, 1, stamp);
+        clientExpectedEvents.add(te);
+
+        List<TestEvent> serverExpectedEvents = new ArrayList<TestEvent>();
+        te = TestEvent.createReceivedEvent(EventType.Uni, null, 0, stamp);
+        serverExpectedEvents.add(te);
+ te = TestEvent.createReceivedEvent(EventType.DialogRelease, null, 1, stamp);
+        serverExpectedEvents.add(te);
+
+        client.startUniDialog();
+        client.sendUni();
+        client.waitFor(WAIT_TIME);
+
+        client.compareEvents(clientExpectedEvents);
+        server.compareEvents(serverExpectedEvents);

     }

@@ -228,23 +226,23 @@

         @Override
         public void onTCConversation(TCConversationIndication ind) {
-//            assertEquals(ind.getComponents().length, 2);
-// ReturnResultLast rrl = (ReturnResultLast) ind.getComponents()[0];
-//            Invoke inv = (Invoke) ind.getComponents()[1];
-//
-// // operationCode is not sent via ReturnResultLast because it does not contain a Parameter
-//            // so operationCode is taken from a sent Invoke
-//            assertEquals((long) rrl.getInvokeId(), 1);
-// assertEquals((long) rrl.getOperationCode().getLocalOperationCode(), 12);
-//
-// // second Invoke has its own operationCode and it has linkedId to the second sent Invoke
-//            assertEquals((long) inv.getInvokeId(), 1);
-// assertEquals((long) inv.getOperationCode().getLocalOperationCode(), 14);
-//            assertEquals((long) inv.getLinkedId(), 2);
-//
-//            // we should see operationCode of the second sent Invoke
-//            Invoke linkedInv = inv.getLinkedInvoke();
-// assertEquals((long) linkedInv.getOperationCode().getLocalOperationCode(), 13);
+            assertEquals(ind.getComponents().length, 2);
+ ReturnResultLast rrl = (ReturnResultLast) ind.getComponents()[0];
+            Invoke inv = (Invoke) ind.getComponents()[1];
+
+ // operationCode is not sent via ReturnResultLast because it does not contain a Parameter
+            // so operationCode is taken from a sent Invoke
+            assertEquals((long) rrl.getCorrelationId(), 1);
+ assertEquals((long) rrl.getOperationCode().getPrivateOperationCode(), 12);
+
+ // second Invoke has its own operationCode and it has linkedId to the second sent Invoke
+            assertEquals((long) inv.getInvokeId(), 1);
+ assertEquals((long) inv.getOperationCode().getPrivateOperationCode(), 14);
+            assertEquals((long) inv.getCorrelationId(), 2);
+
+            // we should see operationCode of the second sent Invoke
+            Invoke linkedInv = inv.getCorrelationInvoke();
+ assertEquals((long) linkedInv.getOperationCode().getPrivateOperationCode(), 13);
         }

         @Override

==============================================================================
Revision: bf37f76bb13a
Author:   Sergey Vetyutnev <[email protected]>
Date:     Fri Jul 19 09:59:05 2013
Log: TCAP option: do not send ProtocolVersion in Request, Response and Uni
tpdu
http://code.google.com/p/jss7/source/detail?r=bf37f76bb13a

Modified:
/tcap/tcap-api/src/main/java/org/mobicents/protocols/ss7/tcap/api/TCAPStack.java /tcap/tcap-api/src/main/java/org/mobicents/protocols/ss7/tcap/asn/DialogRequestAPDU.java /tcap/tcap-api/src/main/java/org/mobicents/protocols/ss7/tcap/asn/DialogResponseAPDU.java /tcap/tcap-api/src/main/java/org/mobicents/protocols/ss7/tcap/asn/DialogUniAPDU.java /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/DialogImpl.java /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/TCAPProviderImpl.java /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/TCAPStackImpl.java /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/asn/DialogRequestAPDUImpl.java /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/asn/DialogResponseAPDUImpl.java /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/asn/DialogUniAPDUImpl.java /tcap/tcap-impl/src/test/java/org/mobicents/protocols/ss7/tcap/TCAPFunctionalTest.java

=======================================
--- /tcap/tcap-api/src/main/java/org/mobicents/protocols/ss7/tcap/api/TCAPStack.java Wed Jun 26 01:00:08 2013 +++ /tcap/tcap-api/src/main/java/org/mobicents/protocols/ss7/tcap/api/TCAPStack.java Fri Jul 19 09:59:05 2013
@@ -123,4 +123,8 @@
      */
     boolean getPreviewMode();

+    void setDoNotSendProtocolVersion(boolean val);
+
+    boolean getDoNotSendProtocolVersion();
+
 }
=======================================
--- /tcap/tcap-api/src/main/java/org/mobicents/protocols/ss7/tcap/asn/DialogRequestAPDU.java Mon May 20 13:09:00 2013 +++ /tcap/tcap-api/src/main/java/org/mobicents/protocols/ss7/tcap/asn/DialogRequestAPDU.java Fri Jul 19 09:59:05 2013
@@ -32,6 +32,8 @@
  */
 public interface DialogRequestAPDU extends DialogAPDU {

+    void setDoNotSendProtocolVersion(boolean val);
+
     ProtocolVersion getProtocolVersion();

     // mandatory
=======================================
--- /tcap/tcap-api/src/main/java/org/mobicents/protocols/ss7/tcap/asn/DialogResponseAPDU.java Mon May 20 13:09:00 2013 +++ /tcap/tcap-api/src/main/java/org/mobicents/protocols/ss7/tcap/asn/DialogResponseAPDU.java Fri Jul 19 09:59:05 2013
@@ -31,6 +31,8 @@
  */
 public interface DialogResponseAPDU extends DialogAPDU {

+    void setDoNotSendProtocolVersion(boolean val);
+
     ProtocolVersion getProtocolVersion();

     // mandatory
=======================================
--- /tcap/tcap-api/src/main/java/org/mobicents/protocols/ss7/tcap/asn/DialogUniAPDU.java Mon May 20 13:09:00 2013 +++ /tcap/tcap-api/src/main/java/org/mobicents/protocols/ss7/tcap/asn/DialogUniAPDU.java Fri Jul 19 09:59:05 2013
@@ -31,6 +31,8 @@
  */
 public interface DialogUniAPDU extends DialogAPDU {

+    void setDoNotSendProtocolVersion(boolean val);
+
     // opt, default is 1(no other defined)
     int getProtocolVersion();

=======================================
--- /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/DialogImpl.java Mon Jul 15 09:34:36 2013 +++ /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/DialogImpl.java Fri Jul 19 09:59:05 2013
@@ -502,6 +502,7 @@
                 DialogPortion dp = TcapFactory.createDialogPortion();
                 dp.setUnidirectional(false);
DialogRequestAPDU apdu = TcapFactory.createDialogAPDURequest(); + apdu.setDoNotSendProtocolVersion(this.provider.getStack().getDoNotSendProtocolVersion());
                 dp.setDialogAPDU(apdu);
apdu.setApplicationContextName(event.getApplicationContextName());
                 this.lastACN = event.getApplicationContextName();
@@ -568,6 +569,7 @@
                     DialogPortion dp = TcapFactory.createDialogPortion();
                     dp.setUnidirectional(false);
DialogResponseAPDU apdu = TcapFactory.createDialogAPDUResponse(); + apdu.setDoNotSendProtocolVersion(this.provider.getStack().getDoNotSendProtocolVersion());
                     dp.setDialogAPDU(apdu);
apdu.setApplicationContextName(event.getApplicationContextName());
                     if (event.getUserInformation() != null) {
@@ -696,6 +698,7 @@
                     DialogPortion dp = TcapFactory.createDialogPortion();
                     dp.setUnidirectional(false);
DialogResponseAPDU apdu = TcapFactory.createDialogAPDUResponse(); + apdu.setDoNotSendProtocolVersion(this.provider.getStack().getDoNotSendProtocolVersion());
                     dp.setDialogAPDU(apdu);

apdu.setApplicationContextName(event.getApplicationContextName());
@@ -790,6 +793,7 @@
             if (event.getApplicationContextName() != null) {
                 DialogPortion dp = TcapFactory.createDialogPortion();
                 DialogUniAPDU apdu = TcapFactory.createDialogAPDUUni();
+ apdu.setDoNotSendProtocolVersion(this.provider.getStack().getDoNotSendProtocolVersion()); apdu.setApplicationContextName(event.getApplicationContextName());
                 if (event.getUserInformation() != null) {
                     apdu.setUserInformation(event.getUserInformation());
@@ -854,6 +858,7 @@
                         // Abnormal
                         // procedures on page 13 and 14
DialogResponseAPDU apdu = TcapFactory.createDialogAPDUResponse(); + apdu.setDoNotSendProtocolVersion(this.provider.getStack().getDoNotSendProtocolVersion()); apdu.setApplicationContextName(event.getApplicationContextName()); apdu.setUserInformation(event.getUserInformation());

@@ -1004,6 +1009,7 @@
             DialogPortion dp = TcapFactory.createDialogPortion();
             dp.setUnidirectional(false);
             DialogRequestAPDU apdu = TcapFactory.createDialogAPDURequest();
+ apdu.setDoNotSendProtocolVersion(this.provider.getStack().getDoNotSendProtocolVersion());
             dp.setDialogAPDU(apdu);
apdu.setApplicationContextName(event.getApplicationContextName());
             if (event.getUserInformation() != null) {
@@ -1044,6 +1050,7 @@
             DialogPortion dp = TcapFactory.createDialogPortion();
             dp.setUnidirectional(false);
DialogResponseAPDU apdu = TcapFactory.createDialogAPDUResponse(); + apdu.setDoNotSendProtocolVersion(this.provider.getStack().getDoNotSendProtocolVersion());
             dp.setDialogAPDU(apdu);
apdu.setApplicationContextName(event.getApplicationContextName());
             if (event.getUserInformation() != null) {
@@ -1109,6 +1116,7 @@
                 DialogPortion dp = TcapFactory.createDialogPortion();
                 dp.setUnidirectional(false);
DialogResponseAPDU apdu = TcapFactory.createDialogAPDUResponse(); + apdu.setDoNotSendProtocolVersion(this.provider.getStack().getDoNotSendProtocolVersion());
                 dp.setDialogAPDU(apdu);

apdu.setApplicationContextName(event.getApplicationContextName());
@@ -1148,6 +1156,7 @@
         if (event.getApplicationContextName() != null) {
             DialogPortion dp = TcapFactory.createDialogPortion();
             DialogUniAPDU apdu = TcapFactory.createDialogAPDUUni();
+ apdu.setDoNotSendProtocolVersion(this.provider.getStack().getDoNotSendProtocolVersion()); apdu.setApplicationContextName(event.getApplicationContextName());
             if (event.getUserInformation() != null) {
                 apdu.setUserInformation(event.getUserInformation());
=======================================
--- /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/TCAPProviderImpl.java Mon Jul 15 09:34:36 2013 +++ /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/TCAPProviderImpl.java Fri Jul 19 09:59:05 2013
@@ -485,6 +485,7 @@
         dp.setUnidirectional(false);

         DialogResponseAPDU apdu = TcapFactory.createDialogAPDUResponse();
+ apdu.setDoNotSendProtocolVersion(this.getStack().getDoNotSendProtocolVersion());

         Result res = TcapFactory.createResult();
         res.setResultType(ResultType.RejectedPermanent);
=======================================
--- /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/TCAPStackImpl.java Wed Jun 26 01:00:08 2013 +++ /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/TCAPStackImpl.java Fri Jul 19 09:59:05 2013
@@ -58,6 +58,7 @@
     private long dialogIdRangeStart = 1;
     private long dialogIdRangeEnd = Integer.MAX_VALUE;
     private boolean previewMode = false;
+    private boolean doNotSendProtocolVersion = false;

     public TCAPStackImpl() {
         super();
@@ -212,5 +213,15 @@
     public boolean getPreviewMode() {
         return previewMode;
     }
+
+    @Override
+    public void setDoNotSendProtocolVersion(boolean val) {
+        doNotSendProtocolVersion = val;
+    }
+
+    @Override
+    public boolean getDoNotSendProtocolVersion() {
+        return doNotSendProtocolVersion;
+    }

 }
=======================================
--- /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/asn/DialogRequestAPDUImpl.java Mon May 20 13:09:00 2013 +++ /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/asn/DialogRequestAPDUImpl.java Fri Jul 19 09:59:05 2013
@@ -40,6 +40,14 @@
     private ApplicationContextName acn;
     private UserInformation ui;
     private ProtocolVersion protocolVersion = new ProtocolVersionImpl();
+    private boolean doNotSendProtocolVersion = false;
+
+    public DialogRequestAPDUImpl() {
+    }
+
+    public void setDoNotSendProtocolVersion(boolean val) {
+        doNotSendProtocolVersion = val;
+    }

     /*
      * (non-Javadoc)
@@ -174,7 +182,8 @@
             aos.writeTag(Tag.CLASS_APPLICATION, false, _TAG_REQUEST);
             int pos = aos.StartContentDefiniteLength();

-            this.protocolVersion.encode(aos);
+            if (!doNotSendProtocolVersion)
+                this.protocolVersion.encode(aos);
             this.acn.encode(aos);

             if (ui != null)
=======================================
--- /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/asn/DialogResponseAPDUImpl.java Mon May 20 13:09:00 2013 +++ /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/asn/DialogResponseAPDUImpl.java Fri Jul 19 09:59:05 2013
@@ -42,6 +42,14 @@
     private Result result;
     private ResultSourceDiagnostic diagnostic;
     private ProtocolVersion protocolVersion = new ProtocolVersionImpl();
+    private boolean doNotSendProtocolVersion = false;
+
+    public DialogResponseAPDUImpl() {
+    }
+
+    public void setDoNotSendProtocolVersion(boolean val) {
+        doNotSendProtocolVersion = val;
+    }

     // optional
     private UserInformation ui;
@@ -217,7 +225,8 @@
             aos.writeTag(Tag.CLASS_APPLICATION, false, _TAG_RESPONSE);
             int pos = aos.StartContentDefiniteLength();

-            this.protocolVersion.encode(aos);
+            if (!doNotSendProtocolVersion)
+                this.protocolVersion.encode(aos);
             this.acn.encode(aos);
             this.result.encode(aos);
             this.diagnostic.encode(aos);
=======================================
--- /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/asn/DialogUniAPDUImpl.java Mon May 20 13:09:00 2013 +++ /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/asn/DialogUniAPDUImpl.java Fri Jul 19 09:59:05 2013
@@ -38,6 +38,14 @@

     private ApplicationContextName acn;
     private UserInformation ui;
+    private boolean doNotSendProtocolVersion = false;
+
+    public DialogUniAPDUImpl() {
+    }
+
+    public void setDoNotSendProtocolVersion(boolean val) {
+        doNotSendProtocolVersion = val;
+    }

     /*
      * (non-Javadoc)
@@ -173,8 +181,10 @@

             // lets not omit protocol version, we check byte[] in tests, it
             // screws them :)
-            ProtocolVersion pv = TcapFactory.createProtocolVersion();
-            pv.encode(aos);
+            if (!doNotSendProtocolVersion) {
+                ProtocolVersion pv = TcapFactory.createProtocolVersion();
+                pv.encode(aos);
+            }
             this.acn.encode(aos);

             if (ui != null)
=======================================
--- /tcap/tcap-impl/src/test/java/org/mobicents/protocols/ss7/tcap/TCAPFunctionalTest.java Mon May 20 13:09:00 2013 +++ /tcap/tcap-impl/src/test/java/org/mobicents/protocols/ss7/tcap/TCAPFunctionalTest.java Fri Jul 19 09:59:05 2013
@@ -100,7 +100,9 @@
peer2Address = new SccpAddress(RoutingIndicator.ROUTING_BASED_ON_DPC_AND_SSN, 2, null, 8);

         this.tcapStack1 = new TCAPStackImpl(this.sccpProvider1, 8);
+        this.tcapStack1.setDoNotSendProtocolVersion(false);
         this.tcapStack2 = new TCAPStackImpl(this.sccpProvider2, 8);
+        this.tcapStack2.setDoNotSendProtocolVersion(false);

         this.tcapListenerWrapper = new TCAPListenerWrapper();
         this.tcapStack1.getProvider().addTCListener(tcapListenerWrapper);
@@ -155,6 +157,8 @@
te = TestEvent.createReceivedEvent(EventType.DialogRelease, null, 3, stamp + WAIT_TIME * 2);
         serverExpectedEvents.add(te);

+//        this.saveTrafficInFile();
+
         client.startClientDialog();
         assertNotNull(client.dialog.getLocalAddress());
         assertNull(client.dialog.getRemoteDialogId());

--

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