[jitsi-dev] One-to-one messaging within jitsi-meet


#1

Hi there,

I’ve been trying to get my head around how jitsi-meet works (architecturally and from an API perspective), and as I understand it, the text messages are sent via a MUC hosted by the XMPP server.

Does this mean that it is possible to get access to the XMPP client object to send messages to specific users? If so, are there any examples or pointers for doing so?

Additionally, I’d like to try setting up an additional data channel between specific users for arbitrary data streaming on a per-user basis, but the API only appears to allow for new channels to be opened to the room as a whole. Is there something I’m missing, or is data always related by the videobridge server and never by STUN/TURN?

Thanks,

Nick


#2

Hi there,

I've been trying to get my head around how jitsi-meet works (architecturally and from an API perspective), and as I understand it, the text messages are sent via a MUC hosted by the XMPP server.

Correct.

Does this mean that it is possible to get access to the XMPP client object to send messages to specific users? If so, are there any examples or pointers for doing so?

Do you mean from the JS side? Using our iframe API? Or a generic XMPP client?

Additionally, I'd like to try setting up an additional data channel between specific users for arbitrary data streaming on a per-user basis, but the API only appears to allow for new channels to be opened to the room as a whole. Is there something I'm missing, or is data always related by the videobridge server and never by STUN/TURN?

Currently there is no builtin mechanism for direct communication between peers.

Cheers,

···

On Aug 17, 2017, at 12:45, Nicholas Poole <nickpoole@black-sphere.co.uk> wrote:

--
Saúl


#3

Thanks Saúl,

Does this mean that it is possible to get access to the XMPP client object to send messages to specific users? If so, are there any examples or pointers for doing so?

Do you mean from the JS side? Using our iframe API? Or a generic XMPP client?

I was imagining that within the JS API, there'd be an XMPP client that's performing the MUC send/receive, and that such a client might be able to send/receive other arbitrary XMPP commands (like user-to-user messaging).
  

Additionally, I'd like to try setting up an additional data channel between specific users for arbitrary data streaming on a per-user basis, but the API only appears to allow for new channels to be opened to the room as a whole. Is there something I'm missing, or is data always related by the videobridge server and never by STUN/TURN?

Currently there is no builtin mechanism for direct communication between peers.

Is there a pattern for doing this outside of the builtin mechanisms? Or would I need to establish an entirely new WebRTC connection between the two clients somehow?

Thanks,

Nick


#4

Thanks Saúl,

Does this mean that it is possible to get access to the XMPP client object to send messages to specific users? If so, are there any examples or pointers for doing so?

Do you mean from the JS side? Using our iframe API? Or a generic XMPP client?

I was imagining that within the JS API, there'd be an XMPP client that's performing the MUC send/receive, and that such a client might be able to send/receive other arbitrary XMPP commands (like user-to-user messaging).

If you dig deep enough probably yes, I can’t point you to the exact point in the code though.

Additionally, I'd like to try setting up an additional data channel between specific users for arbitrary data streaming on a per-user basis, but the API only appears to allow for new channels to be opened to the room as a whole. Is there something I'm missing, or is data always related by the videobridge server and never by STUN/TURN?

Currently there is no builtin mechanism for direct communication between peers.

Is there a pattern for doing this outside of the builtin mechanisms? Or would I need to establish an entirely new WebRTC connection between the two clients somehow?

You’d need to have a separate peer connection.

What are you trying to accomplish? Maybe there is a simpler way to do it :slight_smile:

Cheers,

···

On Aug 17, 2017, at 19:08, Nick Poole <nickpoole@black-sphere.co.uk> wrote:

--
Saúl


#5

Hi Nick,

Thanks Saúl,

Does this mean that it is possible to get access to the XMPP
client object to send messages to specific users? If so, are
there any examples or pointers for doing so?

Do you mean from the JS side? Using our iframe API? Or a generic
XMPP client?

I was imagining that within the JS API, there'd be an XMPP client
that's performing the MUC send/receive, and that such a client might
be able to send/receive other arbitrary XMPP commands (like
user-to-user messaging).

We actually have two mechanisms that can be used for sending messages between endpoints. One is XMPP, where currently we only use the MUC. It should be possible to modify lib-jitsi-meet to support sending XMPP messages from one client to another (rather than to the whole MUC).

The other way is to use the data channel to the bridge (which itself runs either on top of sctp or web sockets). It already supports sending messages to a specific endpoint only, see the API here[0]. It also already supports sending JSON natively, e.g. on the receiving side you should see an event like this[1] with the payload already parsed.

With both approaches the contents of the message will be readable by the server (prosody in the first case, jitsi-videobridge in the second).

>>> Additionally, I'd like to try setting up an additional data
>>> channel between specific users for arbitrary data streaming on a
>>> per-user basis, but the API only appears to allow for new
>>> channels to be opened to the room as a whole. Is there something
>>> I'm missing, or is data always related by the videobridge server
>>> and never by STUN/TURN?

It shouldn't be too hard to extend the p2p code to have a data channel (or does it already do this?) if you only care about the case of 2 participants. For 3 and more we don't have any direct channels, and adding them would be non-trivial.

Regards,
Boris

[0] https://github.com/jitsi/lib-jitsi-meet/blob/master/JitsiConference.js#L1968
[1] https://github.com/jitsi/lib-jitsi-meet/blob/master/JitsiConferenceEventManager.js#L453

···

On 17/08/2017 12:08, Nick Poole wrote: