Hi,
Here is a simple PHP code to retrieve number of listeners on your stream or connected user.
[PHP]
<?php $xml_data=file_get_contents("http://YOURSERVERIP:8086/connectioncounts"); $doc = new DOMDocument(); $doc->loadXML($xml_data); $wms = $doc->getElementsByTagName('WowzaMediaServer'); $currentlistener = $wms->item(0)->getElementsByTagName("ConnectionsCurrent")->item(0)->nodeValue; $listenerhits = $wms->item(0)->getElementsByTagName("ConnectionsTotal")->item(0)->nodeValue; echo "Current listener: $currentlistenerTotal hits: $listenerhits"; ?>
[/PHP]
To use the code above you need to disable the digest authentication on the wowza vhost server, to do this just edit the Vhost.xml at conf folder and set the AuthenticationMethod to none, save and restart your wowza server
[HTML]
com.wowza.wms.http.HTTPConnectionCountsXML
connectioncounts*
none
[/HTML]