From 5dea92b0dc11cb88d223659a931b24c305d734d9 Mon Sep 17 00:00:00 2001 From: damencho Date: Mon, 21 Dec 2015 14:46:50 -0600 Subject: [PATCH] Adds method to expose internal state - iceConnectionState, which later will be used by torture. --- JitsiConference.js | 10 ++++++++++ lib-jitsi-meet.js | 27 +++++++++++++++++++++++++++ modules/xmpp/ChatRoom.js | 9 +++++++++ modules/xmpp/JingleSessionPC.js | 8 ++++++++ 4 files changed, 54 insertions(+) diff --git a/JitsiConference.js b/JitsiConference.js index c38fba3a2..e19935573 100644 --- a/JitsiConference.js +++ b/JitsiConference.js @@ -493,6 +493,16 @@ JitsiConference.prototype.getPhonePin = function () { return null; } +/** + * Returns the connection state for the current room. Its ice connection state + * for its session. + */ +JitsiConference.prototype.getConnectionState = function () { + if(this.room) + return this.room.getConnectionState(); + return null; +} + /** * Setups the listeners needed for the conference. * @param conference the conference diff --git a/lib-jitsi-meet.js b/lib-jitsi-meet.js index 1a9d350a7..e8c892fa5 100644 --- a/lib-jitsi-meet.js +++ b/lib-jitsi-meet.js @@ -495,6 +495,16 @@ JitsiConference.prototype.getPhonePin = function () { return null; } +/** + * Returns the connection state for the current room. Its ice connection state + * for its session. + */ +JitsiConference.prototype.getConnectionState = function () { + if(this.room) + return this.room.getConnectionState(); + return null; +} + /** * Setups the listeners needed for the conference. * @param conference the conference @@ -6543,6 +6553,15 @@ ChatRoom.prototype.getPhonePin = function () { return this.phonePin; } +/** + * Returns the connection state for the current session. + */ +ChatRoom.prototype.getConnectionState = function () { + if(!this.session) + return null; + return this.session.getIceConnectionState(); +} + module.exports = ChatRoom; }).call(this,"/modules/xmpp/ChatRoom.js") @@ -8312,6 +8331,14 @@ JingleSessionPC.prototype.remoteStreamAdded = function (data, times) { } } +/** + * Returns the ice connection state for the peer connection. + * @returns the ice connection state for the peer connection. + */ +JingleSessionPC.prototype.getIceConnectionState = function () { + return this.peerconnection.iceConnectionState; +} + module.exports = JingleSessionPC; }).call(this,"/modules/xmpp/JingleSessionPC.js") diff --git a/modules/xmpp/ChatRoom.js b/modules/xmpp/ChatRoom.js index a32274e34..495dc0691 100644 --- a/modules/xmpp/ChatRoom.js +++ b/modules/xmpp/ChatRoom.js @@ -741,4 +741,13 @@ ChatRoom.prototype.getPhonePin = function () { return this.phonePin; } +/** + * Returns the connection state for the current session. + */ +ChatRoom.prototype.getConnectionState = function () { + if(!this.session) + return null; + return this.session.getIceConnectionState(); +} + module.exports = ChatRoom; diff --git a/modules/xmpp/JingleSessionPC.js b/modules/xmpp/JingleSessionPC.js index 24fc8df92..0f7e7d298 100644 --- a/modules/xmpp/JingleSessionPC.js +++ b/modules/xmpp/JingleSessionPC.js @@ -1626,4 +1626,12 @@ JingleSessionPC.prototype.remoteStreamAdded = function (data, times) { } } +/** + * Returns the ice connection state for the peer connection. + * @returns the ice connection state for the peer connection. + */ +JingleSessionPC.prototype.getIceConnectionState = function () { + return this.peerconnection.iceConnectionState; +} + module.exports = JingleSessionPC;