• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Calling administration api method

New Here ,
Jun 11, 2009 Jun 11, 2009

Copy link to clipboard

Copied

iS IT POSSIBLE TO CALL ADMINISTRATION API METHODS SUCH AS GETSERVERSTATS() etc from server side code....

Views

715

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 11, 2009 Jun 11, 2009

Copy link to clipboard

Copied

Yes... it's possible.

You first need to make a netconnection to the admin service:

var nc = new NetConnection();

nc.onStatus = function(info){

// handle connection status

}

nc.connect("rtmp://myfmsserver.com:1111/admin", "admin username", "admin password");

Then make the calls just like any other netconnection.call

function onGetServerStats(results){

// handle results here

}

nc.call("getServerStats", onGetServerStats);

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 11, 2009 Jun 11, 2009

Copy link to clipboard

Copied

I'm still facing problem,,

i need to check the uptime and the number of users connected to the remote server..

this is my code

application.onConnect = function(client,name)

{

     nc_poll=new NetConnection();
     nc_poll.connect("rtmp://abcd.com:1111/admin","usrnmame","password");

function onGetServerStats(result)
{
   
           
    var dataobj=result.data;
    trace("on getserver");
    trace(dataobj.up_time);
    trace(result.level);
       
    }

nc_poll.call("getServerStats",new onGetServerStats);

}

// im getting the ongetserver log in the log but the other traced values..

its showing that

"result has no properties"

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 12, 2009 Jun 12, 2009

Copy link to clipboard

Copied

LATEST

Sorry... my brain must not have been working quite right yesterday. You need to define onResult and onStatus handlers in the result handler:

function onGetServerStats(){
this.onResult = function(info){
// handle result here
}
this.onStatus = function(info){
// handle errors here
}
}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines