# ModuleTimedDisconnect Exceptions

**URL:** <https://community.wowza.com/t/moduletimeddisconnect-exceptions/43150>\
**Category:** Wowza Developer Dojo\
**Tags:** wowza-streaming-server-java-api\
**Created:** [June 1, 2014, 10:31am UTC](https://community.wowza.com/t/moduletimeddisconnect-exceptions/43150 "2014-06-01T10:31:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ryan\_Litwin](https://avatars.discourse-cdn.com/v4/letter/r/6bbea6/32.png) [@Ryan\_Litwin](https://community.wowza.com/u/Ryan_Litwin)\
**Post date:** [June 1, 2014, 10:31am UTC](https://community.wowza.com/t/moduletimeddisconnect-exceptions/43150/1 "2014-06-01T10:31:05Z")

</div>

I’m not exactly sure how to configure prefixes and exemptions to the time out rule. I would like to have the module in place so we don’t have viewer chewing up bandwidth for no good reason. However, I would like to play the stream in my retail establishment continuously, with no time out. Is this something that can be done by exempting IP address. We have a static IP.

---

<div class="post-metadata">

**Author:** ![Matt\_Young](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/matt_young/32/389_2.png) [@Matt\_Young](https://community.wowza.com/u/Matt_Young)\
**Post date:** [June 2, 2014, 5:15am UTC](https://community.wowza.com/t/moduletimeddisconnect-exceptions/43150/2 "2014-06-02T05:15:04Z")

</div>

It sounds like you’d need to modify the ModuleTimedDisconnect module (source included within the Module Collection) to check for an IP address (your continuous stream playback IP) as an exception. It currently only whitelists by user agent (flash version).

---

<div class="post-metadata">

**Author:** ![Matt\_Young](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/matt_young/32/389_2.png) [@Matt\_Young](https://community.wowza.com/u/Matt_Young)\
**Post date:** [June 4, 2014, 4:31am UTC](https://community.wowza.com/t/moduletimeddisconnect-exceptions/43150/3 "2014-06-04T04:31:05Z")

</div>

I’d suggest adding another function to the source of ModuleTimedDisconnect that checks the IP address against your new property for whitelisted IP’s in addition to the user agent check.

---

<div class="post-metadata">

**Author:** ![Matt\_Young](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/matt_young/32/389_2.png) [@Matt\_Young](https://community.wowza.com/u/Matt_Young)\
**Post date:** [June 9, 2014, 10:39am UTC](https://community.wowza.com/t/moduletimeddisconnect-exceptions/43150/4 "2014-06-09T10:39:10Z")

</div>

That could work. You would likely want to add support for http and rtp connections as well in their respective conditionals using httpSession.getIpAddress() and rtpSession.getIp(). You will also want to put back the test for 127.0.0.1 originally in the code.

---

<div class="post-metadata">

**Author:** ![Ryan\_Litwin](https://avatars.discourse-cdn.com/v4/letter/r/6bbea6/32.png) [@Ryan\_Litwin](https://community.wowza.com/u/Ryan_Litwin)\
**Post date:** [June 3, 2014, 7:04pm UTC](https://community.wowza.com/t/moduletimeddisconnect-exceptions/43150/5 "2014-06-03T19:04:34Z")

</div>

OK so I would just add a _value_ which would be the static IP of the location it will be played \>\> timedDisconnectAllowedAgents

---

<div class="post-metadata">

**Author:** ![Ryan\_Litwin](https://avatars.discourse-cdn.com/v4/letter/r/6bbea6/32.png) [@Ryan\_Litwin](https://community.wowza.com/u/Ryan_Litwin)\
**Post date:** [June 4, 2014, 7:26am UTC](https://community.wowza.com/t/moduletimeddisconnect-exceptions/43150/6 "2014-06-04T07:26:13Z")

</div>

[HTML]IClient client = clients.next();

if (client.getTimeRunningSeconds() \> disconnectTime)

{

if (!client.getIp().equals(“my-static-ip”) && checkAllowedUserAgent(client.getFlashVer()))

{

if (debugLog)

logger.info(MODULE\_NAME + ": RTMP disconnecting client " + client.getClientId() + " FlashVer is " + client.getFlashVer(), WMSLoggerIDs.CAT\_application, WMSLoggerIDs.EVT\_comment);

client.setShutdownClient(false);

}

}[/HTML]

Something like that?
