Wowza Community

OnConnectAccept() method returns 0 playstream count

Hi,

I am writing a small module so that everytime a client starts or stop a stream I update an external DB, so I can keep a live view of who exactly is watching the live stream at anytime.

I’m using the onConnectAccept method by using the getClient methods, getUri & getQueryStr I’m gathering all the data I need, except the actual stream that client is playing.

My problem is that by using the getPlayStreamsCount method I get a count of “0”, which I would not expect as the connection is already accepted.

What would be the correct way of getting this info ?

Should I use “OnStreamCreate” & then get the Client info from the getClient method ?

Thx

@timothe jahan, the advice from our engineer team is here:

For RTMP, the best option would be to extend the MediaStreamActionNotifyBase class and override the onPlay and onStop methods. For http and rtp streams, the relevant session create and destroy methods should be fine.

What they do need to be careful with when sending data to a remote endpoint is that they don’t stall the server waiting for a response. They should implement their own thread pools or executor to handle the send asynchronously.

If you need assistance setting this up, please submit a support ticket- thanks.

https://www.wowza.com/support/open-ticket

Hello,

Thanks for the answer, I had paused that effort as I was in “feasibility phase” but we now purchased a wowza license so I need to get this to work.

So far I’ll focus on the http sessions which should be sufficient for me. Could you specify the exact method I should modify, possibly even providing code sample ?

Is it the

com.wowza.wms.httpstreamer.model.notifyHTTPSessionCreate

and the com.wowza.wms.httpstreamer.model.notifyHTTPSessionDestroy ?

What is the right syntax to overide the current method without loosing the existing functionality.

Thanks