Below is an example configuration for STUN component. Note that the 2 stun-primary
and 2 stun-secondary
settings are required, where external settings are not.
stun (class: tigase.stun.StunComponent) { 'stun-primary-ip' = '10.0.0.1' 'stun-primary-port' = 3478 'stun-secondary-ip' = '10.0.0.2' 'stun-secondary-port' = 7001 'stun-primary-external-ip' = '172.16.0.22' 'stun-primary-external-port' = 3479 'stun-secondary-external-ip' = '172.16.0.23' 'stun-secondary-external-port' = 7002 }
Primary port should be set to 3478 as it is default port for STUN servers.
stun-primary-ip
- primary IP address of STUN server used for binding (and sending to client if stun-primary-external-ip)stun-primary-port
- primary port of STUN server used for binding (and sending to client if stun-primary-external-port)stun-secondary-ip
- secondary IP address of STUN server used for binding (and sending to client if stun-secondary-external-ip)stun-secondary-ip
- secondary port of STUN server used for binding (and sending to client if stun-secondary-external-port)If you wish to have a secondary STUN server as a backup, or to provide multiple addresses for STUN services, the following may be used.
stun-primary-external-ip
- primary external IP address of STUN server used for sending to client if setstun-primary-external-port
- primary external port of STUN server used for sending to client if setstun-secondary-external-ip
- secondary external IP address of STUN server used for sending to client if setstun-secondary-external-port
- secondary external port of STUN server used for sending to client if setYou man want to use logback for STUN server to append normal server logs.
To do this, specify the logback xml file within java options in the tigase.conf
file.
JAVA_OPTIONS="-Dlogback.configurationFile=etc/logback.xml"
You may configure the logback by editing the xml included with distributions at logback.xml.
What is included is a basic logback configuration that just adds the stun logging.
<configuration scan="true"> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <pattern> %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n </pattern> </encoder> </appender> <logger name="de.javawi.jstun.header.MessageHeader" level="INFO" /> <root level="DEBUG"> <appender-ref ref="STDOUT" /> </root> </configuration>