Expand my Community achievements bar.

SOLVED

Method AccountManager.getRoomInfo throwing Exception

Avatar

Former Community Member

Hello,

I'm trying to use the method getRoomInfo from AccountManager class of the Java server API, in order to obtain the usage information of a room. My problem is that this method is always throwing the following Error: com.adobe.rtc.util.RTCError: not-active.

Here is my code:

accountManager.keepalive(LCCS_USER, LCCS_PASSWORD);

accountManager.getSession(lccsRoom.getRoomName());

   

RoomInfo roomInfo = accountManager.getRoomInfo(lccsRoom.getRoomName());

I'm sure that the Room exists, is active (I checked the Room console), users can enter, and lccsRoom.getRoomName() has the correct name.

My question is: am I missing something? Is there anything I'm doing wrong? Should I wait some time since the room is created until I can call the method getRoomInfo? Should the room have some usage before I can call the method?

Thank you very much for your help!

1 Accepted Solution

Avatar

Correct answer by
Level 4

Hi Oliver,

Can you confirm that the room name matches?  Does it have any upper-case letters in it?

Thanks,

Nikola

View solution in original post

7 Replies

Avatar

Employee

getRoomInfo only returns valid data (current usage information) when the room is running (active) otherwise you get the "not-active" error.

You can try to make the room "run" for the time required to call getRoomInfo by, for example, publishing an item to the room via the server API.

Note that in any case you don't need to call getSession() for server calls. The "getSession" method returns an authentication session that can be used to generate authentication tokens for clients. For server calls none of this is required (since you are logging in as the account owner)

Avatar

Correct answer by
Level 4

Hi Oliver,

Can you confirm that the room name matches?  Does it have any upper-case letters in it?

Thanks,

Nikola

Avatar

Former Community Member

Hello, thank you for your answers!

Yes, I'm sure that the roomName is the correct one. I checked it multiple times. Furthermore, when I call the method accountManager.getSession with that room name, the call is successful and I get a valid session.

I tried to publish items, before calling getRoomInfo. I can publish items with success, but getRoomInfo keeps throwing the "non-active" error. I don't know what else can I do. I really need the usage information of the rooms, since is what my client will use to monetize the application.

Any suggestions?

Avatar

Employee

Again, getRoomInfo only returns valid data when the room is running. Did you try with a running room and verified that you get the data you need ?

If that is the case you have a couple of options:

- if you have a limited number of rooms you could either access the room via DevConsole (that will start the room) or write a Flex/AIR application that starts the room and then calls a method on your server that will cause getRoomInfo to be called.

- implement server side notification (with the server to server API) and intercept the room termination message in RoomManager. When you get the room termination message the room will still be active (but with no users) and you should be able to call getRoomInfo to get the current usage. Then you should store these values in a database that you can query to generate billing information

Avatar

Former Community Member

I finally found the error. It was my mistake.

The room name was, indeed, wrong. I was calling the method getRoomInfo with a room name that contained a capital letter. LCCS server saves the names all in lower case.

I didn't notice the mistake before because the method getSession was working, even when I used the roomName with a capital letter, but the method getRoomInfo fails.

I'm sorry for making lose your time guys, because it was all my mistake. I didn't want to have room names with capital letters, it was just a typo.

Anyway, thank you very much for your help and quick answers!

Avatar

Level 4

Great news Oliver,

I am glad you can now move forward.  One could argue that the upper-case letters should not matter, but as you said, it is better to play it safe with all lower-cased room name.

Thanks again for using LCCS!

Nikola

Avatar

Former Community Member

Hey, we're just happy that you were successful, and the world makes sense

to us again =).

nigel