Skip to content

Conversation

@danxuliu
Copy link
Member

@danxuliu danxuliu commented May 6, 2021

Requires #5491 and #5503

This is a breaking change for Talk 12. The settings endpoint version was initially just bumped, but then the old API versions were dropped.

The format resembles the RTCIceServer format, so the returned values can be directly used by the WebUI like done until now. Mobile clients will need to be adjusted, though.

Important: The RTCIceServer MDN page states that Avoid specifying an unnecessarily large number of URLs in the urls property; the startup time for your connection will go up substantially. Every server in the list will be contacted and tried out before one is selected to be used for negotiation. It should be verified whether that applies too when using trickle ICE or not; if it does then it might be needed to rethink the format before merging this.

  • Update: I have not been able to reproduce the described behaviour (although I have not done any fancy test like delaying packets for a specific server or something like that; I just used real servers, real servers unreachable by a specific protocol and wrong addresses). Even with several servers the connection could be established before the gathering of candidates finished.

    Internally both Firefox and Chromium just iterate through all the urls and add a separate server for each of them; in practice it seems that it does not make any difference to provide four server elements each with a single url or a single server element with four urls.

    So I guess that the statement above refers only to systems where trickle ICE is not being used 🤷

Before

stunservers: [
  [
    url: "stunServer1"
  ],
  [
    url: "stunServer2"
  ],
  [
    url: "stunServer3"
  ]
],
turnservers: [
  [
    url: [ "turnServer1-1" ],
    urls: [ "turnServer1-1" ],
    username: "user1"
    credentials: "credentials1"
  ],
  [
    url: [ "turnServer1-2" ],
    urls: [ "turnServer1-2" ],
    username: "user1"
    credentials: "credentials1"
  ],
  [
    url: [ "turnServer2" ],
    urls: [ "turnServer2" ],
    username: "user2"
    credentials: "credentials2"
  ],
]

After

stunservers: [
  [
    urls: [ "stunServer1", "stunServer2", "stunServer3" ]
  ],
],
turnservers: [
  [
    urls: [ "turnServer1-1", "turnServer1-2" ],
    username: "user1"
    credentials: "credentials1"
  ],
  [
    urls: [ "turnServer2" ],
    username: "user2"
    credentials: "credentials2"
  ],
]

@danxuliu danxuliu added 2. developing feature: WebRTC 🚡 WebRTC connection between browsers and/or mobile clients feature: settings ⚙️ Settings and config related issues feature: api 🛠️ OCS API for conversations, chats and participants client: 🤖🍏 mobile labels May 6, 2021
@danxuliu danxuliu added this to the 💖 Next Major (22) milestone May 6, 2021
@danxuliu danxuliu force-pushed the unify-stun-and-turn-server-urls branch from 3ab98a8 to 5ce7aa7 Compare May 11, 2021 23:05
@danxuliu danxuliu marked this pull request as ready for review May 11, 2021 23:07
@danxuliu
Copy link
Member Author

Rebased on master and bumped API version instead of modifying the previous one.

Tested with Firefox and Chromium; it should work with Safari too... but tests are welcome ;-)

@Ivansss
Copy link
Member

Ivansss commented May 14, 2021

Could we add the capability "signaling-v3" here? :)

@nickvergessen
Copy link
Member

Yes we should add that capability and at the same time (as said in the other PR) we can drop v1+v2 at the same time as all clients for nextcloud22 need to be updated for conversation-v4 already and there is no fallback possible.

@danxuliu
Copy link
Member Author

But if v1+v2 are dropped (I guess by replacing v(1|2|3) with v3 in routes.php) then there is no need to have different arrays, or there is? 🤔

@nickvergessen
Copy link
Member

Exactly that was the plan? Make everything simple as you don't need to support the other things.

@danxuliu
Copy link
Member Author

But then what did you mean by create different arrays based on the already available $apiVersion??

@nickvergessen
Copy link
Member

Hmm maybe too many context switches 🤔

@danxuliu
Copy link
Member Author

Hmm maybe too many context switches 🤔

Try setting event loops :-P

Capability added and previous endpoint versions dropped.

Copy link
Member

@nickvergessen nickvergessen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please update all signaling urls to v3

Copy link
Member

@nickvergessen nickvergessen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed with a fixup commit

The "stunservers" parameter was a list of several elements each one with
a "url" parameter, which was a string. Now the "stunservers" parameter
is a list of several elements (although in practice there will be just
one) each one with a "urls" parameter, which is a list of strings.

The "turnservers" parameter was a list of several elements each one with
a "url" parameter and a "urls" parameter, which were both a list of a
single string. Now the "turnservers" parameter is a list of several
elements each one with a "urls" parameter, which is a list of strings.
Each element of "turnservers" contain too "username" and "credential"
parameters that apply to all the elements in the "urls" parameter.

The format resembles the RTCIceServer format, so the returned values can
be directly used by the WebUI like done until now. Mobile clients will
need to be adjusted, though.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
@nickvergessen nickvergessen force-pushed the unify-stun-and-turn-server-urls branch from 6141334 to 69c7a1d Compare May 19, 2021 13:27
@nickvergessen
Copy link
Member

Rebased after #5465 and did the fixups

danxuliu added 2 commits May 19, 2021 17:56
The only change between V2 and V3 is the "stunservers" and "turnservers"
format, but both the old one and the new one are compatible with the
RTCIceServer dictionary and no changes are needed.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
The mobile apps will need to adjust to the new version (note that only
the signaling settings endpoint actually changed), but they will not be
compatible with Talk < 12 anyway due to the changes in the conversation
endpoints.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
@danxuliu danxuliu force-pushed the unify-stun-and-turn-server-urls branch from 69c7a1d to 45c4226 Compare May 19, 2021 16:31
@danxuliu
Copy link
Member Author

danxuliu commented May 19, 2021

Fixed a bug with the stunservers array (it was an object rather than an array, I had fixed it already but it seems that I failed to push 🤦), moved dropping all the endpoints to the third commit rather than the second one, and removed some unneeded code now that the previous versions are not supported.

Edit: oh, and tested and works 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4. to release client: 🤖🍏 mobile feature: api 🛠️ OCS API for conversations, chats and participants feature: settings ⚙️ Settings and config related issues feature: WebRTC 🚡 WebRTC connection between browsers and/or mobile clients

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants