Wowza Community

Play duration of http session

Hello

I have some problem about http session in Wowza.

Some client connect to wowza with same httpsession id during 2.5hr

2012-05-11      18:44:29        CST     connect cupertino       INFO    200     1564575586      -       _defaultVHost_  live 
2012-05-11      18:45:10        CST     comment server  INFO    200     -       [onStreamDestroy] HttpSessionId: 1564575586
2012-05-11      21:05:48        CST     connect cupertino       INFO    200     1564575586      -       _defaultVHost_  live

If we call httpSession.rejectSession() to reject some invalid session, some client may reconnect many times every 30 seconds for a long time

2012-05-01      00:30:21        CST     comment server  WARN    200     -       HTTPStreamerAdapterCupertinoStreamer.onMediaFile[live/_definst_/flv:xxx.3gp/media_37064.ts?wowzasessionid=1527301269]: Session not accepted. -       -       -       370317.356      -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -
2012-05-01      00:30:51        CST     comment server  WARN    200     -       HTTPStreamerAdapterCupertinoStreamer.onMediaFile[live/_definst_/flv:xxx.3gp/media_37064.ts?wowzasessionid=1527301269]: Session not accepted. -       -       -       370347.294      -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -
2012-05-01      00:31:22        CST     comment server  WARN    200     -       HTTPStreamerAdapterCupertinoStreamer.onMediaFile[live/_definst_/flv:xxx.3gp/media_37064.ts?wowzasessionid=1527301269]: Session not accepted. -       -       -       370378.575      -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -
2012-05-01      00:31:54        CST     comment server  WARN    200     -       HTTPStreamerAdapterCupertinoStreamer.onMediaFile[live/_definst_/flv:xxx.3gp/media_37064.ts?wowzasessionid=1527301269]: Session not accepted. -       -       -       370410.631      -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -
2012-05-01      00:32:21        CST     comment server  WARN    200     -       HTTPStreamerAdapterCupertinoStreamer.onMediaFile[live/_definst_/flv:xxx.3gp/media_37064.ts?wowzasessionid=1527301269]: Session not accepted. -       -       -       370437.363      -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -
...
2012-05-01      01:48:25        CST     comment server  WARN    200     -       HTTPStreamerAdapterCupertinoStreamer.onMediaFile[live/_definst_/flv:xxx.3gp/media_37064.ts?wowzasessionid=1527301269]: Session not accepted. -       -       -       375001.147      -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -
2012-05-01      01:48:54        CST     comment server  WARN    200     -       HTTPStreamerAdapterCupertinoStreamer.onMediaFile[live/_definst_/flv:xxx.3gp/media_37064.ts?wowzasessionid=1527301269]: Session not accepted. -       -       -       375030.541      -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -
2012-05-01      01:49:24        CST     comment server  WARN    200     -       HTTPStreamerAdapterCupertinoStreamer.onMediaFile[live/_definst_/flv:xxx.3gp/media_37064.ts?wowzasessionid=1527301269]: Session not accepted. -       -       -       375060.515      -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -
2012-05-01      01:49:54        CST     comment server  WARN    200     -       HTTPStreamerAdapterCupertinoStreamer.onMediaFile[live/_definst_/flv:xxx.3gp/media_37064.ts?wowzasessionid=1527301269]: Session not accepted. -       -       -       375090.569      -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -
2012-05-01      01:50:24        CST     comment server  WARN    200     -       HTTPStreamerAdapterCupertinoStreamer.onMediaFile[live/_definst_/flv:xxx.3gp/media_37064.ts?wowzasessionid=1527301269]: Session not accepted. -       -       -       375120.557      -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -
2012-05-01      01:50:54        CST     comment server  WARN    200     -       HTTPStreamerAdapterCupertinoStreamer.onMediaFile[live/_definst_/flv:xxx.3gp/media_37064.ts?wowzasessionid=1527301269]: Session not accepted. -       -       -       375150.599      -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -       -
2012-05-01      01:51:28        CST     comment server  INFO    200     -       [onStreamDestroy] HttpSessionId: 1527301269

Since we estimate user play duration in onStreamDestroy, it will cause overestimation.

Is there any way to avoid this situation or it’s all about user behavior?

I don’t know what else you can do but to continue to reject the session. Are you sure it is complicating your accounting method? It shouldn’t, there should be no duration for that session, or negligible. You could mark sessions using Properties container.

public void onHTTPSessionCreate(IHTTPStreamerSession httpSession) {
		getLogger().info("onHTTPSessionCreate: " + httpSession.getSessionId());
		httpSession.getStream().getProperties().setProperty("rejectedSession", "true");
	}

Then check it in onStreamDestroy:

	public void onStreamDestroy(IMediaStream stream) {
		getLogger().info("onStreamDestroy: " + stream.getSrc());
		Boolean isRejected = stream.getProperties().getPropertyBoolean("rejectedSession", false);
	}

Richard