2 new revisions:

Revision: 811053b84b21
Author:   [email protected] <[email protected]>
Date:     Tue Jun 19 06:33:24 2012
Log: Issue 83: SSA not sent to concerned SP when affected SP is available
http://code.google.com/p/jss7/source/detail?r=811053b84b21

Revision: 79a8762e3a10
Author:   [email protected] <[email protected]>
Date:     Tue Jun 19 06:42:13 2012
Log: Merge branch 'master' of https://[email protected]/p/jss7/
http://code.google.com/p/jss7/source/detail?r=79a8762e3a10

==============================================================================
Revision: 811053b84b21
Author:   [email protected] <[email protected]>
Date:     Tue Jun 19 06:33:24 2012
Log: Issue 83: SSA not sent to concerned SP when affected SP is available
http://code.google.com/p/jss7/source/detail?r=811053b84b21

Modified:
/sccp/sccp-impl/src/main/java/org/mobicents/protocols/ss7/sccp/impl/SccpManagement.java /sccp/sccp-impl/src/test/java/org/mobicents/protocols/ss7/sccp/impl/mgmt/ssp/SSPTest.java

=======================================
--- /sccp/sccp-impl/src/main/java/org/mobicents/protocols/ss7/sccp/impl/SccpManagement.java Sat Mar 31 03:29:55 2012 +++ /sccp/sccp-impl/src/main/java/org/mobicents/protocols/ss7/sccp/impl/SccpManagement.java Tue Jun 19 06:33:24 2012
@@ -76,6 +76,8 @@
        protected static final int UNAVAILABILITY_CAUSE_UNKNOWN = 0;
        protected static final int UNAVAILABILITY_CAUSE_UNEQUIPED = 1;
        protected static final int UNAVAILABILITY_CAUSE_INACCESSIBLE = 2;
+
+       private static final int ALL_POINT_CODE = -1;

 //     private static final int SST_TIMER_DURATION_MIN = 10000;
 //     private static final int SST_TIMER_DURATION_MAX = 600000;
@@ -244,16 +246,24 @@
        }

protected void broadcastChangedSsnState(int affectedSsn, boolean inService) {
+               this.broadcastChangedSsnState(affectedSsn, inService, 
ALL_POINT_CODE);
+       }
+
+ private void broadcastChangedSsnState(int affectedSsn, boolean inService, int concernedPointCode) {

FastMap<Integer, ConcernedSignalingPointCode> lst = this.sccpStackImpl.getSccpResource().getConcernedSpcs(); for (FastMap.Entry<Integer, ConcernedSignalingPointCode> e = lst.head(), end = lst.tail(); (e = e.getNext()) != end;) {
                        ConcernedSignalingPointCode concernedSubSystem = 
e.getValue();

                        int dpc = concernedSubSystem.getRemoteSpc();
-                       if (inService)
-                               this.sendManagementMessage(dpc, SSA, 
affectedSsn, 0);
-                       else
-                               this.sendManagementMessage(dpc, SSP, 
affectedSsn, 0);
+
+                       if(concernedPointCode == ALL_POINT_CODE || 
concernedPointCode == dpc){
+                               //Send SSA/SSP to only passed concerned point 
code
+                               if (inService)
+                                       this.sendManagementMessage(dpc, SSA, 
affectedSsn, 0);
+                               else
+                                       this.sendManagementMessage(dpc, SSP, 
affectedSsn, 0);
+                       }
                }
        }

@@ -286,6 +296,14 @@
        protected void handleMtp3Resume(int affectedPc) {
                // Look at Q.714 Section 5.2.2
                this.allowRsp(affectedPc, true, RemoteSccpStatus.available);
+
+ //Send SSA for all SS registered to affectedPc if it's included in concerned point-code + FastMap<Integer, SccpListener> lstrs = this.sccpProviderImpl.getAllSccpListeners(); + for (FastMap.Entry<Integer, SccpListener> e1 = lstrs.head(), end1 = lstrs.tail(); (e1 = e1.getNext()) != end1;) {
+                       int affectedSsn = e1.getKey();
+
+                       this.broadcastChangedSsnState(affectedSsn, true, 
affectedPc);
+               }

        }

=======================================
--- /sccp/sccp-impl/src/test/java/org/mobicents/protocols/ss7/sccp/impl/mgmt/ssp/SSPTest.java Sat Mar 31 03:29:55 2012 +++ /sccp/sccp-impl/src/test/java/org/mobicents/protocols/ss7/sccp/impl/mgmt/ssp/SSPTest.java Tue Jun 19 06:33:24 2012
@@ -25,12 +25,14 @@
 import org.testng.annotations.*;

 import static org.testng.Assert.*;
+
 import org.mobicents.protocols.ss7.indicator.RoutingIndicator;
 import org.mobicents.protocols.ss7.sccp.impl.ConcernedSignalingPointCode;
 import org.mobicents.protocols.ss7.sccp.impl.RemoteSubSystem;
 import org.mobicents.protocols.ss7.sccp.impl.SccpHarness;
 import org.mobicents.protocols.ss7.sccp.impl.SccpStackImplProxy;
 import org.mobicents.protocols.ss7.sccp.impl.User;
+import org.mobicents.protocols.ss7.sccp.impl.mgmt.Mtp3PrimitiveMessage;
 import org.mobicents.protocols.ss7.sccp.impl.mgmt.Mtp3PrimitiveMessageType;
 import org.mobicents.protocols.ss7.sccp.impl.mgmt.SccpMgmtMessage;
 import org.mobicents.protocols.ss7.sccp.impl.mgmt.SccpMgmtMessageType;
@@ -373,7 +375,7 @@
                sccpStack1.setSstTimerDuration_Min(5000);
                sccpStack1.setSstTimerDuration_IncreaseFactor(1);

-               ConcernedSignalingPointCode cspc = new 
ConcernedSignalingPointCode(2);
+ ConcernedSignalingPointCode cspc = new ConcernedSignalingPointCode(getStack2PC());
                sccpStack1.getSccpResource().addConcernedSpc(1, cspc);

                Thread.sleep(100);
@@ -392,6 +394,36 @@
assertEquals(((SccpStackImplProxy) sccpStack2).getManagementProxy().getMgmtMessages().size(), 2); assertEquals(((SccpStackImplProxy) sccpStack2).getManagementProxy().getMgmtMessages().get(1).getType(), SccpMgmtMessageType.SSP);

+               //Now test when the MTP3Pause's and then Resume's, SSA should 
be sent
+
+               u1.register();
+               Thread.sleep(100);
+
+ assertEquals(((SccpStackImplProxy) sccpStack2).getManagementProxy().getMgmtMessages().size(), 3); + assertEquals(((SccpStackImplProxy) sccpStack2).getManagementProxy().getMgmtMessages().get(2).getType(), SccpMgmtMessageType.SSA);
+
+               //Pause Stack2PC
+               this.mtp3UserPart1.sendPauseMessageToLocalUser(getStack2PC());
+               Thread.sleep(100);
+
+ assertTrue(((SccpStackImplProxy) sccpStack1).getManagementProxy().getMtp3Messages().size() == 1,"U1 did not receive Mtp3 Primitve, it should !"); + Mtp3PrimitiveMessage rmtpPause = ((SccpStackImplProxy) sccpStack1).getManagementProxy().getMtp3Messages().get(0); + Mtp3PrimitiveMessage emtpPause = new Mtp3PrimitiveMessage(0, Mtp3PrimitiveMessageType.MTP3_PAUSE, getStack2PC()); + assertEquals( rmtpPause,emtpPause,"Failed to match management message in U1");
+
+               //Resume Stack2PC
+               this.mtp3UserPart1.sendResumeMessageToLocalUser(getStack2PC());
+               Thread.sleep(100);
+
+ assertTrue(((SccpStackImplProxy) sccpStack1).getManagementProxy().getMtp3Messages().size() == 2,"U1 did not receive Mtp3 Primitve, it should !"); + rmtpPause = ((SccpStackImplProxy) sccpStack1).getManagementProxy().getMtp3Messages().get(1); + emtpPause = new Mtp3PrimitiveMessage(1, Mtp3PrimitiveMessageType.MTP3_RESUME, getStack2PC()); + assertEquals( rmtpPause,emtpPause,"Failed to match management message in U1");
+
+               //And stack2 should receive SSA
+ assertEquals(((SccpStackImplProxy) sccpStack2).getManagementProxy().getMgmtMessages().size(), 4); + assertEquals(((SccpStackImplProxy) sccpStack2).getManagementProxy().getMgmtMessages().get(3).getType(), SccpMgmtMessageType.SSA);
+
        }

        protected static byte[] createPausePrimitive(int pc) throws Exception

==============================================================================
Revision: 79a8762e3a10
Author:   [email protected] <[email protected]>
Date:     Tue Jun 19 06:42:13 2012
Log: Merge branch 'master' of https://[email protected]/p/jss7/
http://code.google.com/p/jss7/source/detail?r=79a8762e3a10


Reply via email to