Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
TypeScript debiandeep-videojitsijitsi-meetscalable-video-conferencessfuvideovideo-communicationvideo-conferencingwebrtc
Adds SIP calls support
hristoterezove494c3028daf
diff --git a/app.js b/app.jsindex 3d1f7e6876..61bbf63bc5 100644--- a/app.js+++ b/app.js@@ -86,7 +86,6 @@ const APP = {membersCount: 0,audioMuted: false,videoMuted: false,- sipGatewayEnabled: false, //FIXME handleisLocalId (id) {return this.localId === id;},@@ -186,6 +185,10 @@ function initConference(localTracks, connection) {APP.UI.addLocalStream(track);};+ APP.conference.sipGatewayEnabled = () => {+ return room.isSIPCallingSupported();+ };+function getDisplayName(id) {if (APP.conference.isLocalId(id)) {return APP.settings.getDisplayName();@@ -442,13 +445,7 @@ function initConference(localTracks, connection) {});APP.UI.addListener(UIEvents.SIP_DIAL, function (sipNumber) {- // FIXME add dial- // APP.xmpp.dial(- // sipNumber,- // 'fromnumber',- // APP.conference.roomName,- // roomLocker.password- // );+ room.dial(sipNumber);});diff --git a/libs/lib-jitsi-meet.js b/libs/lib-jitsi-meet.jsindex 251e210764..fd5ab62f46 100644--- a/libs/lib-jitsi-meet.js+++ b/libs/lib-jitsi-meet.js@@ -579,6 +579,15 @@ JitsiConference.prototype.toggleRecording = function (token, followEntity) {reject(new Error("The conference is not created yet!"))});}+/**+ * Returns true if the SIP calls are supported and false otherwise+ */+JitsiConference.prototype.isSIPCallingSupported = function () {+ if(this.room)+ return this.room.isSIPCallingSupported();+ return false;+}+/*** Dials a number.* @param number the number@@ -6753,6 +6762,15 @@ ChatRoom.prototype.toggleRecording = function (token, followEntity) {reject(new Error("The conference is not created yet!"))});}+/**+ * Returns true if the SIP calls are supported and false otherwise+ */+ChatRoom.prototype.isSIPCallingSupported = function () {+ if(this.moderator)+ return this.moderator.isSipGatewayEnabled();+ return false;+}+/*** Dials a number.* @param number the number@@ -10552,7 +10570,7 @@ function Moderator(roomName, xmpp, emitter) {// Sip gateway can be enabled by configuring Jigasi host in config.js or// it will be enabled automatically if focus detects the component through// service discovery.- this.sipGatewayEnabled =+ this.sipGatewayEnabled = this.xmppService.options.hosts &&this.xmppService.options.hosts.call_control !== undefined;this.eventEmitter = emitter;diff --git a/modules/UI/toolbars/Toolbar.js b/modules/UI/toolbars/Toolbar.jsindex 72431d0c4f..ee43423add 100644--- a/modules/UI/toolbars/Toolbar.js+++ b/modules/UI/toolbars/Toolbar.js@@ -311,7 +311,7 @@ const Toolbar = {// Shows or hides SIP calls buttonshowSipCallButton (show) {- if (APP.conference.sipGatewayEnabled && UIUtil.isButtonEnabled('sip') && show) {+ if (APP.conference.sipGatewayEnabled() && UIUtil.isButtonEnabled('sip') && show) {$('#toolbar_button_sip').css({display: "inline-block"});} else {$('#toolbar_button_sip').css({display: "none"});