AGProjects / sylk-webrtc

Sylk WebRTC client
http://sylkserver.com
Other
59 stars 27 forks source link

Minimal configuration for WebRTC conference #57

Closed serpent213 closed 10 months ago

serpent213 commented 1 year ago

Is the mailing list down?

This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. The following address(es) failed:

sipbeyondvoip@lists.ag-projects.com host alt1.mail.sipthor.net [85.17.186.25] SMTP error from remote mail server after RCPT TO:[sipbeyondvoip@lists.ag-projects.com](mailto:sipbeyondvoip@lists.ag-projects.com): 550 5.1.1 [sipbeyondvoip@lists.ag-projects.com](mailto:sipbeyondvoip@lists.ag-projects.com): Recipient address rejected: User unknown in local recipient table Reporting-MTA: dns; mail.reactor.de

Action: failed Final-Recipient: rfc822;sipbeyondvoip@lists.ag-projects.com Status: 5.0.0 Remote-MTA: dns; alt1.mail.sipthor.net Diagnostic-Code: smtp; 550 5.1.1 [sipbeyondvoip@lists.ag-projects.com](mailto:sipbeyondvoip@lists.ag-projects.com): Recipient address rejected: User unknown in local recipient table

From: Steffen Beyer [steffen@beyer.io](mailto:steffen@beyer.io) Subject: Minimal configuration for WebRTC conference Date: 3. November 2023 at 22:26:43 CET To: sipbeyondvoip@lists.ag-projects.com

Hello,

I set up SylkServer and Janus under NixOS and would like to allow conferences via browser and Sylk app.

Is OpenSIPS a requirement for that? When accessing https://sylk.example/conference/demo1 no login is required and it says "Call with demo1 / Connecting…” but does not seem to enter “conference mode”.

Log says:

INFO     [webrtcgateway] [account [0fb65692adee44bd@guest.sylk.example](mailto:0fb65692adee44bd@guest.sylk.example)/TyyJcW9Of2TQjwDAq633SA] added using SylkRTC (Safari 16.6 on macOS 10.15.7) - SylkWeb 3.5.1             
INFO     [webrtcgateway] [videoroom [demo1@videoconference.sylk.example](mailto:demo1@videoconference.sylk.example)] created
INFO     [webrtcgateway] [account [0fb65692adee44bd@guest.sylk.example](mailto:0fb65692adee44bd@guest.sylk.example)/TyyJcW9Of2TQjwDAq633SA] created room [demo1@videoconference.sylk.example](mailto:demo1@videoconference.sylk.example)
INFO     [webrtcgateway] [account [0fb65692adee44bd@guest.sylk.example](mailto:0fb65692adee44bd@guest.sylk.example)/TyyJcW9Of2TQjwDAq633SA] publish audio only to room [demo1@videoconference.sylk.example](mailto:demo1@videoconference.sylk.example)
INFO     [webrtcgateway] [account [0fb65692adee44bd@guest.sylk.example](mailto:0fb65692adee44bd@guest.sylk.example)/TyyJcW9Of2TQjwDAq633SA] joined room [demo1@videoconference.sylk.example](mailto:demo1@videoconference.sylk.example) with audio only
INFO     [webrtcgateway] [videoroom [demo1@videoconference.sylk.example](mailto:demo1@videoconference.sylk.example)] [0fb65692adee44bd@guest.sylk.example](mailto:0fb65692adee44bd@guest.sylk.example) has joined
ERROR    [webrtcgateway] [videoroom [demo1@videoconference.sylk.example](mailto:demo1@videoconference.sylk.example)] DNS lookup for SIP proxy for sip:demo1@conference.sylk.example failed
ERROR    [webrtcgateway] [videoroom [demo1@videoconference.sylk.example](mailto:demo1@videoconference.sylk.example)] chat session for [0fb65692adee44bd@guest.sylk.example](mailto:0fb65692adee44bd@guest.sylk.example) failed: DNS lookup error
INFO     [webrtcgateway] [videoroom [demo1@videoconference.sylk.example](mailto:demo1@videoconference.sylk.example)] [0fb65692adee44bd@guest.sylk.example](mailto:0fb65692adee44bd@guest.sylk.example) has left
INFO     [webrtcgateway] [videoroom [demo1@videoconference.sylk.example](mailto:demo1@videoconference.sylk.example)] destroyed

I’m wondering where sip:demo1@conference.sylk.example stems from, couldn’t find it in the configuration… So far I only setup videoconference.sylk.example as CNAME. I don’t know much about SIP.

Is https://download.ag-projects.com/SylkServer/INSTALL still up-to-date? Which parts of it do I need?

Thank you!

Steffen

adigeo commented 1 year ago

The mailing list is being migrated to a new server, will be fixed soon and I will update this ticket when this is done.

Related to your question, you have to follow the INSTALL document, which is up to date, and all parts described in there are needed.

adigeo commented 1 year ago

For multi-party videoconference there is not need to install any SIP server.

adigeo commented 1 year ago

Internally, demo is a fully qualified SIP uri in the form of user@domain where the conference room is the username part and the domain is the default domain configured for webrtc gateway

adigeo commented 1 year ago

In the example above I use the latest code from GitHub repo on a Ubuntu machine.

adigeo commented 1 year ago

The only thing you need to setup is a valid TLS certificate, for example from let's encrypt. Then you set in config.ini the domain name as follows (.e.g. for domain.sylk.link)

[WebServer]

; Global web server settings

; IP address used for serving HTTP(S) requests, empty string
; means listen on interface used by the default route
; local_ip =

; Port where the web server will listen on, set to 0 for random
; local_port = 10888

; By default the server uses HTTP, if certificate is defined below, the
; server will use HTTPS

; X.509 server certificate for HTTPS connections, the certificate private
; key must be concatenated inside the same file 
certificate = /etc/sylkserver/tls/domain.sylk.link.crt
; certificate = /etc/sylkserver/tls/default.crt

; Certificat chain file containing all the certificates that the server
; should present to the client.  If specified, it must also contain the
; certificate in the file specified by the 'certificate' option.
;certificate_chain = /etc/sylkserver/tls/chain.crt

; Hostname used when publishing the server URL. Must match the common name
; of server X.509 certificate set above, otherwise clients will raise
; warning. If not set the listening IP address will be used
hostname = domain.sylk.link 
adigeo commented 1 year ago

domain.sylk.link.crt is a text file where you concatenate the certificate and the private key from let's encrypt.

serpent213 commented 1 year ago

Thank you, my main issue was the NAT setup for Janus, apparently. TLS is handled by nginx in a different container, setup like:

            "sylk.example" = {
              forceSSL = true;
              enableACME = true;

              locations."/" = { proxyPass = "http://10.1.1.2:3000/"; };

              locations."/ws" = {
                proxyPass = "http://10.1.1.2:10888/webrtcgateway/ws";
                proxyWebsockets = true;
              };
            };

...which seems to work as expected.

Now the client connects but fails just afterwards when initialising the React Conference view:

sylkrtc:Conference Conference event: 
Object { sylkrtc: "videoroom-event", session: "05dca5af-7933-4186-b097-e3ebfcb2f24f", event: "session-state", state: "established" }
 +485ms [common.js:113:9](https://sylk.example/node_modules/sylkrtc/node_modules/debug/src/common.js)
blinkrtc:App Call state changed! accepted -> established +522ms [common.js:113:9](https://sylk.example/node_modules/debug/src/common.js)
blinkrtc:Conference Conference state changed accepted -> established +521ms [common.js:113:9](https://sylk.example/node_modules/debug/src/common.js)
Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object.

Check the render method of `ConferenceBox`.
    in ConferenceBox (created by WithStyles(ConferenceBox))
    in WithStyles(ConferenceBox) (created by Conference)
    in div (created by Conference)
    in Conference (created by ConferenceByUriBox)
    in div (created by ConferenceByUriBox)
    in div (created by ConferenceByUriBox)
    in ConferenceByUriBox (created by WithStyles(ConferenceByUriBox))
    in WithStyles(ConferenceByUriBox) (created by bound conferenceByUri)
    in bound conferenceByUri (created by Locations)
    in div (created by Locations)
    in Locations (created by Blink)
    in div (created by Blink)
    in Blink [demo:12966:25](https://sylk.example/conference/demo)
    overrideMethod demo:12966
    React 3
        printWarning
        error
        createElementWithValidation
    render ConferenceBox.js:1510
    React 8
        finishClassComponent
        updateClassComponent
        beginWork
        beginWork$1
        performUnitOfWork
        workLoopSync
        performSyncWorkOnRoot
        flushSyncCallbackQueueImpl
    unstable_runWithPriority scheduler.development.js:653

...while ConferenceBox.js:1510 points to:

                    <TransitionGroup>
                        {watermark}
                    </TransitionGroup>

(Not sure that's the right track – I'm not used to React debugging.)

My src/app/config.js looks like:

'use strict';

const defaultDomain = 'sylk.example';

const configOptions = {
    defaultDomain           : defaultDomain,
    enrollmentDomain        : defaultDomain,
    nonSipDomains           : [],           // Each domain configured here will be used for alternate authentication methods
    publicUrl               : `https://${defaultDomain}`,
    enrollmentUrl           : `https://${defaultDomain}`,
    // useServerCallHistory    : true,
    // serverCallHistoryUrl    : 'https://blink.sipthor.net/settings-webrtc.phtml',
    defaultConferenceDomain : `videoconference.${defaultDomain}`,
    defaultGuestDomain      : `guest.${defaultDomain}`,
    wsServer                : `wss://${defaultDomain}/ws`,
    fileSharingUrl          : `https://${defaultDomain}/filesharing`,
    fileTransferUrl         : `https://${defaultDomain}/filetransfer`,
    // iceServers              : [{urls: 'stun:stun.sipthor.net:3478'}],
    muteGuestAudioOnJoin    : true,
    guestUserPermissions    : {
        allowMuteAllParticipants     : false,
        allowToggleHandsParticipants : false
    },
    showGuestCompleteScreen : true,
    downloadUrl             : 'https://sylkserver.com'
};

module.exports = configOptions;

Any hunch what might be wrong...?

Is there any documentation around for the config.js settings? I'm still a bit puzzled, especially regarding the various *Url and *Domain options.

serpent213 commented 1 year ago

I was able to make it work by removing the lines:

                    <TransitionGroup>
                        {watermark}
                    </TransitionGroup>

But still get a very similar error:

Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object.

Check the render method of `ConferenceBox`.
    in ConferenceBox (created by WithStyles(ConferenceBox))
    in WithStyles(ConferenceBox) (created by Conference)
    in div (created by Conference)
    in Conference (created by ConferenceByUriBox)
    in div (created by ConferenceByUriBox)
    in div (created by ConferenceByUriBox)
    in ConferenceByUriBox (created by WithStyles(ConferenceByUriBox))
    in WithStyles(ConferenceByUriBox) (created by bound conferenceByUri)
    in bound conferenceByUri (created by Locations)
    in div (created by Locations)
    in Locations (created by Blink)
    in div (created by Blink)
    in Blink 4 [demo:12966:25](https://sylk.example/conference/demo)
    overrideMethod demo:12966
    React 3
    render ConferenceBox.js:1300

This time pointing to (ConferenceBox.js:1300):

        if (!this.state.callOverlayVisible) {
            watermark = (
                <CSSTransition     // l. 1300
                    key="watermark"
                    classNames="watermark"
                    timeout={{ enter: 600, exit: 300 }}
                >
                    <div className="watermark"></div>
                </CSSTransition>
            );
        }

Anyway, first video conference success! 🙂

adigeo commented 1 year ago

Our mailing list should be working now, can you try again?

tijmenNL commented 1 year ago

Which react version do you use?

tijmenNL commented 10 months ago

Closing as this should be fixed in 775269a