# Application.xml custom global variables

**URL:** <https://community.wowza.com/t/application-xml-custom-global-variables/150>\
**Category:** Wowza Streaming Engine\
**Created:** [September 5, 2011, 9:25am UTC](https://community.wowza.com/t/application-xml-custom-global-variables/150 "2011-09-05T09:25:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/system/32/447_2.png) [@system](https://community.wowza.com/u/system)\
**Post date:** [September 5, 2011, 9:25am UTC](https://community.wowza.com/t/application-xml-custom-global-variables/150/1 "2011-09-05T09:25:20Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [September 6, 2011, 1:40pm UTC](https://community.wowza.com/t/application-xml-custom-global-variables/150/2 "2011-09-06T13:40:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Hans\_Ketelbueters](https://avatars.discourse-cdn.com/v4/letter/h/d78d45/32.png) [@Hans\_Ketelbueters](https://community.wowza.com/u/Hans_Ketelbueters)\
**Post date:** [October 7, 2011, 1:37pm UTC](https://community.wowza.com/t/application-xml-custom-global-variables/150/3 "2011-10-07T13:37:47Z")

</div>

I guess it can be done with the right code?

I see these variables can be used in Application.xml

```auto
<!-- 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?

---

<div class="post-metadata">

**Author:** ![Hans\_Ketelbueters](https://avatars.discourse-cdn.com/v4/letter/h/d78d45/32.png) [@Hans\_Ketelbueters](https://community.wowza.com/u/Hans_Ketelbueters)\
**Post date:** [October 19, 2011, 12:57pm UTC](https://community.wowza.com/t/application-xml-custom-global-variables/150/4 "2011-10-19T12:57:13Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [October 7, 2011, 6:28pm UTC](https://community.wowza.com/t/application-xml-custom-global-variables/150/5 "2011-10-07T18:28:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [October 19, 2011, 7:02pm UTC](https://community.wowza.com/t/application-xml-custom-global-variables/150/6 "2011-10-19T19:02:09Z")

</div>

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,

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

```

Then use WMSProperties to get or set. For example:

```auto
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:

```auto
Server server = Server.getInstance();

```

Richard
