Revision: 22731
Author: [email protected]
Date: Mon Jun 18 20:37:19 2012
Log: Fixes issue 3213
http://code.google.com/p/mobicents/source/detail?r=22731
Modified:
/branches/jbcp/5.1.x/sip-servlets/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/proxy/ProxyBranchImpl.java
/branches/jbcp/5.1.x/sip-servlets/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/proxy/ProxyUtils.java
=======================================
---
/branches/jbcp/5.1.x/sip-servlets/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/proxy/ProxyBranchImpl.java
Wed Mar 7 19:32:51 2012
+++
/branches/jbcp/5.1.x/sip-servlets/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/proxy/ProxyBranchImpl.java
Mon Jun 18 20:37:19 2012
@@ -764,7 +764,7 @@
transport, false).getSipProvider();
if(logger.isDebugEnabled()) {
- logger.debug("Getting new Client Tx for request " +
clonedRequest);
+ logger.debug("Getting new Client Tx for request " + clonedRequest + "\n
transport = " + transport);
}
// we mark them as accessed so that HA replication can occur
sipSession.access();
=======================================
---
/branches/jbcp/5.1.x/sip-servlets/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/proxy/ProxyUtils.java
Fri Apr 20 09:53:38 2012
+++
/branches/jbcp/5.1.x/sip-servlets/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/proxy/ProxyUtils.java
Mon Jun 18 20:37:19 2012
@@ -79,19 +79,25 @@
RouteHeader rHeader = (RouteHeader)
clonedRequest.getHeader(RouteHeader.NAME);
if(rHeader != null) {
- outboundTransport =
((javax.sip.address.SipURI)rHeader.getAddress().getURI()).getTransportParam();
String nextApp =
((javax.sip.address.SipURI)rHeader.getAddress().getURI()).getParameter(MessageDispatcher.RR_PARAM_APPLICATION_NAME);
if(nextApp != null) {
final SipApplicationSessionKey sipAppKey =
originalRequest.getSipSession().getSipApplicationSession().getKey();
final String thisApp =
sipFactoryImpl.getSipApplicationDispatcher().getHashFromApplicationName(sipAppKey.getApplicationName());
- if(outboundTransport == null) {
- outboundTransport =
ListeningPoint.UDP;
- }
+
if(nextApp.equals(thisApp)) {
clonedRequest.removeHeader(RouteHeader.NAME);
}
- }
- } else {
+ rHeader = (RouteHeader)
clonedRequest.getHeader(RouteHeader.NAME);
+ }
+ if(rHeader != null) {
+ outboundTransport =
((javax.sip.address.SipURI)rHeader.getAddress().getURI()).getTransportParam();
+ if(outboundTransport == null) {
+ outboundTransport =
ListeningPoint.UDP;
+ }
+ }
+
+ }
+ if(outboundTransport == null) {
// Fix for Issue 2783 : Proxying to non-UDP
transport is broken
if(clonedRequest.getRequestURI().isSipURI()) {
outboundTransport =
((javax.sip.address.SipURI)clonedRequest.getRequestURI()).getTransportParam();
@@ -107,9 +113,16 @@
}
if(outboundTransport == null) outboundTransport =
ListeningPoint.UDP;
-
- String inboundTransport =
((ViaHeader)clonedRequest.getHeader(Via.NAME)).getTransport();
+
+
((MessageExt)clonedRequest).setApplicationData(outboundTransport);
+
+ Via via = ((Via)clonedRequest.getHeader(Via.NAME));
+ String inboundTransport = via.getTransport();
if(inboundTransport == null) inboundTransport =
ListeningPoint.UDP;
+
+ if(logger.isDebugEnabled()) {
+ logger.debug("Outbound transport = " + outboundTransport + "
inbountTransport = " + inboundTransport);
+ }
/*
* The outbound transport has nothing to do with
outbound interface
@@ -210,13 +223,8 @@
final SipApplicationSessionKey sipAppKey =
originalRequest.getSipSession().getSipApplicationSession().getKey();
final String appName =
sipFactoryImpl.getSipApplicationDispatcher().getHashFromApplicationName(sipAppKey.getApplicationName());
final SipServletRequestImpl proxyBranchMatchingRequest =
(SipServletRequestImpl) proxyBranch.getMatchingRequest(originalRequest);
- //Add via header
- if(outboundTransport == null && destination != null) {
- outboundTransport =
destination.getParameter("transport");
- }
-
-
((MessageExt)clonedRequest).setApplicationData(outboundTransport);
-
+
+ //Add via header
if(proxy.getOutboundInterface() == null) {
String branchId = null;
@@ -260,8 +268,6 @@
clonedRequest.addHeader(proxyBranch.viaHeader);
- if(outboundTransport == null) outboundTransport =
ListeningPoint.UDP;
-
// Correction for misbehaving clients and unit testing
if(clonedRequest.getHeader(RouteHeader.NAME) == null) {
if(clonedRequest.getRequestURI().isSipURI()) {