Commit 59e84539 authored by Thiago Camargo's avatar Thiago Camargo Committed by thiago

STUN Server Module added

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@6598 b35dd754-fafc-0310-a699-88a17e54d16e
parent 2c9e6f17
......@@ -149,7 +149,7 @@
<fileset dir="${lib.build.dir}" includes="*.jar" excludes="junit.jar"/>
<fileset dir="${lib.merge.dir}" includes="*.jar"/>
<fileset dir="${lib.dist.dir}"
includes="servlet.jar, mail.jar, activation.jar, jdic.jar, bouncycastle.jar"/>
includes="servlet.jar, mail.jar, activation.jar, jdic.jar, bouncycastle.jar, jstun-0.6.1.jar"/>
</path>
<path id="compile.dependencies">
......@@ -780,7 +780,7 @@
<for param="jar">
<path>
<fileset dir="${release.out.dir}/lib" includes="*.jar"
excludes="startup.jar,jdic.jar,mail.jar,activation.jar,bouncycastle.jar"/>
excludes="startup.jar,jdic.jar,mail.jar,activation.jar,bouncycastle.jar,jstun-0.6.1.jar"/>
</path>
<sequential>
<delete file="@{jar}.pack"/>
......@@ -797,7 +797,7 @@
<for param="jar">
<path>
<fileset dir="${release.out.dir}/plugins/admin/webapp/WEB-INF/lib" includes="*.jar"
excludes="startup.jar,jdic.jar,mail.jar,activation.jar,bouncycastle.jar"/>
excludes="startup.jar,jdic.jar,mail.jar,activation.jar,bouncycastle.jar,jstun-0.6.1.jar"/>
</path>
<sequential>
<delete file="@{jar}.pack"/>
......@@ -1195,7 +1195,7 @@
be manually added to this list.
-->
<property name="pack200.excludes"
value="gnujaxp.jar,mail.jar,activation.jar,bouncycastle.jar"/>
value="gnujaxp.jar,mail.jar,activation.jar,bouncycastle.jar,jstun-0.6.1.jar"/>
<for param="jar">
<path>
......
......@@ -44,6 +44,7 @@ import org.jivesoftware.wildfire.update.UpdateManager;
import org.jivesoftware.wildfire.user.UserManager;
import org.jivesoftware.wildfire.vcard.VCardManager;
import org.jivesoftware.wildfire.mediaproxy.MediaProxyService;
import org.jivesoftware.wildfire.stun.STUNService;
import org.xmpp.packet.JID;
import java.io.File;
......@@ -489,6 +490,7 @@ public class XMPPServer {
loadModule(DefaultFileTransferManager.class.getName());
loadModule(FileTransferProxy.class.getName());
loadModule(MediaProxyService.class.getName());
loadModule(STUNService.class.getName());
loadModule(PubSubModule.class.getName());
loadModule(UpdateManager.class.getName());
loadModule(InternalComponentManager.class.getName());
......@@ -1268,12 +1270,23 @@ public class XMPPServer {
* <code>MediaProxyService</code> was registered with the server as a module while starting up
* the server.
*
* @return the <code>FileTransferProxy</code> registered with this server.
* @return the <code>MediaProxyService</code> registered with this server.
*/
public MediaProxyService getMediaProxyService() {
return (MediaProxyService) modules.get(MediaProxyService.class);
}
/**
* Returns the <code>STUNService</code> registered with this server. The
* <code>MediaProxyService</code> was registered with the server as a module while starting up
* the server.
*
* @return the <code>STUNService</code> registered with this server.
*/
public STUNService getSTUNService() {
return (STUNService) modules.get(STUNService.class);
}
/**
* Returns the <code>InternalComponentManager</code> registered with this server. The
* <code>InternalComponentManager</code> was registered with the server as a module while starting up
......
This diff is collapsed.
......@@ -136,6 +136,10 @@
url="media-proxy.jsp"
description="Media proxy settings"/>
<!-- STUN Server Settings -->
<item id="stun-settings" name="STUN Server Settings"
url="stun-settings.jsp"
description="STUN Server Settings"/>
</sidebar>
</tab>
......
<%--
- $Revision: 5321 $
- $Date: 2006-09-11 01:22:53 -0300 (seg, 11 set 2006) $
-
- Copyright (C) 2004-2005 Jive Software. All rights reserved.
-
- This software is published under the terms of the GNU Public License (GPL),
- a copy of which is included in this distribution.
--%>
<%@ page import="org.jivesoftware.util.JiveGlobals" %>
<%@ page import="org.jivesoftware.util.ParamUtils" %>
<%@ page import="org.jivesoftware.wildfire.XMPPServer" %>
<%@ page import="org.jivesoftware.wildfire.stun.STUNService" %>
<%
STUNService stunService = XMPPServer.getInstance().getSTUNService();
boolean save = request.getParameter("set") != null;
boolean success = false;
boolean enabled = false;
String primaryAddress;
String secondaryAddress;
int primaryPort = 3478;
int secondaryPort = 3576;
if (save) {
primaryPort = ParamUtils.getIntParameter(request, "primaryPort", primaryPort);
JiveGlobals.setProperty("stun.port.primary", String.valueOf(primaryPort));
secondaryPort = ParamUtils.getIntParameter(request, "secondaryPort", secondaryPort);
JiveGlobals.setProperty("stun.port.secondary", String.valueOf(secondaryPort));
primaryAddress = ParamUtils.getParameter(request, "primaryAddress", true);
JiveGlobals.setProperty("stun.address.primary", primaryAddress);
secondaryAddress = ParamUtils.getParameter(request, "secondaryAddress", true);
JiveGlobals.setProperty("stun.address.secondary", secondaryAddress);
enabled = ParamUtils.getBooleanParameter(request, "enabled", enabled);
JiveGlobals.setProperty("stun.enabled", String.valueOf(enabled));
stunService.stop();
stunService.setEnabled(enabled);
success = true;
}
%>
<html>
<head>
<title>STUN Server Settings</title>
<meta name="pageID" content="stun-settings"/>
</head>
<body>
<p>
Use the form below to manage STUN Server settings.<br>
</p>
<% if (success) { %>
<div class="jive-success">
<table cellpadding="0" cellspacing="0" border="0">
<tbody>
<tr>
<td class="jive-icon"><img src="images/success-16x16.gif" width="16" height="16"
border="0"></td>
<td class="jive-icon-label">Settings updated successfully.</td>
</tr>
</tbody>
</table>
</div>
<br>
<% } %>
<form action="stun-settings.jsp" method="post">
<fieldset>
<legend>STUN Server Settings</legend>
<div>
<p>
The settings will just take effects after savings settings.
</p>
<table cellpadding="3" cellspacing="0" border="0" width="100%">
<tbody>
<tr>
<td align="left">Primary Address:&nbsp<input type="text" size="20"
maxlength="100"
name="primaryAddress"
value="<%=stunService.getPrimaryAddress()%>"
align="left">
</td>
</tr>
<tr>
<td align="left">Secondary Address:&nbsp<input type="text" size="20"
maxlength="100"
name="secondaryAddress"
value="<%=stunService.getSecondaryAddress()%>"
align="left">
</td>
</tr>
<tr>
<td align="left">Primary Port Value:&nbsp<input type="text" size="20"
maxlength="100"
name="primaryPort"
value="<%=stunService.getPrimaryPort()%>"
align="left">
</td>
</tr>
<tr>
<td align="left">Secondary Port Value:&nbsp<input type="text" size="20"
maxlength="100"
name="secondaryPort"
value="<%=stunService.getSecondaryPort()%>"
align="left">
</td>
</tr>
<tr>
<td align="left">Enabled:&nbsp<input type="checkbox"
name="enabled"
<%=stunService.isEnabled()?"checked":""%>
align="left">
</td>
</tr>
</tbody>
</table>
</div>
<input type="submit" name="set" value="Change">
</fieldset>
</form>
</body>
</html>
\ No newline at end of file
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