Wowza Community

Smoothstreaming session not entering onHTTPSessionCreate(IHTTPStreamerSession session

Hi Guys,

Is there a special setting we had to make the smoothstreaming session enter the method onHTTPSessionCreate(IHTTPStreamerSession session) of the interface IModuleOnHTTPSession?

We are currently building a module that would redirect connections to a different server using IModuleOnHTTPSession and It works alright with HLS and MPEG DASH but the smoothstreaming session dont even seemed to enter the method onHTTPSessionCreate.

We are using Wowza Streaming Engine 4 Perpetual Edition 4.1.2 build13947 on our production environment and we also tried it with Wowza Streaming Engine 4 Perpetual Edition 4.2.0.01 build15394 but both of them shows the same problem.

Here is the snippet of the code we are using:

public class LoadBalancerMain extends ModuleBase implements IModuleOnHTTPSession, IModuleOnHTTPSmoothStreamingSession {
	private static final Class<LoadBalancerMain> CLASS = LoadBalancerMain.class;
	private static final String TAG = "LoadBalancerMain";
	SVDBConnection SVCon = null;
	String methodName = "";
	
	public void onAppStart(IApplicationInstance appInstance) {
		SVCon = new SVDBConnection(appInstance);
	}
	
	@Override
	public void onHTTPSessionCreate(IHTTPStreamerSession session) {
		methodName = "onHTTPSessionCreate(IHTTPStreamerSession session)";
		//int sessionIP = InetAddresses.coerceToInteger(InetAddresses.forString(session.getIpAddress()));
		String sessionIP = session.getIpAddress();
		String streamName = session.getStreamName();
		String queryParameters = session.getQueryStr();
		String appName = session.getAppInstance().getApplication().getName();
		WMSLoggerFactory.getLogger(CLASS).info(TAG + ": " + methodName + ": IPADDRESS: " + session.getIpAddress() + ", URL: " + session.getUri());
		String urlRedirect = SVCon.getURL(sessionIP, streamName, appName, session.getSessionProtocol(), queryParameters);
		if (!urlRedirect.isEmpty()) {
			WMSLoggerFactory.getLogger(CLASS).info(TAG + ": " + methodName + ": IPADDRESS: " + session.getIpAddress() + ", URL Redirect: " + urlRedirect);
			session.redirectSession(urlRedirect);
		}
		else {
			WMSLoggerFactory.getLogger(CLASS).info(TAG + ": " + methodName + ": IPADDRESS: " + session.getIpAddress() + ", URL Redirect: Unable to find node");
			session.rejectSession();
		}
		
		
		
		
	}
	@Override
	public void onHTTPSessionDestroy(IHTTPStreamerSession session) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void onHTTPSmoothStreamingSessionCreate(HTTPStreamerSessionSmoothStreamer session) {
		// TODO Auto-generated method stub
		methodName = "onHTTPSmoothStreamingSessionDestroy(HTTPStreamerSessionSmoothStreamer session)";
		//int sessionIP = InetAddresses.coerceToInteger(InetAddresses.forString(session.getIpAddress()));
		String sessionIP = session.getIpAddress();
		String streamName = session.getStreamName();
		String queryParameters = session.getQueryStr();
		String appName = session.getAppInstance().getApplication().getName();
		WMSLoggerFactory.getLogger(CLASS).info(TAG + ": " + methodName + ": IPADDRESS: " + session.getIpAddress() + ", URL: " + session.getUri());
		String urlRedirect = SVCon.getURL(sessionIP, streamName, appName, session.getSessionProtocol(), queryParameters);
		if (!urlRedirect.isEmpty()) {
			WMSLoggerFactory.getLogger(CLASS).info(TAG + ": " + methodName + ": IPADDRESS: " + session.getIpAddress() + ", URL Redirect: " + urlRedirect);
			session.redirectSession(urlRedirect);
		}
		else {
			WMSLoggerFactory.getLogger(CLASS).info(TAG + ": " + methodName + ": IPADDRESS: " + session.getIpAddress() + ", URL Redirect: Unable to find node");
			session.rejectSession();
		}
		
	}
	@Override
	public void onHTTPSmoothStreamingSessionDestroy(HTTPStreamerSessionSmoothStreamer session) {
		// TODO Auto-generated method stub
		
		
	}

As you can see in the code we even tried to implement IModuleOnHTTPSmoothStreamingSession just to make sure but still to no avail.

When an HLS or MPEg DASH client connects to this module we can see from the logs that they are getting redirected and content plays successfully.

2015-08-28	10:36:49	CEST	comment	server	INFO	200	-	LoadBalancerMain: onHTTPSessionCreate(IHTTPStreamerSession session): IPADDRESS: <Intentionally removed>, URL Redirect: http://<Intentionally removed>/SVliveTr1/33.smil/playlist.m3u8?device_id=ccfa00a8f508&user_id=1055&signature=29231ca31126547fb63181f26847937ae7786248&expire=2015-08-28%2011:36:47&id_channel=6033	-	-	-	61.658	-	-	-	-	--	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-

But with Smoothstreaming we receive this error and no logs at all from the module:

2015-08-28	10:37:39	CEST	comment	server	WARN	200	-	HTTPStreamerAdapterSmoothStreamer.onManifest: LiveStreamPacketizer not found [52_720p]: smoothstreamingpacketizer	-	-	-	111.23	-	-	-	-	-	-	-	-	-	--	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2015-08-28	10:37:39	CEST	comment	server	WARN	200	-	HTTPStreamerAdapterSmoothStreamer.onManifest: LiveStreamPacketizer not found [52_360p]: smoothstreamingpacketizer	-	-	-	111.231	-	-	-	-	-	-	-	-	-	--	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2015-08-28	10:37:39	CEST	comment	server	WARN	200	-	HTTPStreamerAdapterSmoothStreamer.onManifest: LiveStreamPacketizer not found [52_240p]: smoothstreamingpacketizer	-	-	-	111.232	-	-	-	-	-	-	-	-	-	--	-	-	-	-	-	-	-	-	-	-	-	-	-	-

Seems like Wowza is looking for the streams inside the application and it’s not finding them which is logical since the streams are not in this application.

Is this a bug or we are missing something?

Regards,

Ferdinand

It looks like you don’t have the smooth packetizer enabled in the application configuration. You can do this by logging in to Engine Manager, going to the appropriate application and enabling “Microsoft Smooth Streaming” under “Playback Types”.

It looks like you don’t have the smooth packetizer enabled in the application configuration. You can do this by logging in to Engine Manager, going to the appropriate application and enabling “Microsoft Smooth Streaming” under “Playback Types”.

Hi SiggDev,

The smoothstreaming packatizer is enabled. It is also enable on the httpStreamer property. What I noticed about this is that smoothstreaming requests doesnt actually go through the onHTTPSessionCreate code. It seems like it is getting overridden by something. So it looks for the streams being requested inside the application instead of redirecting the request. What i am wanted to do is just redirect any request without regards to what stream they are trying to play.

Regards,

ok it seems like for smoothstreaming, the code works only if the content is actually available in th eapplication otherwise the error HTTPStreamerAdapterSmoothStreamer.onManifest: LiveStreamPacketizer not found fires first.

Is there a work around to this? is there a way to make wowza not check if the streams are actually available before firing onHTTPSessionCreate for smoothstreaming? What is weird is that it works like this only for smoothstreaming, for dash and hls it’s OK.

The module we are developing is actually for a wowza application which will have no streams attached to it (or any access to any stream), and that it’s only job will be to redirect clients to the server that actually have the streams.