Revision: 540cad8989e3
Author: [email protected] <[email protected]>
Date: Wed May 1 09:23:28 2013
Log: Update issue 210
http://code.google.com/p/sipservlets/source/detail?r=540cad8989e3
Modified:
/sip-servlets-core-api/src/main/java/org/mobicents/servlet/sip/core/MobicentsExtendedListeningPoint.java
/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/ExtendedListeningPoint.java
/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/SipNetworkInterfaceManagerImpl.java
/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/message/SipServletRequestImpl.java
=======================================
---
/sip-servlets-core-api/src/main/java/org/mobicents/servlet/sip/core/MobicentsExtendedListeningPoint.java
Wed Nov 14 09:00:41 2012
+++
/sip-servlets-core-api/src/main/java/org/mobicents/servlet/sip/core/MobicentsExtendedListeningPoint.java
Wed May 1 09:23:28 2013
@@ -127,5 +127,19 @@
* @return true if the ip adress is a any local address
*/
boolean isAnyLocalAddress();
+
+ /**
+ * https://code.google.com/p/sipservlets/issues/detail?id=210
+ * Set the desired outbound interface
+ * @param appOutboundAddress
+ */
+ void setAppOutboundAddress(String appOutboundAddress);
+
+ /**
+ * https://code.google.com/p/sipservlets/issues/detail?id=210
+ * Get the outbound interface
+ * @return
+ */
+ String getAppOutboundAddress();
}
=======================================
---
/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/ExtendedListeningPoint.java
Thu Oct 6 12:04:00 2011
+++
/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/ExtendedListeningPoint.java
Wed May 1 09:23:28 2013
@@ -60,6 +60,7 @@
private SipConnector sipConnector;
private String globalIpAddress;
String mostOutboundAddress = null;
+ String appOutboundAddress = null;
private int globalPort;
private List<String> ipAddresses;
private boolean isAnyLocalAddress;
@@ -116,9 +117,13 @@
// Making use of the global ip address discovered by STUN if it is
present
if(usePublicAddress && globalIpAddress != null) {
return globalIpAddress;
- } else {
- return mostOutboundAddress;
- }
+ }
+ //Issue:
https://code.google.com/p/sipservlets/issues/detail?id=210
+ if(appOutboundAddress != null) {
+ return appOutboundAddress;
+ } else {
+ return mostOutboundAddress;
+ }
}
@@ -353,4 +358,12 @@
public SipConnector getSipConnector() {
return sipConnector;
}
+
+ public String getAppOutboundAddress(){
+ return appOutboundAddress;
+ }
+
+ public void setAppOutboundAddress(String appOutboundAddress){
+ this.appOutboundAddress = appOutboundAddress;
+ }
}
=======================================
---
/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/SipNetworkInterfaceManagerImpl.java
Mon Sep 10 13:28:00 2012
+++
/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/SipNetworkInterfaceManagerImpl.java
Wed May 1 09:23:28 2013
@@ -253,6 +253,8 @@
if(logger.isTraceEnabled()) {
logger.trace("Found listening point
" + extendedListeningPoint);
}
+ //Issue:
https://code.google.com/p/sipservlets/issues/detail?id=210
+
extendedListeningPoint.setAppOutboundAddress(outboundInterface.getHost());
return extendedListeningPoint;
}
}
@@ -272,6 +274,8 @@
if(logger.isTraceEnabled()) {
logger.trace("Found
listening point " + extendedListeningPoint);
}
+ //Issue:
https://code.google.com/p/sipservlets/issues/detail?id=210
+
extendedListeningPoint.setAppOutboundAddress(outboundInterface.getHost());
return extendedListeningPoint;
}
}
=======================================
---
/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/message/SipServletRequestImpl.java
Mon Jan 28 09:54:52 2013
+++
/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/message/SipServletRequestImpl.java
Wed May 1 09:23:28 2013
@@ -388,7 +388,7 @@
String outboundInterface = null;
if(session != null) {
outboundInterface =
session.getOutboundInterface();
- }
+ }
// Add the contact header for the dialog.
ContactHeader contactHeader =
JainSipUtils.createContactHeader(
super.sipFactoryImpl.getSipNetworkInterfaceManager(), request,
null, null, outboundInterface);
@@ -1485,6 +1485,14 @@
}
}
}
+ //Issue:
https://code.google.com/p/sipservlets/issues/detail?id=210
+ String outboundInterface =
this.getSipSession().getOutboundInterface();
+ if(outboundInterface != null){
+ javax.sip.address.SipURI outboundInterfaceURI =
(javax.sip.address.SipURI)
SipFactoryImpl.addressFactory.createURI(outboundInterface);
+ ipAddressToCheckAgainst =
((gov.nist.javax.sip.address.SipUri)outboundInterfaceURI).getHost();
+ }
+
+
if(!viaHeader.getHost().equalsIgnoreCase(ipAddressToCheckAgainst) ||
viaHeader.getTransport().equalsIgnoreCase(sipConnector.getTransport()) ||
viaHeader.getPort() !=
sipConnector.getPort()) {
@@ -1602,11 +1610,18 @@
//
http://code.google.com/p/sipservlets/issues/detail?id=156
// MSS overwrites host part of Contact Header
in REGISTER requests
else
if(JainSipUtils.CONTACT_HEADER_METHODS.contains(requestMethod)) {
+ //Issue:
https://code.google.com/p/sipservlets/issues/detail?id=210
+ String outboundInterface =
this.getSipSession().getOutboundInterface();
+ if(outboundInterface != null){
+ javax.sip.address.SipURI outboundInterfaceURI =
(javax.sip.address.SipURI)
SipFactoryImpl.addressFactory.createURI(outboundInterface);
+ String outboundHost =
((gov.nist.javax.sip.address.SipUri)outboundInterfaceURI).getHost();
+
contactSipUri.setHost(outboundHost);
+ } else {
boolean usePublicAddress =
JainSipUtils.findUsePublicAddress(
sipNetworkInterfaceManager, request, matchingListeningPoint);
-
contactSipUri.setHost(matchingListeningPoint.getIpAddress(usePublicAddress));
+
contactSipUri.setHost(matchingListeningPoint.getIpAddress(usePublicAddress));
+ }
contactSipUri.setPort(matchingListeningPoint.getPort());
-
}
// http://code.google.com/p/mobicents/issues/detail?id=1150 only set
transport if not udp
if(transportForRequest != null) {
--
---
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.