Revision: 16427
Author: [email protected]
Date: Fri Jan 14 07:37:17 2011
Log: Update Issue 1618
Backporting issue to JBCP 1.2.X Branch
http://code.google.com/p/mobicents/source/detail?r=16427
Modified:
/branches/jbcp/1.2/sip-servlets-release/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/SipApplicationDispatcherImpl.java
=======================================
---
/branches/jbcp/1.2/sip-servlets-release/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/SipApplicationDispatcherImpl.java
Fri Nov 19 08:44:52 2010
+++
/branches/jbcp/1.2/sip-servlets-release/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/SipApplicationDispatcherImpl.java
Fri Jan 14 07:37:17 2011
@@ -106,6 +106,7 @@
import org.mobicents.servlet.sip.message.SipServletRequestImpl;
import org.mobicents.servlet.sip.message.SipServletResponseImpl;
import org.mobicents.servlet.sip.message.TransactionApplicationData;
+import org.mobicents.servlet.sip.proxy.ProxyBranchImpl;
import org.mobicents.servlet.sip.proxy.ProxyImpl;
import org.mobicents.servlet.sip.router.ManageableApplicationRouter;
import org.mobicents.servlet.sip.startup.SipContext;
@@ -960,14 +961,26 @@
SipSessionKey sipSessionKey =
sipServletMessage.getSipSessionKey();
MobicentsSipSession sipSession =
sipServletMessage.getSipSession();
boolean appNotifiedOfPrackNotReceived = false;
+ // session can be null if a message was sent outside of the container
by the container itself during Initial request dispatching
+ // but the external host doesn't send any response so we call out to
the application only if the session is not null
if(sipSession != null) {
SipContext sipContext =
findSipApplication(sipSessionKey.getApplicationName());
//the context can be null if the server is
being shutdown
if(sipContext != null) {
try {
sipContext.enterSipApp(sipSession.getSipApplicationSession(),
sipSession);
- if(sipServletMessage instanceof
SipServletRequestImpl) {
+ // naoki : Fix for Issue 1618
http://code.google.com/p/mobicents/issues/detail?id=1618 on Timeout don't
do the 408 processing for Server Transactions
+ if(sipServletMessage instanceof SipServletRequestImpl
&& !timeoutEvent.isServerTransaction()) {
try {
+ ProxyBranchImpl
proxyBranchImpl = tad.getProxyBranch();
+
if(proxyBranchImpl != null) {
+
ProxyImpl proxy = (ProxyImpl) proxyBranchImpl.getProxy();
+
if(proxy.getFinalBranchForSubsequentRequests() != null) {
+
tad.cleanUp();
+
transaction.setApplicationData(null);
+
return;
+ }
+ }
SipServletRequestImpl sipServletRequestImpl =
(SipServletRequestImpl) sipServletMessage;
sipServletMessage.setTransaction(transaction);
SipServletResponseImpl response = (SipServletResponseImpl)
sipServletRequestImpl.createResponse(408, null, false);
@@ -987,10 +1000,10 @@
checkForAckNotReceived(sipServletMessage);
appNotifiedOfPrackNotReceived =
checkForPrackNotReceived(sipServletMessage);
-
sipSession.removeOngoingTransaction(transaction);
} finally {
+
sipSession.removeOngoingTransaction(transaction);
sipContext.exitSipApp(sipSession.getSipApplicationSession(),
sipSession);
- }
+ }
// don't invalidate here because if the application sends a final
response on the noPrack received
// the ACK to this final response won't be able to get routed since
the sip session would have been invalidated
if(!appNotifiedOfPrackNotReceived) {