Revision: fed68d682532
Author:   Jean Deruelle <[email protected]>
Date:     Thu Oct 10 19:19:47 2013 UTC
Log:      Update Issue 129

Better fix as NPE was still happening on getting the From Tag and do a toLowerCase on it from time to time. There might a concurrency issue on the SIP Response when getting the From Tag

http://code.google.com/p/jain-sip/source/detail?r=fed68d682532&repo=javascript

Modified:
 /src/main/javascript/jain-sip/gov/nist/sip/stack/SIPClientTransaction.js

=======================================
--- /src/main/javascript/jain-sip/gov/nist/sip/stack/SIPClientTransaction.js Wed Oct 9 13:28:33 2013 UTC +++ /src/main/javascript/jain-sip/gov/nist/sip/stack/SIPClientTransaction.js Thu Oct 10 19:19:47 2013 UTC
@@ -331,6 +331,7 @@
if(logger!=undefined) logger.debug("SIPClientTransaction:inviteClientTransaction():sipDialog="+sipDialog);

     var statusCode = transactionResponse.getStatusCode();
+ if(logger!=undefined) logger.debug("SIPClientTransaction.nonInviteClientTransaction state " + this.getState());
     if (this.TRYING == this.getState()) {
         if (100 <= statusCode && statusCode <= 199) {
             this.setState(this.PROCEEDING);
@@ -747,16 +748,17 @@
 SIPClientTransaction.prototype.checkFromTag =function(sipResponse){
if(logger!=undefined) logger.debug("SIPClientTransaction:checkFromTag():sipResponse="+sipResponse);
     var originalFromTag = this.getRequest().getFromTag();
+    var sipResponseFromTag = sipResponse.getFrom().getTag();
     if (this.defaultDialog != null) {
- // Added for https://code.google.com/p/webrtcomm/issues/detail?id=19 as XOR below is not enough
-       if (originalFromTag == null && sipResponse.getFrom().getTag() == null) {
+ // Added for https://code.google.com/p/webrtcomm/issues/detail?id=19 as XOR below is not enough
+       if (originalFromTag == null && sipResponseFromTag == null) {
                return false;
        }
- if (originalFromTag == null ^ sipResponse.getFrom().getTag() == null) {
+        if (originalFromTag == null ^ sipResponseFromTag == null) {
             return false;
-        }
-        if (originalFromTag != null &&
- originalFromTag.toLowerCase()!=sipResponse.getFrom().getTag().toLowerCase()) {
+        }
+        if (originalFromTag != null && sipResponseFromTag != null &&
+ originalFromTag.toLowerCase() != sipResponseFromTag.toLowerCase()) {
             return false;
         }
     }

--

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