Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[listenonly] Rewrite SFU/Kurento listen only bridge #10945

Merged
merged 9 commits into from Dec 9, 2020

Conversation

prlanzarin
Copy link
Member

What does this PR do?

This is a mild rewrite of SFU/Kurento's listen only audio bridge. In detail:

  • Remove all dependencies the bridge had to the legacy kurento-extension script
    • Rationale: that thing was old. Came from the Flash client. Error prone and hard to read
    • I won't remove that script just yet. It's still used by screen share. I'll do the same to screen share and then remove it from the code base altogether.
  • Fix listen only re-connection in Chromium-based browsers >= M78.
  • Add a new base class that implements the signalling base to all bbb-webrtc-sfu components;
  • Add a new signalling broker class for the listen only SFU bridge (deprecates the listen only related kurento-extension code);
  • Add a new stream state service to allow monitoring SFU module's stream state changes from various modules. Transparent to listen only changes, but will be "visible" in subsequent PRs that tackle video/screen sharing re-connection issues;
  • Add an util to load streams into and play media elements in SFU-based media modules
    • Rationale: video, screen share and listen only all implement basically that same thing in slightly different ways. I'm centralizing it. I'll re-use that component in screen share/video in subsequent PRs;
  • Improve error handling in the SFU listen only bridge
    • Error handling there was basically botched. No proper normalization was present, which ended up generating generic errors all around, making it difficult to discern error causes on log processing and analysis. Full error list in appendix 1.
  • Annotate every error log in audio-manager with a bridge identifier (sip|kurento). Helps us separate errors on log analysis.

Closes Issue(s)

None.

Motivation

Outlined above.

More

Appendix 1: SFU listen only bridge errors and logCode to catch them

Errors will be funneled through logCode: "audio_failure" with extraInfo fields of interest errorCode, cause and bridge

  Format is <errorCode>: <cause>

  1xxx: client-side errors
  ===
  1001: "WEBSOCKET_DISCONNECTED",
  1002: "WEBSOCKET_CONNECTION_FAILED",
  1005: "PEER_NEGOTIATION_FAILED",
  1007: "ICE_STATE_FAILED",

  2xxx codes are server-side bbb-webrtc-sfu errors
  ===
  2000: "MEDIA_SERVER_CONNECTION_ERROR",
  2001: "MEDIA_SERVER_OFFLINE",
  2002: "MEDIA_SERVER_NO_RESOURCES",
  2003: "MEDIA_SERVER_REQUEST_TIMEOUT",
  2004: "MEDIA_SERVER_GENERIC_ERROR",
  2020: "ICE_ADD_CANDIDATE_FAILED",
  2021: "ICE_GATHERING_FAILED",
  2022: "ICE_STATE_FAILED",
  2200: "MEDIA_GENERIC_ERROR",
  2201: "MEDIA_NOT_FOUND",
  2202: "MEDIA_INVALID_SDP",
  2203: "MEDIA_NO_AVAILABLE_CODEC",
  2208: "MEDIA_GENERIC_PROCESS_ERROR",
  2209: "MEDIA_ADAPTER_OBJECT_NOT_FOUND",
  2210: "MEDIA_CONNECT_ERROR",
  2211: "MEDIA_NOT_FLOWING",
  2300: "SFU_INVALID_REQUEST",

…roker

Extracts most of the common bbb-webrtc-sfu WebSocket setup, handshaking and message broker procedures that was scattered among HTML5 components (video, screenshare and listen only) into a base class suitable for inheritance
Moved bbb-webrtc-sfu utilitaries to properly named folder

Logging improvements to base broker

Added onerror/onstart/onended callback interfaces to base broker
A replacement to the old kurento-extension script which is to be considered legacy code
…t with proper error handling

To be used with bbb-webrtc-sfu based media brokers
Fixed listen only reconnection handling

Added proper error handling; now all errors have proper mapped codes which are funneled through to audio-manager logger and should be easier to gauge types of errors

Fixed botched reconnection error rejection, audio modal shouldnt be stuck anymore when it fails

Remove every tie that listen only bridge had to kurento-extension
…e identifier

Useful when parsing logs to split errors by bridge type
@prlanzarin prlanzarin marked this pull request as draft December 1, 2020 18:59
@prlanzarin prlanzarin marked this pull request as ready for review December 7, 2020 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants