diff --git a/src/web/pionturn.jsp b/src/web/pionturn.jsp index aaa2b81..42dbd31 100644 --- a/src/web/pionturn.jsp +++ b/src/web/pionturn.jsp @@ -1,4 +1,5 @@ <%@ page import="java.util.*" %> +<%@ page import="java.net.*" %> <%@ page import="org.ifsoft.turn.openfire.*" %> <%@ page import="org.igniterealtime.openfire.plugins.externalservicediscovery.Service" %> <%@ page import="org.jivesoftware.openfire.*" %> @@ -23,12 +24,17 @@ Map services = plugin.getTurnServices(); if (services != null && services.containsKey(service)) { - Service turn = services.get(service); + Service turn = services.get(service); + String ipAddress = turn.getHost(); + + try { + ipAddress = InetAddress.getByName(ipAddress).getHostAddress(); + } catch (Exception e) { } JiveGlobals.setProperty("pionturn.secret", turn.getSharedSecret()); JiveGlobals.setProperty("pionturn.username", turn.getRawUsername()); JiveGlobals.setProperty("pionturn.password", turn.getRawPassword()); - JiveGlobals.setProperty("pionturn.ipaddr", turn.getHost()); + JiveGlobals.setProperty("pionturn.ipaddr", ipAddress); JiveGlobals.setProperty("pionturn.port", String.valueOf(turn.getPort())); }