Wowza Community

Application.xml custom global variables

For RTSP to work, these variables need to be set in each Applicaton.xml file.

RTSPBindIpAddress, RTSPConnectionIpAddress, RTSPOriginIpAddress

As these values are equal for all applications on a certain server, it would be handy and a lot more managable to define these values on a higher level.

Is it possible to define a custom global variable in a startup script or global config file, and use it in Application.xml?

Not that I know of. You can alter the /conf/Application.xml file, and if all your applications use same configuration then don’t make a /conf/[app-name/Application.xml so that the /conf/Application.xml is used.

Richard

I guess it can be done with the right code?

I see these variables can be used in Application.xml

<!-- StorageDir path variables
${com.wowza.wms.AppHome} - Application home directory 
${com.wowza.wms.ConfigHome} - Configuration home directory
${com.wowza.wms.context.VHost} - Virtual host name
${com.wowza.wms.context.VHostConfigHome} - Virtual host config directory
${com.wowza.wms.context.Application} - Application name
${com.wowza.wms.context.ApplicationInstance} - Application instance name 
-->

Can you point us in the right direction to do something similar, but for custom variables?

Indeed not exactly what we are looking for. But I used a system variable for troubleshooting purposes.

When using ${com.wowza.wms.context.VHost} in Application.xml in the StorageDir element, I can see it translates to the value of VHost.

When using for RTSPBindIpAddress element it does not:

INFO server comment - RTPUDPTransport.unbind[demo/definst]: ${com.wowza.wms.context.VHost}:6970

Is there no way at all to set these RTSP addresses using a variable?

Actually, is this not more like a design issue?

Wouldn’t it be more logical to make these RTSP settings configurable at vhost or server level?

There is not the system variables that you are looking for as far as I know.

On a Wowza devpay EC2 instance there are EC2 variables that include this data.

Richard

You can make configurable variables for application, vhost or server by adding Property settings to the Properties list of an Application.xml, VHost.xml or the Server.xml,

<Property>
	<Name>var</Name>
	<Value>val</Value>
</Property>

Then use WMSProperties to get or set. For example:

IVHost vhost = VHostSingleton.getInstance(VHost.VHOST_DEFAULT);
vhost.getProperties().setProperty("var", "val");
String var = vhost.getProperties().getPropertyStr("var");

You can do get server reference and do same:

Server server = Server.getInstance();

Richard