meetecho / janus-gateway

Janus WebRTC Server
https://janus.conf.meetecho.com
GNU General Public License v3.0
8.2k stars 2.47k forks source link

Exposing session-related data from plugin to the external world through transport #649

Closed manifest closed 8 years ago

manifest commented 8 years ago

It would be nice to implement some kind of resource discovery for plugins. In other words:

We could have used session_created transport's callback, but there is a problem, we couldn't provide any additional information within it (like description of resource) as for now.

The Last Will and Testament (LWT) feature is used in MQTT to notify other clients about an ungracefully disconnected client. Each client can specify its last will message (a normal MQTT message with topic, retained flag, QoS and payload) when connecting to a broker. The broker will store the message until it detects that the client has disconnected ungracefully. If the client disconnect abruptly, the broker sends the message to all subscribed clients on the topic, which was specified in the last will message. The stored LWT message will be discarded if a client disconnects gracefully. LWT helps to implement strategies when the connection of a client drops or at least to inform other clients about the offline status. http://www.hivemq.com/blog/mqtt-essentials-part-9-last-will-and-testament

From the MQTT transport's point of view, it could work (in general) this way:

Question. Is there any way to publish a message to the different topic (in case of MQTT it would be LWT topic instead of topic associated with Janus API)? Or any way to solve the issue described above?

lminiero commented 8 years ago

Not sure what you're asking, actually. Do you mean something like the mechanism we're implementing in #536? If not, can you clarify?

manifest commented 8 years ago

@lminiero thanks for pointing me out. Event handler plugins look like a good solution for the issue.