Results 1 to 9 of 9

Thread: Wowza - PHP API

  1. #1

    Default Wowza - PHP API

    Hi,

    Can we call Wowza server from PHP?
    For example, I would want to disconnect a user from a particular stream or application via PHP. Is this possible?

    Thanks!
    Mansoor

  2. #2
    Join Date
    Dec 2007
    Posts
    25,641

    Default

    You can use HTTProvider, and here is one that will do that:

    http://www.wowzamedia.com/forums/sho...d.php?t=8240#2

    You need to compile with Wowza IDE:
    http://wowzamedia.com/ide.html

    Then add reference to /conf/VHost.xml /HostPort (1935) /HTTProviders. Make it 2nd to last in the list (because the last item is a catchall):

    <HTTPProvider>
    <BaseClass>package com.wowza.wms.plugin.http.HTTPDisconnectClient</BaseClass>
    <RequestFilters>*disconnect</RequestFilters>
    <AuthenticationMethod>none</AuthenticationMethod>
    </HTTPProvider>

    Then call something like:
    http://[wowza-address]:1935/disconnect?id=1234&app=vod

    where "1234" is a clientID, and "vod" is the application name.

    Richard
    Last edited by rrlanham; 01-08-2013 at 06:34 AM.

  3. #3

    Default still works with 3.5?

    Hi,
    This is a 2 ( well, 3) year old post but I believe people still need such a thing. So, does this work with WMS v3.5/IDE v2? If no, any other pointers?
    By the way, the "package" word seems to have been added inadvertently in <BaseClass> line above. Or should it really be like this only?

    Thanks
    Inderjeet

  4. #4
    Join Date
    Dec 2007
    Posts
    25,641

    Default

    Yes, HTTPProviders are supported in Wowza 3.5

    Richard

  5. #5

    Default

    Thank you, Richard.
    I am aware of that, but does the above method work when applied after completing the steps in http://www.wowza.com/forums/showthre...http-request#2

    After doing everything, even opening http://[wowza-url]:1935 shows

    error: null
    disconnected: 0
    (or the ID when supplied with ?disconnect=1234).

    Yes, the module entry in VHost.xml/HTTPProviders is at the right place, just before the last one. Could something have changed in the newer WMS version making the code not to work?

    It would be appropriate to mention here that I am new to Java, but other than that, no problem.

    Thanks for your assistance!
    Sincerely
    Inderjeet

  6. #6
    Join Date
    Dec 2007
    Posts
    25,641

    Default

    Inderjeet,

    I set it up and tested. Works great still.

    This is how it is called:
    Code:
    http://[wowza-address]:1935/disconnect?id=32442805&app=vod
    You can get a clientid from serverinfo:
    Code:
    http://[wowza-address]:8086/serverinfo
    Richard

  7. #7
    Join Date
    Dec 2007
    Posts
    25,641

    Default

    I think the problem was the HTTP url above. I had omitted the "&app=[app-name]" part.

    Richard

  8. #8

    Default

    Hi,
    Thanks Richard. Yes, that was the problem.
    Another issue, in case someone else refers to this post, is the VHost.xml entry should read as:

    <HTTPProvider>
    <BaseClass>com.wowza.wms.plugin.http.HTTPDisconnectClient</BaseClass>
    <RequestFilters>*disconnect</RequestFilters>
    <AuthenticationMethod>none</AuthenticationMethod>
    </HTTPProvider>

    There is an additional "package" word prepended (copy/pasted?) in your reply above.
    Now the only glitch is when this module is active, opening http://[wowza-ip]:1935 also shows the error response from the module instead of the default Wowza message.

    Thanks for your help!

    Regds
    Inderjeet

  9. #9
    Join Date
    Dec 2007
    Posts
    25,641

    Default

    Always put your HTTPProvider 2nd to last, above the one with RequestFilter "*"

    Richard

Tags for this Thread

Posting Permissions

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