Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: onHTTPSessionCreate does not trigger

  1. #1
    Join Date
    Dec 2011
    Posts
    28

    Default onHTTPSessionCreate does not trigger

    Hi,

    I found a problem in wowza.

    We set up a live-origin-edge service with wowza.

    If user play url like "http://[edgeServerIP]/live/myStream/playlist.m3u8?wowzasessionid=xxxxx"
    It will not trigger onHTTPSessionCreate.
    The log is
    INFO server comment - onAppStart: live/_definst_
    INFO application app-start _definst_ live/_definst_
    INFO server comment - onStreamCreate
    INFO stream create - -
    INFO server comment - MediaStreamHTTPStreamerRepeaterBuffer.initLiveStreamRepeating: receiverClass: com.wowza.wms.httpstreamer.cupertinostreaming.liverepeater.CupertinoStreamerLiveRepeaterReceiver
    INFO server comment - onPublish
    INFO server comment - LiveMediaStreamReceiver.connect: rtmp://[originServerIP]:1935/live/_definst_/myStream
    INFO server comment - CupertinoStreamerLiveRepeaterReceiver.close: live/_definst_/myStream:myStream:cupertinostreamingpacketizer
    INFO server comment - CupertinoStreamerLiveRepeaterReceiver.resetStream: live/_definst_/myStream:cupertinostreamingpacketizer
    INFO server comment - onStreamCreate
    INFO server comment - CupertinoStreamerLiveRepeaterReceiver.initLiveStreamPacketizer: live/_definst_/myStream:myStream:cupertinostreamingpacketizer
    INFO server comment - LiveStreamPacketizerCupertino.init[live/_definst_/myStream]: chunkDurationTarget: 10000
    INFO server comment - LiveStreamPacketizerCupertino.init[live/_definst_/myStream]: chunkDurationTolerance: 500
    INFO server comment - LiveStreamPacketizerCupertino.init[live/_definst_/myStream]: audioGroupCount: 3
    INFO server comment - LiveStreamPacketizerCupertino.init[live/_definst_/myStream]: playlistChunkCount:3
    INFO server comment - MediaStreamMap.getLiveStreamPacketizer: Create live stream packetizer: cupertinostreamingpacketizer:myStream
    INFO cupertino connect 235766135 -
    INFO server comment - onStreamCreate
    INFO server comment - MediaStreamHTTPStreamerRepeaterPlay: startPlay
    INFO stream create rtmp://[originServerIP]:1935/live/_definst_/myStream
    INFO stream play rtmp://[originServerIP]:1935/live/_definst_/myStream

    If user play url like "http://[edgeServerIP]/live/myStream/playlist.m3u8"
    It works fine.
    The log is
    INFO server comment - onAppStart: live/_definst_
    INFO application app-start _definst_ live/_definst_
    INFO server comment - onStreamCreate
    INFO stream create - -
    INFO server comment - MediaStreamHTTPStreamerRepeaterBuffer.initLiveStreamRepeating: receiverClass: com.wowza.wms.httpstreamer.cupertinostreaming.liverepeater.CupertinoStreamerLiveRepeaterReceiver
    INFO server comment - onPublish
    INFO server comment - LiveMediaStreamReceiver.connect: rtmp://[originServerIP]:1935/live/_definst_/myStream
    INFO server comment - CupertinoStreamerLiveRepeaterReceiver.close: live/_definst_/myStream:myStream:cupertinostreamingpacketizer
    INFO server comment - CupertinoStreamerLiveRepeaterReceiver.resetStream: live/_definst_/myStream:cupertinostreamingpacketizer
    INFO server comment - onStreamCreate
    INFO server comment - CupertinoStreamerLiveRepeaterReceiver.initLiveStreamPacketizer: live/_definst_/myStream:myStream:cupertinostreamingpacketizer
    INFO server comment - LiveStreamPacketizerCupertino.init[live/_definst_/myStream]: chunkDurationTarget: 10000
    INFO server comment - LiveStreamPacketizerCupertino.init[live/_definst_/myStream]: chunkDurationTolerance: 500
    INFO server comment - LiveStreamPacketizerCupertino.init[live/_definst_/myStream]: audioGroupCount: 3
    INFO server comment - LiveStreamPacketizerCupertino.init[live/_definst_/myStream]: playlistChunkCount:3
    INFO server comment - MediaStreamMap.getLiveStreamPacketizer: Create live stream packetizer: cupertinostreamingpacketizer:myStream
    INFO cupertino connect 1949153657 -
    INFO server comment - onStreamCreate
    INFO server comment - MediaStreamHTTPStreamerRepeaterPlay: startPlay
    INFO stream create rtmp://[originServerIP]:1935/live/_definst_/myStream
    INFO server comment - onHTTPSessionCreate: 1949153657
    INFO server comment - onHTTPCupertinoStreamingSessionCreate: 1949153657
    WARN server comment - reject session id: 1949153657
    WARN server comment - HTTPStreamerAdapterCupertinoStreamer.onPlaylist[live/myStream/playlist.m3u8]: Session not accepted[1949153657]
    Since we authorize our user in onHTTPCupertinoStreamingSessionCreate event handler, it will cause we cannot reject illegal user if they take wowzasessionid in query string.


    Thanks,
    Roy

  2. #2
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    Roy,

    In my test, adding wowzasessionid did not have that affect. onHTTPSessionCreate did run. I compiled this:

    package test;
    
    import com.wowza.wms.httpstreamer.model.IHTTPStreamerSession;
    import com.wowza.wms.module.*;
    import com.wowza.wms.application.*;
    
    public class ModuleAccessControlHTTPStreaming extends ModuleBase
    {
    	public void onHTTPSessionCreate(IHTTPStreamerSession httpSession)
    	{
    		boolean isGood = true;
    		
    		String ipAddressClient = httpSession.getIpAddress();
    		String ipAddressServer = httpSession.getServerIp();
    		String queryStr = httpSession.getQueryStr();
    		String referrer = httpSession.getReferrer();
    		String cookieStr = httpSession.getCookieStr();
    		String userAgent = httpSession.getUserAgent();
    		
    		IApplicationInstance appInstance = httpSession.getAppInstance();
    		String streamName = httpSession.getStreamName();
    		
    		// Here you can use the request and session information above to determine 
    		// if you want to reject the connection
    		// isGood = true/false;
    		
    		getLogger().info("ModuleAccessControlHTTPStreaming.onHTTPSessionCreate["+appInstance.getContextStr()+":"+streamName+"]: accept:"+isGood);
    		
    		if (!isGood)
    			httpSession.rejectSession();
    	}
    }
    And added this module to /conf/vod/Application.xml for my test:

    <Module>
    	<Name>ModuleAccessControlHTTPStreaming</Name>
    	<Description>ModuleAccessControlHTTPStreaming</Description>
    	<Class>test.ModuleAccessControlHTTPStreaming</Class>
    </Module>
    I ran with and without wowzasessionid and both times see "INFO server comment - ModuleAccessControlHTTPStreaming.onHTTPSessionCreate[vod/_definst_:sample.mp4]: accept:true" in the console.

    Richard

  3. #3
    Join Date
    Dec 2011
    Posts
    28

    Default

    Hi, Richard

    Thanks for your testing.

    In my test, if Application StreamType set to VOD or Live.
    It works fine with and without wowzasessionid.

    The problem only occurs if Application StreamType set liverepeater-edge.

    The edge server version is "#Software: Wowza Media Server 3.1.2 build1624"
    The origin server version is "#Software: Wowza Media Server 2.2.3.12 build27289"

    Thanks,
    Roy

  4. #4
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    Roy,

    I will have to test more later today. Are you able to establish a playback session that actually plays using a made-up wowzasessionid, or one from another session?

    Richard

  5. #5
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    I have been testing and I don't think this is an issue. Wowza ignores a made-up wowzasessionid, and onHTTPCreateSession runs as necessary, in applications with StreamType live, vod and liverepeater-edge in my tests

    Richard

  6. #6
    Join Date
    Dec 2011
    Posts
    28

    Default

    Richard,

    Thanks for your testing again.

    My reproduce step is
    1. start up wowza
    2. connect live-repeater application with some specific wowzasessionid
    3. device playbacks video but server does not log onHTTPSessionCreate

    In this case, is this wowzasessionid a made-up session?
    Wowza server just start up and never allocate session.
    The client just take wowzasessionid in query string, it makes itself a valid session and playback without any authentication.

    Something strange is that some specific wowzasessionid can work, not any random number could cause this problem.

    Thanks,
    Roy

  7. #7
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    Roy,

    I'll test again. Did you get the wowzasessionid from another session? Or is it the string length?

    Richard

  8. #8
    Join Date
    Dec 2011
    Posts
    28

    Default

    I found this problem because some invalid user play our stream for a while with those specific wowzasessionid.
    I have no idea how they get these specific wowzasessionid.
    And these wowzasessiond works on other wowza server(ex: my testing server) in my reproduce step.

    Here are some example
    wowzasessionid=1682498420
    wowzasessionid=400685476
    wowzasessionid=1770083500
    wowzasessionid=149622051

    Thanks,
    Roy

  9. #9
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    Roy,

    I tried again, I cannot replicate. If I add ?wowzasessionid=1682498420 to the playlist.m3u8 in the html page, onHTTPSessionCreate still runs in a livestream-edge application.

    Richard

  10. #10
    Join Date
    Dec 2011
    Posts
    28

    Default

    Richard,

    I have re-installed the last version wowza.(Wowza Media Server 3.5.0 build2989)

    And use your sample code to build module and modify the config file to setup liverepeater-edge application.
    The problem still exists.

    I will send config and log files to support@wowza.com
    Please help me to check what's wrong with my setting.

    Thanks,
    Roy

Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 5
    Last Post: 06-02-2014, 09:35 AM
  2. Check for SSL in OnConnect and onHTTPSessionCreate
    By karelboek in forum Wowza Streaming Server Java API
    Replies: 0
    Last Post: 04-04-2014, 07:55 AM
  3. Stream not found before onHTTPSessionCreate
    By Renato@Voitel in forum General Forum
    Replies: 2
    Last Post: 06-19-2013, 08:06 AM
  4. IRandomAccessReader doesn't trigger
    By skorolev in forum Server-side Modules and Code Samples Discussion
    Replies: 2
    Last Post: 06-14-2013, 02:33 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •