Revision: e0f91b9a2a31
Author:   Sergey Vetyutnev <[email protected]>
Date:     Thu Jun 13 05:42:54 2013
Log:      TCAP preview mode bugs fixing
http://code.google.com/p/jss7/source/detail?r=e0f91b9a2a31

Modified:
/cap/cap-impl/src/main/java/org/mobicents/protocols/ss7/cap/service/circuitSwitchedCall/RequestReportBCSMEventRequestImpl.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/PrevewDialogData.java /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/TCAPProviderImpl.java

=======================================
--- /cap/cap-impl/src/main/java/org/mobicents/protocols/ss7/cap/service/circuitSwitchedCall/RequestReportBCSMEventRequestImpl.java Mon May 20 13:09:00 2013 +++ /cap/cap-impl/src/main/java/org/mobicents/protocols/ss7/cap/service/circuitSwitchedCall/RequestReportBCSMEventRequestImpl.java Thu Jun 13 05:42:54 2013
@@ -55,7 +55,7 @@
     public static final int _ID_bcsmEvents = 0;
     public static final int _ID_extensions = 2;

- public static final String _PrimitiveName = "ApplyChargingRequestIndication"; + public static final String _PrimitiveName = "RequestReportBCSMEventRequest";

     private static final String EXTENSIONS = "extensions";
     private static final String BCSM_EVENT = "bcsmEvent";
=======================================
--- /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/DialogImpl.java Mon May 20 13:09:00 2013 +++ /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/DialogImpl.java Thu Jun 13 05:42:54 2013
@@ -222,11 +222,12 @@
      * @param pdd
      * @param sideB
      */
- protected DialogImpl(long dialogId, SccpAddress localAddress, SccpAddress remoteAddress, int seqControl, + protected DialogImpl(SccpAddress localAddress, SccpAddress remoteAddress, int seqControl, ScheduledExecutorService executor, TCAPProviderImpl provider, PrevewDialogData pdd, boolean sideB) {
         this.localAddress = localAddress;
         this.remoteAddress = remoteAddress;
-        this.localTransactionId = dialogId;
+        this.localTransactionIdObject = pdd.getDialogId();
+        this.localTransactionId = pdd.getDialogId();
         this.executor = executor;
         this.provider = provider;
         this.structured = true;
=======================================
--- /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/PrevewDialogData.java Mon May 20 13:09:00 2013 +++ /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/PrevewDialogData.java Thu Jun 13 05:42:54 2013
@@ -51,9 +51,11 @@
     private ScheduledExecutorService executor;
     private TCAPProviderImpl provider;
     private long idleTaskTimeout;
+    private Long dialogId;

-    public PrevewDialogData(TCAPProviderImpl provider) {
+    public PrevewDialogData(TCAPProviderImpl provider, Long dialogId) {
         this.provider = provider;
+        this.dialogId = dialogId;
         TCAPStack stack = provider.getStack();
         this.idleTaskTimeout = stack.getDialogIdleTimeout();
         this.executor = provider._EXECUTOR;
@@ -62,6 +64,10 @@
     public ApplicationContextName getLastACN() {
         return lastACN;
     }
+
+    public Long getDialogId() {
+        return dialogId;
+    }

     public InvokeImpl[] getOperationsSentA() {
         return operationsSentA;
=======================================
--- /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/TCAPProviderImpl.java Mon Jun 3 09:03:39 2013 +++ /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/TCAPProviderImpl.java Thu Jun 13 05:42:54 2013
@@ -848,9 +848,10 @@
if (this.dialogPreviewList.size() >= this.stack.getMaxDialogs()) throw new TCAPException("Current dialog count exceeds its maximum value");

-            PrevewDialogData pdd = new PrevewDialogData(this);
+            Long dialogId = this.getAvailableTxIdPreview();
+            PrevewDialogData pdd = new PrevewDialogData(this, dialogId);
             this.dialogPreviewList.put(ky, pdd);
- DialogImpl di = new DialogImpl(0, localAddress, remoteAddress, seqControl, this._EXECUTOR, this, pdd, false); + DialogImpl di = new DialogImpl(localAddress, remoteAddress, seqControl, this._EXECUTOR, this, pdd, false);
             pdd.setPrevewDialogDataKey1(ky);

             pdd.startIdleTimer();
@@ -858,6 +859,17 @@
             return di;
         }
     }
+
+    private Long getAvailableTxIdPreview() throws TCAPException {
+        while (true) {
+            if (this.curDialogId < this.stack.getDialogIdRangeStart())
+                this.curDialogId = this.stack.getDialogIdRangeStart() - 1;
+            if (++this.curDialogId > this.stack.getDialogIdRangeEnd())
+                this.curDialogId = this.stack.getDialogIdRangeStart();
+            Long id = this.curDialogId;
+            return id;
+        }
+    }

private Dialog getPreviewDialog(PrevewDialogDataKey ky1, PrevewDialogDataKey ky2, SccpAddress localAddress,
             SccpAddress remoteAddress, int seqControl) {
@@ -867,12 +879,12 @@
             boolean sideB = false;
             if (pdd != null) {
                 sideB = pdd.getPrevewDialogDataKey1().equals(ky1);
- di = new DialogImpl(0, localAddress, remoteAddress, seqControl, this._EXECUTOR, this, pdd, sideB); + di = new DialogImpl(localAddress, remoteAddress, seqControl, this._EXECUTOR, this, pdd, sideB);
             } else {
                 pdd = this.dialogPreviewList.get(ky2);
                 if (pdd != null) {
                     sideB = pdd.getPrevewDialogDataKey1().equals(ky1);
- di = new DialogImpl(0, localAddress, remoteAddress, seqControl, this._EXECUTOR, this, pdd, sideB); + di = new DialogImpl(localAddress, remoteAddress, seqControl, this._EXECUTOR, this, pdd, sideB);
                 } else {
                     return null;
                 }
@@ -958,8 +970,11 @@
         public int hashCode() {
             final int prime = 31;
             int result = 1;
-            result = prime * result + this.dpc;
- result = prime * result + ((sccpDigits == null) ? 0 : sccpDigits.hashCode());
+            if (this.sccpDigits != null) {
+ result = prime * result + ((sccpDigits == null) ? 0 : sccpDigits.hashCode());
+            } else {
+                result = prime * result + this.dpc;
+            }
             result = prime * result + this.ssn;
result = prime * result + (int) (this.origTxId + (this.origTxId >> 32));
             return result;

--

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