How to make getServerStats() API call?
How to make getServerStats() API call?
How to make getServerStats() API call?
Hi,
Here you go..
1. To make rtmp call use the code
var admin_nc = new NetConnection();
var callResponder = new Responder(result_callResponder, status_callResponder);
admin_nc.addEventListener(NetStatusEvent.NET_STATUS, nc_status);
admin_nc.connect("rtmp://10.192.22.92:1111/admin", "admin", "admin");
function nc_status(event:NetStatusEvent):void{
trace("nc status " + event.info.code);
if(event.info.code=="NetConnection.Connect.Success"){
admin_nc.call("getServerStats", callResponder);
}
}
function result_callResponder(info:Object):void{
trace("result_callResponder");
for(var prop in info.data){
trace("property:" + prop + " - " + info.data[prop]);
}
}
function status_callResponder(eve:Event):void{
trace("status_callResponder");
}
2. To make http call - enter "http://10.192.22.92:1111/admin/getServerStats?
auser=admin&apswd=admin" in your browser and hit enter. Before that make sure you
have enabled this command in your users.xml file. To do so, open <installed fms
dir>/conf/users.xml. Edit the tag "Root > AdminServer > HTTPCommands > Allow" and
enter the value "All" for it. Save and restart the server, then try the http
command.
Regards,
Janaki L
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.