Results 1 to 3 of 3

Thread: Not able to handle the callbcks for http streams

  1. #1
    Join Date
    May 2015
    Posts
    2

    Default Not able to handle the callbcks for http streams

    We want to restrict the stream url access for multiple users in the same time.


    We tried with md5 generation of URL and provided expiry of the url for 2 hrs

    In the mean time, if i copy the url from wowza logs and play , it is playing for multiple users

    there is no restriction

    Then we are implementing in the following way
    To achieve this

    we created mysql db with one table to track all these

    when the user connects then we are validating whether the record is in db or not

    If yes , we will check the status


    if status is 0 we will not allow the user to watch the stream

    if status is 1 then we will allow the user to watch the stream. then In play event updating the status to 0 .

    If not

    we will insert the new record with status 0 and allowing user to watch the stream

    Once User stops playing the video. then updating them to 1.

    To handle this for RTSP i am able to handle the events call backs by using IMediaStreamActionNotify3 interface.

    But for HTTP, I am not able to find any event call backs to perform the above validation like looking for connect,play and stop events.

    Please any one suggest me on this.this is very urgent

    Appreciate the response
    Last edited by madupathi; 05-07-2015 at 08:30 PM.

  2. #2
    Join Date
    May 2013
    Posts
    680

    Default

    For the initial http session creation, you can leverage the following event handler:

    onHTTPSessionCreate(IHTTPStreamerSession httpSession)
    Thereafter, each subsequent request could be handled using the following:

    public void onHTTPStreamerRequest(IHTTPStreamerSession httpSession, IHTTPStreamerRequestContext reqContext)
    The above event is called for every streamer request. You won't be able to determine a stop event here but you can handle that when the session is timed out.

    Thanks,

    Matt

  3. #3
    Join Date
    May 2015
    Posts
    2

    Default

    Hi Matt,

    Is there any way i can identify if the request is coming from the same device forthe second session.

    I am using following logic.


    public void onHTTPSessionCreate(IHTTPStreamerSession httpSession) { getLogger().info(
    "AptvAuth: onHTTPSessionCreate sessionID :"
    + httpSession.getSessionId());
    getLogger().info(
    "AptvAuth: onHTTPSessionCreate streamName :");
    if (this.key == null) {
    loadKey(httpSession);
    }

    if (this.key == null) {
    this.key = "12345678";
    }





    // if(!isRequestExist){
    // isRequestExist=true;
    getLogger().info("AptvAuth: onHTTPSessionCreate isRequestExist" +isRequestExist);
    if (!isRequestExist) {
    try {
    Set keyset = httpSession.getHTTPHeaderNames();
    Iterator itr =keyset.iterator();
    while(itr.hasNext())
    {
    String key= itr.next().toString();
    String value=httpSession.getHTTPHeader(key);
    getLogger().info(
    "AptvAuth: KEY ::"+key);
    getLogger().info(
    "AptvAuth: VALUE ::"+value);


    }

    isRequestExist = true;
    // Thread.sleep(1000);
    if (!validate(httpSession)) {
    isRequestValid = false;
    httpSession.rejectSession();
    getLogger()
    .info(
    "AptvAuth: onHTTPSessionCreate in Validating the request");
    } else {

    GetConnection.updateRecordToTable(getMd5(), getLogger(), 0);
    isRequestValid = true;
    httpSession.acceptSession();

    }
    } catch (SQLException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    }
    }
    // catch (InterruptedException e) {
    // // TODO Auto-generated catch block
    // e.printStackTrace();
    // }
    else {
    try {
    Thread.sleep(1000);
    if (!validate(httpSession)) {
    isRequestValid = false;
    httpSession.rejectSession();
    getLogger()
    .info(
    "AptvAuth: onHTTPSessionCreate in Validating the request");
    } else {
    GetConnection.updateRecordToTable(getMd5(), getLogger(), 0);
    isRequestValid = true;
    httpSession.acceptSession();

    }
    } catch (SQLException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    } catch (InterruptedException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    }

    }
    can you please suggest me on this.

    Regards
    Arun

Similar Threads

  1. Wowza only records strems longer than 5 seconds.
    By Andres in forum General Forum
    Replies: 2
    Last Post: 07-12-2013, 05:22 AM
  2. Replies: 1
    Last Post: 07-19-2012, 03:11 PM
  3. Replies: 1
    Last Post: 05-06-2012, 07:11 AM
  4. How to handle a "File not found" - Error in Playlist, while repeating is on
    By Neutralo in forum Server-side Modules and Code Samples Discussion
    Replies: 1
    Last Post: 02-03-2012, 07:15 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
  •