<%-- - $Revision: $ - $Date: $ - - Copyright (C) 2005-2008 Jive Software. All rights reserved. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. --%> <%@ page import="org.jivesoftware.util.JiveGlobals" %> <%@ page import="org.jivesoftware.util.ParamUtils" %> <%@ page import="org.jivesoftware.openfire.XMPPServer" %> <%@ page import="org.jivesoftware.openfire.mediaproxy.MediaProxyService" %> <%@ page import="org.jivesoftware.openfire.mediaproxy.MediaProxySession" %> <%@ page import="org.jivesoftware.openfire.mediaproxy.RelaySession" %> <%@ page import="java.util.Collection" %> <%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %> <% webManager.init(request, response, session, application, out ); %> <% MediaProxyService mediaProxyService = XMPPServer.getInstance().getMediaProxyService(); boolean stop = request.getParameter("stop") != null; if (stop) { mediaProxyService.stopAgents(); } boolean save = request.getParameter("update") != null; boolean success = false; long keepAliveDelay = mediaProxyService.getIdleTime(); long lifetime = mediaProxyService.getLifetime(); int minPort = mediaProxyService.getMinPort(); int maxPort = mediaProxyService.getMaxPort(); int echoPort = mediaProxyService.getEchoPort(); boolean enabled = mediaProxyService.isEnabled(); if (save) { keepAliveDelay = ParamUtils.getLongParameter(request, "idleTimeout", keepAliveDelay); if (keepAliveDelay > 1) { mediaProxyService.setKeepAliveDelay(keepAliveDelay * 1000); JiveGlobals .setProperty("mediaproxy.idleTimeout", String.valueOf(keepAliveDelay * 1000)); } lifetime = ParamUtils.getLongParameter(request, "lifetime", lifetime); if (lifetime > 0) { mediaProxyService.setLifetime(lifetime); JiveGlobals .setProperty("mediaproxy.lifetime", String.valueOf(lifetime)); } minPort = ParamUtils.getIntParameter(request, "minport", minPort); maxPort = ParamUtils.getIntParameter(request, "maxport", maxPort); echoPort = ParamUtils.getIntParameter(request, "echoport", echoPort); enabled = ParamUtils.getBooleanParameter(request, "enabled", enabled); JiveGlobals.setProperty("mediaproxy.enabled", String.valueOf(enabled)); if (minPort > 0 && maxPort > 0) { if (maxPort - minPort > 1000) { mediaProxyService.setMinPort(minPort); mediaProxyService.setMaxPort(maxPort); JiveGlobals.setProperty("mediaproxy.portMin", String.valueOf(minPort)); JiveGlobals.setProperty("mediaproxy.portMax", String.valueOf(maxPort)); } } if (echoPort > 0){ mediaProxyService.setEchoPort(echoPort); JiveGlobals.setProperty("mediaproxy.echoPort", String.valueOf(echoPort)); } mediaProxyService.setEnabled(enabled); // Log the event webManager.logEvent("edited media proxy settings", "minport = "+minPort+"\nmaxport = "+maxPort+"\nechoport = "+echoPort+"\nenabled = "+enabled+"\nlifetime = "+lifetime+"\nkeepalivedelay = "+keepAliveDelay); success = true; } %> Media Proxy


<% if (success) { %>
Success

<% } %>
>
 
 
 
>
">
<% if (mediaProxyService.isEnabled()) { %>


<% // Print the list of agents Collection sessions = mediaProxyService.getAgents(); if (sessions.isEmpty()) { %> <% } int i = 0; for (MediaProxySession proxySession : sessions) { i++; %> "> <% } %>
  A B
<%= i %> <%=proxySession.getCreator()%> <%=proxySession.getHostA()%>:<%=proxySession.getLocalPortA()%> <%=proxySession.getHostB()%>:<%=proxySession.getLocalPortB()%> <%=proxySession.getLocalhost()%> <%=(System.currentTimeMillis() - proxySession.getTimestamp()) / 1000%> <% if (proxySession instanceof RelaySession) { %> Smart Session <% } else { %> Fixed Session <% } %>
"/>
<% } // end enabled check %>