bedweather / jss7

Automatically exported from code.google.com/p/jss7
0 stars 0 forks source link

SGW multilink support for same linkset #138

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Several links are not supported on mtp3 ( actually there is a bug )
Changes 
1) 
Instead of : 
if (!l4IsUp)   {    l4IsUp = true;  linkUp(mtp2);  }
should be :
linkUp(mtp2);

2) linkup function code 
private void linkUp(Mtp2 link) {      

    if(link.mtp2Listener != null) {
        link.mtp2Listener.linkUp();
    }

    linkset.add(link);

    if (!l4IsUp)
    {
         if (linkset.isActive() && this.mtp3Listener != null) {
            try {
                mtp3Listener.linkUp();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }          

   l4IsUp=true;
   if (logger.isInfoEnabled()) {
        logger.info(String.format("(%s) Link now IN_SERVICE", link.getName()));
   }
}

Can not commit since need to merge and test all the changes first

Original issue reported on code.google.com by oifa.yul...@gmail.com on 20 Sep 2012 at 4:23

GoogleCodeExporter commented 9 years ago
After this changes, we can see same packet put in queue, to avoid this you must 
apply these changes: (see topic: SGW dahdi multi link )

add a synchronized in org.mobicents.protocols.ss7.mtp.Mtp3 (line 362), 
and a clone of buffer.

    private static Object padlock = new Object();

               synchronized (padlock)
                 {
                  byte[] messageBuffer = fetchBuffer(rxFrame.len-5); //-5 = FSN(1) + BSN(1) + LEN(1) +2xCRC(1)
                     System.arraycopy(rxFrame.frame, 3, messageBuffer, 0, rxFrame.len-5);

                     if (logger.isDebugEnabled()) {
                         logger.debug("SCCP messageBuffer:"+HexTools.dump( messageBuffer,0));
                     }

                     //messageBuffer[0] = (byte) sio;
                     try {

                      byte[] clone = new byte[messageBuffer.length];
                      System.arraycopy(messageBuffer,0,clone,0,messageBuffer.length);

                      mtp3Listener.receive(clone);
                     } catch (Exception e) {
                         e.printStackTrace();
                     }
                 }

Ludovic Monnier

Original comment by ludovic....@gmail.com on 24 Sep 2012 at 8:35

GoogleCodeExporter commented 9 years ago
I will have to make a test with multiple links up on same linkset ( till now i 
did only test with one link per linkset ) to see all possible problems.
The tests are planned for next month ( after 08/10 ).
Please keep it open for now

Original comment by oifa.yul...@gmail.com on 24 Sep 2012 at 8:39

GoogleCodeExporter commented 9 years ago

Original comment by amit.bha...@gmail.com on 6 Feb 2013 at 9:48

GoogleCodeExporter commented 9 years ago

Original comment by amit.bha...@gmail.com on 10 Sep 2013 at 3:50