My goal is to achieve service, where some people are talking in realtime and the others are just watching.
So, every user can connect to a stream for listening, but only the chosen ones can publish in that streams.
The problem is that when somebody legally publishing (speaking) on a stream – the other one, let's call him a hacker – can also try to publish on that stream. There's no problem to detect that he is trying to hack, the problem is how to kick him off. stream.getClient().shutdownClient(), stream.shutdown(), stream.close() – is all wrong, legall publisher will stop publish content and subscribes will see that he is disconnected. I think the problem is that I'm disconnecting hacker after he rule on the stream.
So, I can't figure out how to disconnect user when he is trying to publish something before he actually 'touches' the stream.
I'm using onPublish called of a stream.addClientListener on a IMediaStreamActionNotify2.
I can't block publishing with a standard way with passwords file – because access to publishing must be granted in real time. (e.g. operator decides, who can and who cannot).
The solution is easy – I need a hook like onBeforePublish, but I can't find it.
Thanks and hello from Sibirea!