Wowza RTSP stream type

How do I test if this session was a play or publish?

public void onRTPSessionDestroy(RTPSession rtpSession){
    if (rtpSession.isWebRTC()){
        getLogger().info("ModuleListenWebRTCSession.onRTPSessionDestroy["+rtpSession.getSessionId()+"]");

        //we need to know if it's a publish or play
        //rtpSession.getRTSPStream();
 
	
    }

}

Hi @Samson Radu, maybe better to implement IMediaStreamActionNotify2 and check onUnPublish?

I just found the .getMode() method to work with. What do you think?

rtpSession.getRTSPStream().getMode() == RTPStream.MODE_PUBLISH