Переглянути джерело

Removes fabricSetupFailed and adds iceConnectionFailure for callstats.

master
damencho 9 роки тому
джерело
коміт
f79f76fb8c

+ 5
- 3
JitsiConference.js Переглянути файл

@@ -1273,9 +1273,11 @@ function setupListeners(conference) {
1273 1273
                     session, conference.settings);
1274 1274
             });
1275 1275
 
1276
-        conference.room.addListener(XMPPEvents.CONFERENCE_SETUP_FAILED,
1277
-            function () {
1278
-                conference.statistics.sendSetupFailedEvent();
1276
+        conference.room.addListener(XMPPEvents.CONNECTION_ICE_FAILED,
1277
+            function (pc) {
1278
+                conference.statistics.sendIceConnectionFailedEvent(pc);
1279
+                conference.room.eventEmitter.emit(
1280
+                    XMPPEvents.CONFERENCE_SETUP_FAILED);
1279 1281
             });
1280 1282
 
1281 1283
         conference.rtc.addListener(RTCEvents.TRACK_ATTACHED,

+ 7
- 8
modules/statistics/CallStats.js Переглянути файл

@@ -15,6 +15,7 @@ var wrtcFuncNames = {
15 15
     setRemoteDescription: "setRemoteDescription",
16 16
     addIceCandidate:      "addIceCandidate",
17 17
     getUserMedia:         "getUserMedia",
18
+    iceConnectionFailure: "iceConnectionFailure",
18 19
     signalingError:       "signalingError"
19 20
 };
20 21
 
@@ -23,7 +24,6 @@ var wrtcFuncNames = {
23 24
  * @see http://www.callstats.io/api/#enumeration-of-fabricevent
24 25
  */
25 26
 var fabricEvent = {
26
-    fabricSetupFailed:"fabricSetupFailed",
27 27
     fabricHold:"fabricHold",
28 28
     fabricResume:"fabricResume",
29 29
     audioMute:"audioMute",
@@ -263,14 +263,13 @@ CallStats.prototype.sendTerminateEvent = _try_catch(function () {
263 263
 });
264 264
 
265 265
 /**
266
- * Notifies CallStats for connection setup errors
266
+ * Notifies CallStats for ice connection failed
267
+ * @param {RTCPeerConnection} pc connection on which failure occured.
268
+ * @param {CallStats} cs callstats instance related to the error (optional)
267 269
  */
268
-CallStats.prototype.sendSetupFailedEvent = _try_catch(function () {
269
-    if(!callStats) {
270
-        return;
271
-    }
272
-    callStats.sendFabricEvent(this.peerconnection,
273
-        callStats.fabricEvent.fabricSetupFailed, this.confID);
270
+CallStats.prototype.sendIceConnectionFailedEvent = _try_catch(function (pc, cs){
271
+    CallStats._reportError.call(
272
+        cs, wrtcFuncNames.iceConnectionFailure, null, pc);
274 273
 });
275 274
 
276 275
 /**

+ 4
- 3
modules/statistics/statistics.js Переглянути файл

@@ -176,11 +176,12 @@ Statistics.prototype.isCallstatsEnabled = function () {
176 176
 };
177 177
 
178 178
 /**
179
- * Notifies CallStats for connection setup errors
179
+ * Notifies CallStats for ice connection failed
180
+ * @param {RTCPeerConnection} pc connection on which failure occured.
180 181
  */
181
-Statistics.prototype.sendSetupFailedEvent = function () {
182
+Statistics.prototype.sendIceConnectionFailedEvent = function (pc) {
182 183
     if(this.callStatsIntegrationEnabled && this.callstats)
183
-        this.callstats.sendSetupFailedEvent();
184
+        this.callstats.sendIceConnectionFailedEvent(pc, this.callstats);
184 185
 };
185 186
 
186 187
 /**

+ 2
- 1
modules/xmpp/JingleSessionPC.js Переглянути файл

@@ -159,7 +159,8 @@ JingleSessionPC.prototype.doInitialize = function () {
159 159
                     self.room.eventEmitter.emit(XMPPEvents.CONNECTION_INTERRUPTED);
160 160
                 break;
161 161
             case 'failed':
162
-                self.room.eventEmitter.emit(XMPPEvents.CONFERENCE_SETUP_FAILED);
162
+                self.room.eventEmitter.emit(XMPPEvents.CONNECTION_ICE_FAILED,
163
+                    self.peerconnection);
163 164
                 break;
164 165
         }
165 166
     };

+ 5
- 2
service/xmpp/XMPPEvents.js Переглянути файл

@@ -22,6 +22,9 @@ var XMPPEvents = {
22 22
     // Designates an event indicating that the media (ICE) connection was
23 23
     // restored. This should go to the RTC module.
24 24
     CONNECTION_RESTORED: "xmpp.connection.restored",
25
+    // Designates an event indicating that the media (ICE) connection failed.
26
+    // This should go to the RTC module.
27
+    CONNECTION_ICE_FAILED: "xmpp.connection.ice.failed",
25 28
     // TODO: only used in a hack, should probably be removed.
26 29
     CREATE_ANSWER_ERROR: 'xmpp.create_answer_error',
27 30
     /**
@@ -103,7 +106,7 @@ var XMPPEvents = {
103 106
      * Event fired when we remote track is added to the conference.
104 107
      * The following structure is passed as an argument:
105 108
      * {
106
-     *   stream: the WebRTC MediaStream instance 
109
+     *   stream: the WebRTC MediaStream instance
107 110
      *   track: the WebRTC MediaStreamTrack
108 111
      *   mediaType: the MediaType instance
109 112
      *   owner: the MUC JID of the stream owner
@@ -113,7 +116,7 @@ var XMPPEvents = {
113 116
     REMOTE_TRACK_ADDED: "xmpp.remote_track_added",
114 117
     /**
115 118
      * Indicates that the remote track has been removed from the conference.
116
-     * 1st event argument is the ID of the parent WebRTC stream to which 
119
+     * 1st event argument is the ID of the parent WebRTC stream to which
117 120
      * the track being removed belongs to.
118 121
      * 2nd event argument is the ID of the removed track.
119 122
      */

Завантаження…
Відмінити
Зберегти