Revision: 20853
Author:   [email protected]
Date:     Thu Oct 20 11:37:50 2011
Log:      Fixes Issue 2939
http://code.google.com/p/mobicents/source/detail?r=20853

Modified:
/branches/jbcp/1.2-CP09-HF01-2314.2263.1837.2088.1618/sip-servlets-release/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/session/SipSessionImpl.java /branches/jbcp/1.2-CP09-HF01-2314.2263.1837.2088.1618/sip-servlets-release/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/message/SipServletResponseImpl.java /branches/jbcp/1.2-CP09-HF01-2314.2263.1837.2088.1618/sip-servlets-release/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/proxy/ProxyBranchImpl.java

=======================================
--- /branches/jbcp/1.2-CP09-HF01-2314.2263.1837.2088.1618/sip-servlets-release/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/session/SipSessionImpl.java Thu Jan 27 09:25:02 2011 +++ /branches/jbcp/1.2-CP09-HF01-2314.2263.1837.2088.1618/sip-servlets-release/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/session/SipSessionImpl.java Thu Oct 20 11:37:50 2011
@@ -1090,11 +1090,20 @@
         * @param dialog the dialog to set
         */
        public void setSessionCreatingDialog(Dialog dialog) {
-               this.sessionCreatingDialog = dialog;
-               if(logger.isDebugEnabled()) {
- logger.debug("setting session creating dialog for this session to " + dialog);
-                       if(dialog != null) {
- logger.debug("session creating dialog dialogId " + dialog.getDialogId());
+               if(proxy == null) {
+                       this.sessionCreatingDialog = dialog;
+                       if(logger.isDebugEnabled()) {
+ logger.debug("setting session creating dialog for this session to " + dialog);
+                               if(dialog != null) {
+ logger.debug("session creating dialog dialogId " + dialog.getDialogId());
+                               }
+                       }
+               } else {
+                       if(logger.isDebugEnabled()) {
+ logger.debug("not setting session creating dialog for this session to " + dialog + " since this is a proxy application");
+                               if(dialog != null) {
+ logger.debug("not setting session creating dialog with dialogId " + dialog.getDialogId() + " since this is a proxy application");
+                               }
                        }
                }
        }
=======================================
--- /branches/jbcp/1.2-CP09-HF01-2314.2263.1837.2088.1618/sip-servlets-release/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/message/SipServletResponseImpl.java Mon Oct 3 09:53:06 2011 +++ /branches/jbcp/1.2-CP09-HF01-2314.2263.1837.2088.1618/sip-servlets-release/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/message/SipServletResponseImpl.java Thu Oct 20 11:37:50 2011
@@ -17,6 +17,7 @@
 package org.mobicents.servlet.sip.message;

 import gov.nist.javax.sip.DialogExt;
+import gov.nist.javax.sip.stack.SIPServerTransaction;

 import java.io.IOException;
 import java.io.ObjectInput;
@@ -588,6 +589,13 @@
                                if(logger.isDebugEnabled()) {
logger.debug("Sending response " + message + " through tx " + transaction);
                                }
+ if(proxy != null && transaction.getDialog() != null && transaction instanceof SIPServerTransaction) { + // http://code.google.com/p/mobicents/issues/detail?id=2939 : Application Chaining and multiple protocols usage issue + // avoid that in Application chaining case (Proxy then B2BUA), the proxy server tx that got + // the dialog affected to it, mess up with the last response in multiple protocols scenarios. + // so we nullify the dialog for that tx which is fine since we are a proxy application
+                                       ((SIPServerTransaction) 
transaction).setDialog(null, null);
+                               }
                                transaction.sendResponse( 
(Response)this.message );
                                if(dialog != null) {
// we need to set the dialog again because it's possible that when the dialog
=======================================
--- /branches/jbcp/1.2-CP09-HF01-2314.2263.1837.2088.1618/sip-servlets-release/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/proxy/ProxyBranchImpl.java Thu Jun 9 05:29:23 2011 +++ /branches/jbcp/1.2-CP09-HF01-2314.2263.1837.2088.1618/sip-servlets-release/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/proxy/ProxyBranchImpl.java Thu Oct 20 11:37:50 2011
@@ -392,7 +392,8 @@
                }

                // Use the original dialog in the new session
- newSession.setSessionCreatingDialog(originalSipSession.getSessionCreatingDialog());
+               // commented out proxy applications shouldn't use any dialogs 
!!!
+// newSession.setSessionCreatingDialog(originalSipSession.getSessionCreatingDialog());

                // And set a reference to the proxy
                newSession.setProxy(proxy);

Reply via email to