ソースを参照

fix(conference): fire failed event on o/a failure

release-8443
Hristo Terezov 6年前
コミット
ee1854c1b1

+ 2
- 2
JitsiConferenceErrors.js ファイルの表示

56
     = 'conference.incompatible_server_versions';
56
     = 'conference.incompatible_server_versions';
57
 
57
 
58
 /**
58
 /**
59
- * Indicates that jingle fatal error happened.
59
+ * Indicates that offer/answer had failed.
60
  */
60
  */
61
-export const JINGLE_FATAL_ERROR = 'conference.jingleFatalError';
61
+export const OFFER_ANSWER_FAILED = 'conference.offerAnswerFailed';
62
 
62
 
63
 /**
63
 /**
64
  * Indicates that password cannot be set for this conference.
64
  * Indicates that password cannot be set for this conference.

+ 23
- 20
JitsiConferenceEventManager.js ファイルの表示

142
             });
142
             });
143
         });
143
         });
144
 
144
 
145
+    chatRoom.addListener(XMPPEvents.RENEGOTIATION_FAILED, (e, session) => {
146
+        if (!session.isP2P) {
147
+            conference.eventEmitter.emit(JitsiConferenceEvents.CONFERENCE_FAILED,
148
+                JitsiConferenceErrors.OFFER_ANSWER_FAILED, e);
149
+        }
150
+    });
151
+
145
     this.chatRoomForwarder.forward(XMPPEvents.ROOM_JOIN_ERROR,
152
     this.chatRoomForwarder.forward(XMPPEvents.ROOM_JOIN_ERROR,
146
         JitsiConferenceEvents.CONFERENCE_FAILED,
153
         JitsiConferenceEvents.CONFERENCE_FAILED,
147
         JitsiConferenceErrors.CONNECTION_ERROR);
154
         JitsiConferenceErrors.CONNECTION_ERROR);
180
         JitsiConferenceEvents.CONFERENCE_FAILED,
187
         JitsiConferenceEvents.CONFERENCE_FAILED,
181
         JitsiConferenceErrors.GRACEFUL_SHUTDOWN);
188
         JitsiConferenceErrors.GRACEFUL_SHUTDOWN);
182
 
189
 
183
-    chatRoom.addListener(XMPPEvents.JINGLE_FATAL_ERROR,
184
-        (session, error) => {
185
-            if (!session.isP2P) {
186
-                conference.eventEmitter.emit(
187
-                    JitsiConferenceEvents.CONFERENCE_FAILED,
188
-                    JitsiConferenceErrors.JINGLE_FATAL_ERROR, error);
189
-            }
190
-        });
191
-
192
     chatRoom.addListener(XMPPEvents.CONNECTION_ICE_FAILED,
190
     chatRoom.addListener(XMPPEvents.CONNECTION_ICE_FAILED,
193
         jingleSession => {
191
         jingleSession => {
194
             conference._onIceConnectionFailed(jingleSession);
192
             conference._onIceConnectionFailed(jingleSession);
238
     this.chatRoomForwarder.forward(XMPPEvents.PHONE_NUMBER_CHANGED,
236
     this.chatRoomForwarder.forward(XMPPEvents.PHONE_NUMBER_CHANGED,
239
         JitsiConferenceEvents.PHONE_NUMBER_CHANGED);
237
         JitsiConferenceEvents.PHONE_NUMBER_CHANGED);
240
 
238
 
241
-    chatRoom.addListener(
242
-        XMPPEvents.CONFERENCE_SETUP_FAILED,
243
-        (jingleSession, error) => {
244
-            if (!jingleSession.isP2P) {
245
-                conference.eventEmitter.emit(
246
-                    JitsiConferenceEvents.CONFERENCE_FAILED,
247
-                    JitsiConferenceErrors.SETUP_FAILED,
248
-                    error);
249
-            }
250
-        });
251
-
252
     chatRoom.setParticipantPropertyListener((node, from) => {
239
     chatRoom.setParticipantPropertyListener((node, from) => {
253
         const participant = conference.getParticipantById(from);
240
         const participant = conference.getParticipantById(from);
254
 
241
 
503
     rtc.addListener(RTCEvents.CREATE_ANSWER_FAILED,
490
     rtc.addListener(RTCEvents.CREATE_ANSWER_FAILED,
504
         (e, tpc) => {
491
         (e, tpc) => {
505
             conference.statistics.sendCreateAnswerFailed(e, tpc);
492
             conference.statistics.sendCreateAnswerFailed(e, tpc);
493
+            if (!tpc.isP2P) {
494
+                conference.eventEmitter.emit(JitsiConferenceEvents.CONFERENCE_FAILED,
495
+                    JitsiConferenceErrors.OFFER_ANSWER_FAILED, e);
496
+            }
506
         });
497
         });
507
 
498
 
508
     rtc.addListener(RTCEvents.CREATE_OFFER_FAILED,
499
     rtc.addListener(RTCEvents.CREATE_OFFER_FAILED,
509
         (e, tpc) => {
500
         (e, tpc) => {
510
             conference.statistics.sendCreateOfferFailed(e, tpc);
501
             conference.statistics.sendCreateOfferFailed(e, tpc);
502
+            if (!tpc.isP2P) {
503
+                conference.eventEmitter.emit(JitsiConferenceEvents.CONFERENCE_FAILED,
504
+                    JitsiConferenceErrors.OFFER_ANSWER_FAILED, e);
505
+            }
511
         });
506
         });
512
 
507
 
513
     rtc.addListener(RTCEvents.SET_LOCAL_DESCRIPTION_FAILED,
508
     rtc.addListener(RTCEvents.SET_LOCAL_DESCRIPTION_FAILED,
514
         (e, tpc) => {
509
         (e, tpc) => {
515
             conference.statistics.sendSetLocalDescFailed(e, tpc);
510
             conference.statistics.sendSetLocalDescFailed(e, tpc);
511
+            if (!tpc.isP2P) {
512
+                conference.eventEmitter.emit(JitsiConferenceEvents.CONFERENCE_FAILED,
513
+                    JitsiConferenceErrors.OFFER_ANSWER_FAILED, e);
514
+            }
516
         });
515
         });
517
 
516
 
518
     rtc.addListener(RTCEvents.SET_REMOTE_DESCRIPTION_FAILED,
517
     rtc.addListener(RTCEvents.SET_REMOTE_DESCRIPTION_FAILED,
519
         (e, tpc) => {
518
         (e, tpc) => {
520
             conference.statistics.sendSetRemoteDescFailed(e, tpc);
519
             conference.statistics.sendSetRemoteDescFailed(e, tpc);
520
+            if (!tpc.isP2P) {
521
+                conference.eventEmitter.emit(JitsiConferenceEvents.CONFERENCE_FAILED,
522
+                    JitsiConferenceErrors.OFFER_ANSWER_FAILED, e);
523
+            }
521
         });
524
         });
522
 
525
 
523
     rtc.addListener(RTCEvents.LOCAL_TRACK_SSRC_UPDATED,
526
     rtc.addListener(RTCEvents.LOCAL_TRACK_SSRC_UPDATED,

+ 10
- 19
modules/xmpp/JingleSessionPC.js ファイルの表示

1012
                             this.isInitiator ? 'answer: ' : 'offer: '}${error}`,
1012
                             this.isInitiator ? 'answer: ' : 'offer: '}${error}`,
1013
                         newRemoteSdp);
1013
                         newRemoteSdp);
1014
 
1014
 
1015
-                    this._onJingleFatalError(error);
1016
                     finishedCallback(error);
1015
                     finishedCallback(error);
1017
                 });
1016
                 });
1018
         };
1017
         };
1584
      */
1583
      */
1585
     _renegotiate(optionalRemoteSdp) {
1584
     _renegotiate(optionalRemoteSdp) {
1586
         if (this.peerconnection.signalingState === 'closed') {
1585
         if (this.peerconnection.signalingState === 'closed') {
1587
-            return Promise.reject('Attempted to renegotiate in state closed');
1586
+            const error = new Error('Attempted to renegotiate in state closed');
1587
+
1588
+            this.room.eventEmitter.emit(XMPPEvents.RENEGOTIATION_FAILED, error, this);
1589
+
1590
+            return Promise.reject(error);
1588
         }
1591
         }
1589
 
1592
 
1590
         const remoteSdp
1593
         const remoteSdp
1591
             = optionalRemoteSdp || this.peerconnection.remoteDescription.sdp;
1594
             = optionalRemoteSdp || this.peerconnection.remoteDescription.sdp;
1592
 
1595
 
1593
         if (!remoteSdp) {
1596
         if (!remoteSdp) {
1594
-            return Promise.reject(
1595
-                'Can not renegotiate without remote description,'
1596
-                    + `- current state: ${this.state}`);
1597
+            const error = new Error(`Can not renegotiate without remote description, current state: ${this.state}`);
1598
+
1599
+            this.room.eventEmitter.emit(XMPPEvents.RENEGOTIATION_FAILED, error, this);
1600
+
1601
+            return Promise.reject(error);
1597
         }
1602
         }
1598
 
1603
 
1599
         const remoteDescription = new RTCSessionDescription({
1604
         const remoteDescription = new RTCSessionDescription({
2234
         };
2239
         };
2235
     }
2240
     }
2236
 
2241
 
2237
-    /**
2238
-     *
2239
-     * @param error
2240
-     * @private
2241
-     */
2242
-    _onJingleFatalError(error) {
2243
-        if (this.room) {
2244
-            this.room.eventEmitter.emit(
2245
-                XMPPEvents.CONFERENCE_SETUP_FAILED, this, error);
2246
-            this.room.eventEmitter.emit(
2247
-                XMPPEvents.JINGLE_FATAL_ERROR, this, error);
2248
-        }
2249
-    }
2250
-
2251
     /**
2242
     /**
2252
      * Returns the ice connection state for the peer connection.
2243
      * Returns the ice connection state for the peer connection.
2253
      * @returns the ice connection state for the peer connection.
2244
      * @returns the ice connection state for the peer connection.

+ 5
- 17
service/xmpp/XMPPEvents.js ファイルの表示

29
     // The conference properties (as advertised by jicofo) have changed
29
     // The conference properties (as advertised by jicofo) have changed
30
     CONFERENCE_PROPERTIES_CHANGED: 'xmpp.conference_properties_changed',
30
     CONFERENCE_PROPERTIES_CHANGED: 'xmpp.conference_properties_changed',
31
 
31
 
32
-    CONFERENCE_SETUP_FAILED: 'xmpp.conference_setup_failed',
33
-
34
     /**
32
     /**
35
      * This event is triggered when the ICE connects for the first time.
33
      * This event is triggered when the ICE connects for the first time.
36
      */
34
      */
87
      */
85
      */
88
     ICE_RESTART_SUCCESS: 'rtc.ice_restart_success',
86
     ICE_RESTART_SUCCESS: 'rtc.ice_restart_success',
89
 
87
 
90
-    /* Event fired when XMPP error is returned to any request, it is meant to be
91
-     * used to report 'signaling' errors to CallStats
92
-     *
93
-     * {
94
-     *   code: {XMPP error code}
95
-     *   reason: {XMPP error condition}
96
-     *   source = request.tree()
97
-     *   session = {JingleSession instance}
98
-     * }
99
-     */
100
-    JINGLE_ERROR: 'xmpp.jingle_error',
101
-
102
-    // Event fired when we have failed to set initial offer
103
-    JINGLE_FATAL_ERROR: 'xmpp.jingle_fatal_error',
104
-
105
     /**
88
     /**
106
      * Designates an event indicating that we were kicked from the XMPP MUC.
89
      * Designates an event indicating that we were kicked from the XMPP MUC.
107
      * @param {boolean} isSelfPresence - whether it is for local participant
90
      * @param {boolean} isSelfPresence - whether it is for local participant
189
     // Designates an event indicating that we received statistics from a
172
     // Designates an event indicating that we received statistics from a
190
     // participant in the MUC.
173
     // participant in the MUC.
191
     REMOTE_STATS: 'xmpp.remote_stats',
174
     REMOTE_STATS: 'xmpp.remote_stats',
175
+
176
+    /**
177
+     * Indicates that the offer / answer renegotiation has failed.
178
+     */
179
+    RENEGOTIATION_FAILED: 'xmpp.renegotiation_failed',
192
     RESERVATION_ERROR: 'xmpp.room_reservation_error',
180
     RESERVATION_ERROR: 'xmpp.room_reservation_error',
193
     ROOM_CONNECT_ERROR: 'xmpp.room_connect_error',
181
     ROOM_CONNECT_ERROR: 'xmpp.room_connect_error',
194
     ROOM_CONNECT_NOT_ALLOWED_ERROR: 'xmpp.room_connect_error.not_allowed',
182
     ROOM_CONNECT_NOT_ALLOWED_ERROR: 'xmpp.room_connect_error.not_allowed',

読み込み中…
キャンセル
保存