Expand my Community achievements bar.

mangement of server2server hooks

Avatar

Level 3

Hi,

I'm using server2server with php.

It's not clear to me when hooks are being destroyed.

Are all hooks being removed when calling $lccs->unregisterHook(); ?

Is calling $lccs->registerHook($hookURL, $token) automatically unregister the previous hook?

I'm creating a hook using $lccs->subscribeCollection($roomName, $collection)

Is this hook automatically removed when the room is destroyed?

Is there a way to get a list of all registered hooks?

If I'm trying to subscribe twice to the same collection, does the new hook override the old one?

Is it possible to subscribe to a collection and to a specific node in the collection at the same time?

Is it possible to subscribe to the UserModel collection once for all rooms or do I have to subscribe for every room separately?

Is there a list of the default collections created in with the default room template?

Thanks

6 Replies

Avatar

Employee

There is only one hook for your account (i.e. you need to provide only one endpoint URL for all your rooms).

registerHook override the previous hook or token, unregisterHook removes it.

If you need to manage different rooms in a different ways you’ll have to implement some sort of dispatcher on your end (i.e. once you know the room you can forward the request to different “hook managers”).

subscribeCollection tells a specific room to generate events for the collection you are subscribing to, so you can monitor only some rooms or all of them or different rooms in different ways (but again, all requests for one account will go to the same endpoint).

We currently don’t provide a way to subscribe to only one node in a collection (the API allows it, but the server ignores the node parameter).

We currently don’t provide a way to list all collections you subscribed to.

You can see the list of default collections by using the RoomConsole in the LCCS SDK Explorer app. Create a room using the default template and then connect to it with the RoomConsole.

Avatar

Level 3

Thank you for your answer.

I guess I asked too many questions at once

Can you also answer the following:

I'm creating a hook using $lccs->subscribeCollection($roomName, $collection)

Is this listener  automatically removed when the room is destroyed?

If I'm trying to subscribe twice to the same collection in the same rame, does the new listener overrides the old one?

Is it possible to subscribe to the UserModel collection once for all rooms (even rooms that will be created in the future) or do I have to subscribe for each room separately?

Avatar

Employee

1) when a room is destroyed all data for that room is removed.

2) there are really no "listeners" involved. When you subscribe you tell the server to send you notifications. If you subscribe again the operation is in practice ignored (the server already knows).

3) If you create a room, subscribe to all the appropriate collections and then create a template out of that room, when you use that template to create new rooms they will automatically inherit the subscription requests.

Avatar

Level 2

I'm having similar issues to Pablo.  Specifically, I'm wondering if the converse of:

is also true.  If we create a room from a template without subscribes, will we never receive LCCS Hook requests for that room even if we subscribe to a collection in that room later?  Right now in our testing this seems to be the case.

How can we test to make sure a collection is subscribed to using the RTC API?  How to add subscriptions into an already created room template?

Avatar

Employee

The problem has been solved. Sorry it tooks longer than expected but we wanted to fix the root cause instead of spending the day restarting servers (and of course got caught into a bunch of unrelated problems)