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
Will use XEP-0199 ping for keep-alive only if it is supported by the server.
paweldomas60d0279e087c
diff --git a/modules/xmpp/strophe.ping.js b/modules/xmpp/strophe.ping.jsindex b11f65119e..1ac534595b 100644--- a/modules/xmpp/strophe.ping.js+++ b/modules/xmpp/strophe.ping.js@@ -53,6 +53,26 @@ module.exports = function (XMPP, eventEmitter) {this.connection.sendIQ(iq, success, error, timeout);},+ /**+ * Checks if given <tt>jid</tt> has XEP-0199 ping support.+ * @param jid the JID to be checked for ping support.+ * @param callback function with boolean argument which will be+ * <tt>true</tt> if XEP-0199 ping is supported by given <tt>jid</tt>+ */+ hasPingSupport: function (jid, callback) {+ this.connection.disco.info(+ jid, null,+ function (result) {+ var ping = $(result).find('>>feature[var="urn:xmpp:ping"]');+ callback(ping.length > 0);+ },+ function (error) {+ console.error("Ping feature discovery error", error);+ callback(false);+ }+ );+ },+/*** Starts to send ping in given interval to specified remote JID.* This plugin supports only one such task and <tt>stopInterval</tt>diff --git a/modules/xmpp/xmpp.js b/modules/xmpp/xmpp.jsindex 4afd060c75..3dc9fb077b 100644--- a/modules/xmpp/xmpp.js+++ b/modules/xmpp/xmpp.js@@ -87,7 +87,17 @@ function connect(jid, password) {console.info("My Jabber ID: " + connection.jid);- connection.ping.startInterval(config.hosts.domain);+ // Schedule ping ?+ var pingJid = config.hosts.domain;+ connection.ping.hasPingSupport(+ pingJid,+ function (hasPing) {+ if (hasPing)+ connection.ping.startInterval(pingJid);+ else+ console.warn("Ping NOT supported by " + pingJid);+ }+ );if (password)authenticatedUser = true;