Commit ee9c9e6c authored by Matt Tucker's avatar Matt Tucker Committed by matt

Added property that allows the IP address of the media proxy to be set (JM-1052).

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@8193 b35dd754-fafc-0310-a699-88a17e54d16e
parent a094d144
...@@ -33,7 +33,7 @@ public class MediaProxy implements SessionListener { ...@@ -33,7 +33,7 @@ public class MediaProxy implements SessionListener {
final private Map<String, MediaProxySession> sessions = new ConcurrentHashMap<String, MediaProxySession>(); final private Map<String, MediaProxySession> sessions = new ConcurrentHashMap<String, MediaProxySession>();
private String localhost; private String ipAddress;
private int minPort = 10000; private int minPort = 10000;
private int maxPort = 20000; private int maxPort = 20000;
...@@ -46,10 +46,10 @@ public class MediaProxy implements SessionListener { ...@@ -46,10 +46,10 @@ public class MediaProxy implements SessionListener {
/** /**
* Contruct a MediaProxy instance that will listen on a specific network interface. * Contruct a MediaProxy instance that will listen on a specific network interface.
* *
* @param localhost the IP of the locahost that will listen for packets. * @param ipAddress the IP address on this server that will listen for packets.
*/ */
public MediaProxy(String localhost) { public MediaProxy(String ipAddress) {
this.localhost = localhost; this.ipAddress = ipAddress;
} }
/** /**
...@@ -58,7 +58,7 @@ public class MediaProxy implements SessionListener { ...@@ -58,7 +58,7 @@ public class MediaProxy implements SessionListener {
* @return the host that listens for incomming packets. * @return the host that listens for incomming packets.
*/ */
public String getPublicIP() { public String getPublicIP() {
return localhost; return ipAddress;
} }
/** /**
...@@ -201,7 +201,7 @@ public class MediaProxy implements SessionListener { ...@@ -201,7 +201,7 @@ public class MediaProxy implements SessionListener {
public ProxyCandidate addRelayAgent(String id, String creator, String hostA, int portA, public ProxyCandidate addRelayAgent(String id, String creator, String hostA, int portA,
String hostB, int portB) String hostB, int portB)
{ {
RelaySession session = new RelaySession(id, creator, localhost, hostA, portA, hostB, portB, minPort, maxPort); RelaySession session = new RelaySession(id, creator, ipAddress, hostA, portA, hostB, portB, minPort, maxPort);
sessions.put(id, session); sessions.put(id, session);
session.addKeepAlive(idleTime); session.addKeepAlive(idleTime);
session.addLifeTime(lifetime); session.addLifeTime(lifetime);
...@@ -227,7 +227,7 @@ public class MediaProxy implements SessionListener { ...@@ -227,7 +227,7 @@ public class MediaProxy implements SessionListener {
* @return the added ProxyCandidate * @return the added ProxyCandidate
*/ */
public ProxyCandidate addRelayAgent(String id, String creator) { public ProxyCandidate addRelayAgent(String id, String creator) {
return addRelayAgent(id, creator, localhost, 40000, localhost, 40004); return addRelayAgent(id, creator, ipAddress, 40000, ipAddress, 40004);
} }
/** /**
......
...@@ -65,7 +65,11 @@ public class MediaProxyService extends BasicModule ...@@ -65,7 +65,11 @@ public class MediaProxyService extends BasicModule
super.initialize(server); super.initialize(server);
sessionManager = server.getSessionManager(); sessionManager = server.getSessionManager();
mediaProxy = new MediaProxy(server.getServerInfo().getName()); // In some cases, the domain name of the server may not be the actual address of the machine
// (ie, when using DNS SRV records). In that case, the "mediaproxy.externalip" property should be
// set to the IP address of the actual server where the media proxy is listening.
String ipAddress = JiveGlobals.getProperty("mediaproxy.externalip", server.getServerInfo().getName());
mediaProxy = new MediaProxy(ipAddress);
String defaultName = "rtpbridge"; String defaultName = "rtpbridge";
serviceName = JiveGlobals.getProperty("mediaproxy.serviceName", defaultName); serviceName = JiveGlobals.getProperty("mediaproxy.serviceName", defaultName);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment