3 new revisions:
Revision: 5db7d00e6f5f
Author: Jean Deruelle <[email protected]>
Date: Sat Dec 8 11:11:30 2012
Log: Fixes Issue 181
http://code.google.com/p/sipservlets/source/detail?r=5db7d00e6f5f
Revision: 01e17cbcca3b
Author: Jean Deruelle <[email protected]>
Date: Sat Dec 8 11:19:34 2012
Log: Fixes Issue 180
http://code.google.com/p/sipservlets/source/detail?r=01e17cbcca3b
Revision: 80de4200c35d
Author: Jean Deruelle <[email protected]>
Date: Sat Dec 8 13:56:44 2012
Log: Update Issue 180...
http://code.google.com/p/sipservlets/source/detail?r=80de4200c35d
==============================================================================
Revision: 5db7d00e6f5f
Author: Jean Deruelle <[email protected]>
Date: Sat Dec 8 11:11:30 2012
Log: Fixes Issue 181
http://code.google.com/p/sipservlets/source/detail?r=5db7d00e6f5f
Modified:
/containers/sip-servlets-as7-drop-in/.classpath
/containers/sip-servlets-as7-drop-in/jboss-as-mobicents/src/main/java/org/mobicents/as7/Attribute.java
/containers/sip-servlets-as7-drop-in/jboss-as-mobicents/src/main/java/org/mobicents/as7/Constants.java
/containers/sip-servlets-as7-drop-in/jboss-as-mobicents/src/main/java/org/mobicents/as7/SipDefinition.java
/containers/sip-servlets-as7-drop-in/jboss-as-mobicents/src/main/java/org/mobicents/as7/SipServerService.java
/containers/sip-servlets-as7-drop-in/jboss-as-mobicents/src/main/java/org/mobicents/as7/SipSubsystemAdd.java
/containers/sip-servlets-as7-drop-in/jboss-as-mobicents/src/main/java/org/mobicents/as7/SipSubsystemParser.java
=======================================
--- /containers/sip-servlets-as7-drop-in/.classpath Fri Dec 7 10:28:36 2012
+++ /containers/sip-servlets-as7-drop-in/.classpath Sat Dec 8 11:11:30 2012
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
+ <classpathentry kind="src" path="jboss-as-mobicents/src/main/java"/>
+ <classpathentry kind="src"
path="jboss-as-mobicents/src/main/resources"/>
<classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
+ <classpathentry kind="output" path="jboss-as-mobicents/target/classes"/>
</classpath>
=======================================
---
/containers/sip-servlets-as7-drop-in/jboss-as-mobicents/src/main/java/org/mobicents/as7/Attribute.java
Fri Aug 10 07:50:10 2012
+++
/containers/sip-servlets-as7-drop-in/jboss-as-mobicents/src/main/java/org/mobicents/as7/Attribute.java
Sat Dec 8 11:11:30 2012
@@ -80,6 +80,7 @@
MAX_SAVE_POST_SIZE(Constants.MAX_SAVE_POST_SIZE),
NAME(Constants.NAME),
NATIVE(Constants.NATIVE),
+ OUTBOUND_PROXY(Constants.OUTBOUND_PROXY),
PASSWORD(Constants.PASSWORD),
PATH(Constants.PATH),
PATTERN(Constants.PATTERN),
=======================================
---
/containers/sip-servlets-as7-drop-in/jboss-as-mobicents/src/main/java/org/mobicents/as7/Constants.java
Fri Aug 10 07:50:10 2012
+++
/containers/sip-servlets-as7-drop-in/jboss-as-mobicents/src/main/java/org/mobicents/as7/Constants.java
Sat Dec 8 11:11:30 2012
@@ -85,6 +85,7 @@
String MODIFICATION_TEST_INTERVAL = "modification-test-interval";
String NAME = "name";
String NATIVE = "native";
+ String OUTBOUND_PROXY = "outbound-proxy";
String PASSWORD = "password";
String PATH = "path";
String PATTERN = "pattern";
=======================================
---
/containers/sip-servlets-as7-drop-in/jboss-as-mobicents/src/main/java/org/mobicents/as7/SipDefinition.java
Fri Aug 10 07:50:10 2012
+++
/containers/sip-servlets-as7-drop-in/jboss-as-mobicents/src/main/java/org/mobicents/as7/SipDefinition.java
Sat Dec 8 11:11:30 2012
@@ -178,7 +178,13 @@
.setFlags(AttributeAccess.Flag.RESTART_ALL_SERVICES)
.setDefaultValue(new ModelNode(75))
.build();
-
+ protected static final SimpleAttributeDefinition OUTBOUND_PROXY =
+ new SimpleAttributeDefinitionBuilder(Constants.OUTBOUND_PROXY,
ModelType.STRING, true)
+ .setAllowExpression(true)
+ .setXmlName(Constants.OUTBOUND_PROXY)
+ .setFlags(AttributeAccess.Flag.RESTART_ALL_SERVICES)
+ .setDefaultValue(null)
+ .build();
private SipDefinition() {
@@ -216,5 +222,6 @@
registration.registerReadWriteAttribute(CANCELED_TIMER_TASKS_PURGE_PERIOD,
null, new
ReloadRequiredWriteAttributeHandler(CANCELED_TIMER_TASKS_PURGE_PERIOD));
registration.registerReadWriteAttribute(MEMORY_THRESHOLD, null,
new ReloadRequiredWriteAttributeHandler(MEMORY_THRESHOLD));
registration.registerReadWriteAttribute(BACK_TO_NORMAL_MEMORY_THRESHOLD,
null, new
ReloadRequiredWriteAttributeHandler(BACK_TO_NORMAL_MEMORY_THRESHOLD));
+ registration.registerReadWriteAttribute(OUTBOUND_PROXY, null, new
ReloadRequiredWriteAttributeHandler(OUTBOUND_PROXY));
}
}
=======================================
---
/containers/sip-servlets-as7-drop-in/jboss-as-mobicents/src/main/java/org/mobicents/as7/SipServerService.java
Fri Aug 10 07:50:10 2012
+++
/containers/sip-servlets-as7-drop-in/jboss-as-mobicents/src/main/java/org/mobicents/as7/SipServerService.java
Sat Dec 8 11:11:30 2012
@@ -73,6 +73,7 @@
final int canceledTimerTasksPurgePeriod;
final int memoryThreshold;
final int backToNormalMemoryThreshold;
+ final String outboundProxy;
private final String instanceId;
@@ -103,7 +104,8 @@
boolean dialogPendingRequestChecking,
int canceledTimerTasksPurgePeriod,
int memoryThreshold,
- int backToNormalMemoryThreshold,
+ int backToNormalMemoryThreshold,
+ String outboundProxy,
String instanceId) {
// this.defaultHost = defaultHost;
// this.useNative = useNative;
@@ -125,6 +127,7 @@
this.canceledTimerTasksPurgePeriod = canceledTimerTasksPurgePeriod;
this.memoryThreshold = memoryThreshold;
this.backToNormalMemoryThreshold = backToNormalMemoryThreshold;
+ this.outboundProxy = outboundProxy;
}
/** {@inheritDoc} */
@@ -210,7 +213,7 @@
sipService.setMemoryThreshold(memoryThreshold);
sipService.setBackToNormalMemoryThreshold(backToNormalMemoryThreshold);
sipService.setCongestionControlPolicy(congestionControlPolicy);
-
+ sipService.setOutboundProxy(outboundProxy);
sipService.setName(JBOSS_SIP);
sipService.setServer(server);
server.addService(sipService);
=======================================
---
/containers/sip-servlets-as7-drop-in/jboss-as-mobicents/src/main/java/org/mobicents/as7/SipSubsystemAdd.java
Fri Aug 10 15:13:00 2012
+++
/containers/sip-servlets-as7-drop-in/jboss-as-mobicents/src/main/java/org/mobicents/as7/SipSubsystemAdd.java
Sat Dec 8 11:11:30 2012
@@ -100,6 +100,7 @@
SipDefinition.CANCELED_TIMER_TASKS_PURGE_PERIOD.validateAndSet(operation,
model);
SipDefinition.MEMORY_THRESHOLD.validateAndSet(operation, model);
SipDefinition.BACK_TO_NORMAL_MEMORY_THRESHOLD.validateAndSet(operation,
model);
+ SipDefinition.OUTBOUND_PROXY.validateAndSet(operation, model);
}
@Override
@@ -162,6 +163,9 @@
final ModelNode backToNormalMemoryThresholdModel =
SipDefinition.BACK_TO_NORMAL_MEMORY_THRESHOLD.resolveModelAttribute(context,
fullModel);
final int backToNormalMemoryThreshold =
backToNormalMemoryThresholdModel.isDefined() ?
backToNormalMemoryThresholdModel.asInt() : -1;
+ final ModelNode outboundProxyModel =
SipDefinition.OUTBOUND_PROXY.resolveModelAttribute(context, fullModel);
+ final String outboundProxy = outboundProxyModel.isDefined() ?
outboundProxyModel.asString() : null;
+
// final String instanceId =
operation.hasDefined(Constants.INSTANCE_ID) ?
operation.get(Constants.INSTANCE_ID).asString() : null;
// final String sipAppRouterFile =
operation.hasDefined(Constants.APPLICATION_ROUTER) ?
operation.get(Constants.APPLICATION_ROUTER).asString() : null;
// final String sipStackPropertiesFile =
operation.hasDefined(Constants.SIP_STACK_PROPS) ?
operation.get(Constants.SIP_STACK_PROPS).asString() : null;
@@ -189,6 +193,7 @@
canceledTimerTasksPurgePeriod,
memoryThreshold,
backToNormalMemoryThreshold,
+ outboundProxy,
instanceId);
newControllers.add(context.getServiceTarget().addService(SipSubsystemServices.JBOSS_SIP,
service)
.addDependency(PathManagerService.SERVICE_NAME,
PathManager.class, service.getPathManagerInjector())
=======================================
---
/containers/sip-servlets-as7-drop-in/jboss-as-mobicents/src/main/java/org/mobicents/as7/SipSubsystemParser.java
Fri Aug 10 07:50:10 2012
+++
/containers/sip-servlets-as7-drop-in/jboss-as-mobicents/src/main/java/org/mobicents/as7/SipSubsystemParser.java
Sat Dec 8 11:11:30 2012
@@ -92,6 +92,7 @@
SipDefinition.CANCELED_TIMER_TASKS_PURGE_PERIOD.marshallAsAttribute(node,
false, writer);
SipDefinition.MEMORY_THRESHOLD.marshallAsAttribute(node, false,
writer);
SipDefinition.BACK_TO_NORMAL_MEMORY_THRESHOLD.marshallAsAttribute(node,
false, writer);
+ SipDefinition.OUTBOUND_PROXY.marshallAsAttribute(node, false,
writer);
if(node.hasDefined(CONNECTOR)) {
for(final Property connector :
node.get(CONNECTOR).asPropertyList()) {
final ModelNode config = connector.getValue();
@@ -137,6 +138,7 @@
case CONGESTION_CONTROL_POLICY:
case MEMORY_THRESHOLD:
case BACK_TO_NORMAL_MEMORY_THRESHOLD:
+ case OUTBOUND_PROXY:
case CONCURRENCY_CONTROL_MODE:
case USE_PRETTY_ENCODING:
subsystem.get(attribute.getLocalName()).set(value);
==============================================================================
Revision: 01e17cbcca3b
Author: Jean Deruelle <[email protected]>
Date: Sat Dec 8 11:19:34 2012
Log: Fixes Issue 180
http://code.google.com/p/sipservlets/source/detail?r=01e17cbcca3b
Modified:
/containers/sip-servlets-as7/src/main/java/org/mobicents/servlet/sip/catalina/SipStandardService.java
/containers/sip-servlets-catalina-7/src/main/java/org/mobicents/servlet/sip/catalina/SipStandardService.java
/sip-servlets-core-api/src/main/java/org/mobicents/servlet/sip/core/SipService.java
/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/message/SipFactoryImpl.java
=======================================
---
/containers/sip-servlets-as7/src/main/java/org/mobicents/servlet/sip/catalina/SipStandardService.java
Mon Sep 10 13:54:19 2012
+++
/containers/sip-servlets-as7/src/main/java/org/mobicents/servlet/sip/catalina/SipStandardService.java
Sat Dec 8 11:19:34 2012
@@ -71,6 +71,7 @@
import org.mobicents.servlet.sip.core.ExtendedListeningPoint;
import org.mobicents.servlet.sip.core.MobicentsExtendedListeningPoint;
import org.mobicents.servlet.sip.core.SipApplicationDispatcher;
+import org.mobicents.servlet.sip.core.message.OutboundProxy;
import org.mobicents.servlet.sip.message.Servlet3SipServletMessageFactory;
import org.mobicents.servlet.sip.startup.StaticServiceHolder;
@@ -113,7 +114,7 @@
private int backToNormalSipMessageQueueSize = 1300;
protected int memoryThreshold = 95;
private int backToNormalMemoryThreshold = 90;
- protected String outboundProxy;
+ protected OutboundProxy outboundProxy;
protected long congestionControlCheckingInterval = 30000;
private int canceledTimerTasksPurgePeriod = 0;
// base timer interval for jain sip tx
@@ -897,13 +898,15 @@
}
- public String getOutboundProxy() {
+ public OutboundProxy getOutboundProxy() {
return outboundProxy;
}
public void setOutboundProxy(String outboundProxy) {
- this.outboundProxy = outboundProxy;
+ if(outboundProxy != null) {
+ this.outboundProxy = new OutboundProxy(outboundProxy);
+ }
}
public int getDispatcherThreadPoolSize() {
=======================================
---
/containers/sip-servlets-catalina-7/src/main/java/org/mobicents/servlet/sip/catalina/SipStandardService.java
Tue Sep 11 14:00:31 2012
+++
/containers/sip-servlets-catalina-7/src/main/java/org/mobicents/servlet/sip/catalina/SipStandardService.java
Sat Dec 8 11:19:34 2012
@@ -71,6 +71,7 @@
import org.mobicents.servlet.sip.core.ExtendedListeningPoint;
import org.mobicents.servlet.sip.core.MobicentsExtendedListeningPoint;
import org.mobicents.servlet.sip.core.SipApplicationDispatcher;
+import org.mobicents.servlet.sip.core.message.OutboundProxy;
import org.mobicents.servlet.sip.message.Servlet3SipServletMessageFactory;
import org.mobicents.servlet.sip.startup.StaticServiceHolder;
@@ -113,7 +114,7 @@
private int backToNormalSipMessageQueueSize = 1300;
protected int memoryThreshold = 95;
private int backToNormalMemoryThreshold = 90;
- protected String outboundProxy;
+ protected OutboundProxy outboundProxy;
protected long congestionControlCheckingInterval = 30000;
private int canceledTimerTasksPurgePeriod = 0;
// base timer interval for jain sip tx
@@ -893,13 +894,15 @@
}
- public String getOutboundProxy() {
+ public OutboundProxy getOutboundProxy() {
return outboundProxy;
}
public void setOutboundProxy(String outboundProxy) {
- this.outboundProxy = outboundProxy;
+ if(outboundProxy != null) {
+ this.outboundProxy = new OutboundProxy(outboundProxy);
+ }
}
public int getDispatcherThreadPoolSize() {
=======================================
---
/sip-servlets-core-api/src/main/java/org/mobicents/servlet/sip/core/SipService.java
Fri May 25 05:43:04 2012
+++
/sip-servlets-core-api/src/main/java/org/mobicents/servlet/sip/core/SipService.java
Sat Dec 8 11:19:34 2012
@@ -26,6 +26,7 @@
import org.mobicents.ha.javax.sip.ReplicationStrategy;
import org.mobicents.servlet.sip.SipConnector;
+import org.mobicents.servlet.sip.core.message.OutboundProxy;
/**
* This extends the definition of Service from tomcat interface to SIP.
@@ -60,7 +61,7 @@
public boolean isHttpFollowsSip();
public String getJvmRoute();
- public String getOutboundProxy();
+ public OutboundProxy getOutboundProxy();
public int getDispatcherThreadPoolSize();
public int getCanceledTimerTasksPurgePeriod();
public SipConnector[] findSipConnectors();
=======================================
---
/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/message/SipFactoryImpl.java
Wed Nov 14 09:00:41 2012
+++
/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/message/SipFactoryImpl.java
Sat Dec 8 11:19:34 2012
@@ -87,6 +87,7 @@
import org.mobicents.servlet.sip.core.SipContext;
import org.mobicents.servlet.sip.core.SipNetworkInterfaceManager;
import org.mobicents.servlet.sip.core.dispatchers.MessageDispatcher;
+import org.mobicents.servlet.sip.core.message.OutboundProxy;
import
org.mobicents.servlet.sip.core.session.MobicentsSipApplicationSession;
import
org.mobicents.servlet.sip.core.session.MobicentsSipApplicationSessionKey;
import org.mobicents.servlet.sip.core.session.MobicentsSipSession;
@@ -889,16 +890,13 @@
try {
String host = null;
int port = -1;
- String proxy =
StaticServiceHolder.sipStandardService.getOutboundProxy();
+ OutboundProxy proxy =
StaticServiceHolder.sipStandardService.getOutboundProxy();
if(proxy == null) {
host =
loadBalancerToUse.getAddress().getHostAddress();
port = loadBalancerToUse.getSipPort();
- } else {
- int separatorIndex = proxy.indexOf(":");
- if(separatorIndex>0) {
- host = proxy.substring(0,
separatorIndex);
- port =
Integer.parseInt(proxy.substring(separatorIndex + 1));
- }
+ } else {
+ host = proxy.getHost();
+ port = proxy.getPort();
}
javax.sip.address.SipURI sipUri =
SipFactoryImpl.addressFactory.createSipURI(null, host);
sipUri.setPort(port);
@@ -934,16 +932,13 @@
try {
String host = null;
int port = -1;
- String proxy =
StaticServiceHolder.sipStandardService.getOutboundProxy();
+ OutboundProxy proxy =
StaticServiceHolder.sipStandardService.getOutboundProxy();
if(proxy == null) {
host = lbhost;
port = lbport;
} else {
- int separatorIndex = proxy.indexOf(":");
- if(separatorIndex>0) {
- host = proxy.substring(0,
separatorIndex);
- port =
Integer.parseInt(proxy.substring(separatorIndex + 1));
- }
+ host = proxy.getHost();
+ port = proxy.getPort();
}
javax.sip.address.SipURI sipUri =
SipFactoryImpl.addressFactory.createSipURI(null, host);
sipUri.setPort(port);
==============================================================================
Revision: 80de4200c35d
Author: Jean Deruelle <[email protected]>
Date: Sat Dec 8 13:56:44 2012
Log: Update Issue 180
Add logging and committing missing file
http://code.google.com/p/sipservlets/source/detail?r=80de4200c35d
Added:
/sip-servlets-core-api/src/main/java/org/mobicents/servlet/sip/core/message/OutboundProxy.java
Modified:
/containers/sip-servlets-as7/src/main/java/org/mobicents/servlet/sip/catalina/SipStandardService.java
/containers/sip-servlets-catalina-7/src/main/java/org/mobicents/servlet/sip/catalina/SipStandardService.java
=======================================
--- /dev/null
+++
/sip-servlets-core-api/src/main/java/org/mobicents/servlet/sip/core/message/OutboundProxy.java
Sat Dec 8 13:56:44 2012
@@ -0,0 +1,70 @@
+/*
+ * TeleStax, Open Source Cloud Communications
+ * Copyright 2012 and individual contributors by the @authors tag.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.mobicents.servlet.sip.core.message;
+
+/**
+ * @author [email protected]
+ *
+ */
+public class OutboundProxy {
+
+ private String host = null;
+ private int port = 5060;
+
+ public OutboundProxy(String outboundProxy) {
+ int separatorIndex = outboundProxy.indexOf(":");
+ if(separatorIndex > 0) {
+ host = outboundProxy.substring(0, separatorIndex);
+ port =
Integer.parseInt(outboundProxy.substring(separatorIndex + 1));
+ } else {
+ host = outboundProxy;
+ }
+ }
+
+ /**
+ * @return the host
+ */
+ public String getHost() {
+ return host;
+ }
+ /**
+ * @param host the host to set
+ */
+ public void setHost(String host) {
+ this.host = host;
+ }
+ /**
+ * @return the port
+ */
+ public int getPort() {
+ return port;
+ }
+ /**
+ * @param port the port to set
+ */
+ public void setPort(int port) {
+ this.port = port;
+ }
+
+ @Override
+ public String toString() {
+ return host + ":" + port;
+ }
+}
=======================================
---
/containers/sip-servlets-as7/src/main/java/org/mobicents/servlet/sip/catalina/SipStandardService.java
Sat Dec 8 11:19:34 2012
+++
/containers/sip-servlets-as7/src/main/java/org/mobicents/servlet/sip/catalina/SipStandardService.java
Sat Dec 8 13:56:44 2012
@@ -906,6 +906,11 @@
public void setOutboundProxy(String outboundProxy) {
if(outboundProxy != null) {
this.outboundProxy = new OutboundProxy(outboundProxy);
+ } else {
+ this.outboundProxy = null;
+ }
+ if(logger.isDebugEnabled()) {
+ logger.debug("Outbound Proxy : " + outboundProxy);
}
}
=======================================
---
/containers/sip-servlets-catalina-7/src/main/java/org/mobicents/servlet/sip/catalina/SipStandardService.java
Sat Dec 8 11:19:34 2012
+++
/containers/sip-servlets-catalina-7/src/main/java/org/mobicents/servlet/sip/catalina/SipStandardService.java
Sat Dec 8 13:56:44 2012
@@ -902,6 +902,11 @@
public void setOutboundProxy(String outboundProxy) {
if(outboundProxy != null) {
this.outboundProxy = new OutboundProxy(outboundProxy);
+ } else {
+ this.outboundProxy = null;
+ }
+ if(logger.isDebugEnabled()) {
+ logger.debug("Outbound Proxy : " + outboundProxy);
}
}