Galène videoconferencing server discussion list archives
 help / color / mirror / Atom feed
* [Galene] Re: Need explanation on protocol
       [not found] <172167026848.994.7816686770190093792@gauss.local>
@ 2024-07-22 17:52 ` Juliusz Chroboczek
  2024-07-22 18:02   ` Goffi
       [not found]   ` <172167246572.994.11732831478625410475@gauss.local>
  0 siblings, 2 replies; 5+ messages in thread
From: Juliusz Chroboczek @ 2024-07-22 17:52 UTC (permalink / raw)
  To: Goffi; +Cc: galene

> Later on, when Louise is connecting to "test", Galène push this offer to me:

[...]n

> But as you can see, the ID is the same, `06cf28c8-95b5-4c22-9444-1f0d4e5a2938`.

The ID is chosen by the sending client, and should be chosen so as to not
collide.  The simplest solution is to choose it randomly:

  https://github.com/jech/galene/blob/master/static/protocol.js#L45

How are you generating your ids?

(There is code in the server that is meant to protect against duplicate
IDs, but it's never been tested, and I suspect it's not working.  I'll
have a look.)

-- Juliusz



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Galene] Re: Need explanation on protocol
  2024-07-22 17:52 ` [Galene] Re: Need explanation on protocol Juliusz Chroboczek
@ 2024-07-22 18:02   ` Goffi
       [not found]   ` <172167246572.994.11732831478625410475@gauss.local>
  1 sibling, 0 replies; 5+ messages in thread
From: Goffi @ 2024-07-22 18:02 UTC (permalink / raw)
  To: galene

[-- Attachment #1: Type: text/plain, Size: 1018 bytes --]

Hi Juliusz,

thanks for your quick answer.

> [SNIP]
> > But as you can see, the ID is the same, `06cf28c8-95b5-4c22-9444-1f0d4e5a2938`.
> 
> The ID is chosen by the sending client, and should be chosen so as to not
> collide.  The simplest solution is to choose it randomly:
> 
>   https://github.com/jech/galene/blob/master/static/protocol.js#L45
> 
> How are you generating your ids?

I'm choosing it randomly, but the only time I'm sending an ID is when I'm sending my initial offer to Galène, and later on when Louise connects, it re-use the same ID.
My code is available there:
https://repos.goffi.org/libervia-backend/file/tip/libervia/backend/plugins/plugin_comp_conferences/__init__.py#l130
The `session["id"]` used there is generated randomly with `str(uuid.uuid4())`
(https://repos.goffi.org/libervia-backend/file/tip/libervia/backend/plugins/plugin_xep_0166/__init__.py#l572)

How can I specify the ID to use for downstream, i.e. the offers that Galène pushes to me?

Thanks,
Goffi

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Galene] Re: Need explanation on protocol
       [not found]   ` <172167246572.994.11732831478625410475@gauss.local>
@ 2024-07-22 18:26     ` Juliusz Chroboczek
  2024-07-22 20:44       ` Goffi
       [not found]       ` <172168132829.994.3096417796511056404@gauss.local>
  0 siblings, 2 replies; 5+ messages in thread
From: Juliusz Chroboczek @ 2024-07-22 18:26 UTC (permalink / raw)
  To: Goffi; +Cc: galene

> https://repos.goffi.org/libervia-backend/file/tip/libervia/backend/plugins/plugin_comp_conferences/__init__.py#l130

Ah, I think I see the problem.

There's the client id, and there's the stream id.  You're reusing the
client id as the stream id, and that's not correct: if a client publishes
multiple streams, they must choose different ids.

So you should be doing something like:

   def send_offer(self, session: dict, sdp: str) -> None:
       ...
                "id": str(uuid()),
       ...

instead of self["id"].

-- Juliusz



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Galene] Re: Need explanation on protocol
  2024-07-22 18:26     ` Juliusz Chroboczek
@ 2024-07-22 20:44       ` Goffi
       [not found]       ` <172168132829.994.3096417796511056404@gauss.local>
  1 sibling, 0 replies; 5+ messages in thread
From: Goffi @ 2024-07-22 20:44 UTC (permalink / raw)
  To: galene

[-- Attachment #1: Type: text/plain, Size: 1368 bytes --]

Le lundi 22 juillet 2024, 20:26:58 UTC+2 Juliusz Chroboczek a écrit :
> > https://repos.goffi.org/libervia-backend/file/tip/libervia/backend/plugins/
plugin_comp_conferences/__init__.py#l130
> 
> Ah, I think I see the problem.
> 
> There's the client id, and there's the stream id.  You're reusing the
> client id as the stream id, and that's not correct: if a client publishes
> multiple streams, they must choose different ids.
> 
> So you should be doing something like:
> 
>    def send_offer(self, session: dict, sdp: str) -> None:
>        ...
>                 "id": str(uuid()),
>        ...
> 
> instead of self["id"].
> 
> -- Juliusz
> 
> 
> _______________________________________________
> Galene mailing list -- galene@lists.galene.org
> To unsubscribe send an email to galene-leave@lists.galene.org
> 

Alright,

I think that I've got it.

I was somehow thinking that Galène created a whole new ID when forwarding a 
stream, so when I received the identical ID as my offer, I thought it was 
Louise's stream sent to me. But actually, it was my stream sent to Louise 
using the other client (both are handled by the same instance, hence my 
confusion).

By logging the client ID, I see now what is happening, and I should be able to 
fix my code.

Thanks a lot for your help and work on Galène!

Best,
Goffi

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Galene] Re: Need explanation on protocol
       [not found]       ` <172168132829.994.3096417796511056404@gauss.local>
@ 2024-07-22 20:50         ` Juliusz Chroboczek
  0 siblings, 0 replies; 5+ messages in thread
From: Juliusz Chroboczek @ 2024-07-22 20:50 UTC (permalink / raw)
  To: Goffi; +Cc: galene

> I think that I've got it.
> 
> I was somehow thinking that Galène created a whole new ID when forwarding a 
> stream, so when I received the identical ID as my offer, I thought it was 
> Louise's stream sent to me. But actually, it was my stream sent to Louise 
> using the other client (both are handled by the same instance, hence my 
> confusion).

Ah, right.

Yes, stream ids are unique for every client.  Streams for different
clients may have the same id.

Galene currently simply reuses the streams id when it forwards the stream
to a different client, but that's by no means guaranteed by the protocol,
so don't count on it.

-- Juliusz

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-07-22 20:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <172167026848.994.7816686770190093792@gauss.local>
2024-07-22 17:52 ` [Galene] Re: Need explanation on protocol Juliusz Chroboczek
2024-07-22 18:02   ` Goffi
     [not found]   ` <172167246572.994.11732831478625410475@gauss.local>
2024-07-22 18:26     ` Juliusz Chroboczek
2024-07-22 20:44       ` Goffi
     [not found]       ` <172168132829.994.3096417796511056404@gauss.local>
2024-07-22 20:50         ` Juliusz Chroboczek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox