Jicofo (Jitsi COnference FOcus)

repository·master·Indexed 43 days ago

https://github.com/jitsi/jicofo

A signaling server and core backend component of the Jitsi Meet stack that acts as the conference focus. It manages Jingle sessions, selects Jitsi Videobridge instances via the COLIBRI protocol, and handles conference management through XMPP Multi-User Chat (MUC) rooms. Jicofo manages signaling but does not process media. It includes a REST API for health checks and a conference-request API for client synchronization and redirection.

Tokens
10.2K
Snippets
30
Records
43
Agent score
56%

What's inside Jicofo

  1. What is Jicofo and how does it work?

    master

    Jicofo (Jitsi COnference FOcus) is a signaling server and a core backend component of the Jitsi Meet stack.

    Its primary responsibilities include:

    • Conference Management: It joins the XMPP Multi-User Chat (MUC) room (provided by Prosody) that represents a Jitsi Meet conference.
    • Session Initiation: It acts as the "focus" of the conference by initiating Jingle sessions with each participant.
    • Videobridge Selection: It selects a Jitsi Videobridge instance for each participant and manages the set of videobridges using the COLIBRI protocol (specifically colibri version 2).

    Key distinction: Jicofo manages and terminates Jingle sessions but does not process media (audio/video) itself. It delegates media handling to Jitsi Videobridge instances.

  2. Understand the Conference-request exchange

    master

    A conference-request is an initial exchange between a client and Jicofo that occurs before the client joins the conference Multi-User Chat (MUC).

    Its primary purposes are:

    1. MUC Notification: Notifies Jicofo that it should join a specific MUC.
    2. Synchronization: Allows the client to block until Jicofo has successfully created or joined the MUC (essential if the client lacks MUC creation permissions).
    3. Configuration: Enables the first client in a conference to specify conference-wide options to Jicofo.
    4. Redirection: Allows Jicofo to redirect the client to a specific visitor node.
    5. Authentication: Facilitates external authentication with an XMPP domain or Shibboleth.
  3. Configure Prosody for Jicofo manual setup

    master

    In a manual setup, Jicofo requires privileges to create Multi-User Chat (MUC) rooms. This is achieved by creating a dedicated virtual host and adding a Jicofo account to the global admins list in Prosody.

    1. Add the following to your Prosody configuration file (usually /etc/prosody/prosody.cfg.lua):
    admins = { focus@auth.jitsi.example.com }
    VirtualHost "auth.jitsi.example.com"
        authentication = "internal_hashed"
    1. Restart Prosody:
    sudo prosodyctl restart
    1. Register the Jicofo user account:
    sudo prosodyctl register focus auth.jitsi.example.com focuspassword

    Note: Replace auth.jitsi.example.com and focuspassword with your actual domain and desired password.

    admins = { focus@auth.jitsi.example.com }
    VirtualHost "auth.jitsi.example.com"
        authentication = "internal_hashed"
    sudo prosodyctl restart
    sudo prosodyctl register focus auth.jitsi.example.com focuspassword
  4. Build and run Jicofo manually

    master

    To build Jicofo from source, use Maven. To run it, use the provided shell script from the distribution package.

    Build:

    mvn install

    This creates a package at jicofo/target/jicofo-1.1-SNAPSHOT-archive.zip.

    Run: Extract the resulting .zip package and execute jicofo.sh.

  5. Use Shibboleth authentication via Jitsi-SAML2JWT

    master

    Shibboleth authentication is no longer supported natively in Jicofo. To implement Shibboleth authentication, you must use the external project Jitsi-SAML2JWT instead.

    https://github.com/Renater/Jitsi-SAML2JWT
  6. Calculate bridge stress level via correctedStress

    master

    The correctedStress property provides a normalized value (typically 0.0 to 1.0, but can exceed 1.0) representing the load on a bridge. This value is used by Jicofo to rank bridges for conference allocation.

    It is calculated by combining:

    1. The lastReportedStressLevel provided by the bridge.
    2. The impact of recentlyAddedEndpointCount multiplied by the averageParticipantStress.
    3. If failingIce is detected, the stress is boosted to at least config.stressThreshold + 0.01 to ensure the bridge is deprioritized.

    If correctedStress is greater than or equal to config.stressThreshold, the bridge is considered isOverloaded.

  7. Handle signals for clean shutdown in Jicofo

    master

    Jicofo is designed to handle specific OS signals to trigger a clean shutdown of its services and task pools. The following signals are registered:

    • TERM (Termination signal)
    • HUP (Hangup signal)
    • INT (Interrupt signal)

    When one of these signals is caught, Jicofo will attempt to shut down JicofoServices and TaskPools gracefully. The application will exit with a status code derived from the signal number (signal number + 128).

  8. Configure Jicofo using HOCON

    master

    Jicofo uses the HOCON (Human-Optimized Config Object Notation) format for its configuration. The configuration file is typically located at /etc/jicofo/jicofo.conf.

    For a complete list of available configuration options, refer to the reference.conf file in the repository.

  9. Run Jicofo with a configuration file

    master

    Jicofo requires a configuration file to be specified via the config.file system property at startup. If this property is missing, the application will log a warning and exit. Use the -Dconfig.file= flag when invoking the Java application.

    Note that Jicofo also uses specific patterns to mask sensitive information in logs. The following system properties are used by ConfigUtils to identify passwords that should not be printed:

    • pass (for system properties)
    • user_password (for command line arguments)
    java -Dconfig.file=/path/to/your/config.file -jar jicofo.jar
  10. Prerequisites for a WebRTC videoconferencing solution

    master
    To implement a complete WebRTC videoconferencing solution, installing Jicofo alone is insufficient. You must also install the jitsi-meet and jitsi-videobridge packages. These components work together, with Jitsi Videobridge acting as the Selective Forwarding Unit (SFU).