@@ -447,8 +447,6 @@ WebRTCSession.prototype.processOnCall = function(callerID, extension) {
447447 var self = this ,
448448 oppIDs = self . _uniqueOpponentsIDs ( ) ;
449449
450- self . _clearWaitingOfferOrAnswerTimer ( ) ;
451-
452450 oppIDs . forEach ( function ( opID , i , arr ) {
453451 var pConn = self . peerConnections [ opID ] ;
454452
@@ -482,8 +480,6 @@ WebRTCSession.prototype.processOnCall = function(callerID, extension) {
482480} ;
483481
484482WebRTCSession . prototype . processOnAccept = function ( userID , extension ) {
485- this . _clearWaitingOfferOrAnswerTimer ( ) ;
486-
487483 var peerConnection = this . peerConnections [ userID ] ;
488484 if ( peerConnection ) {
489485 peerConnection . _clearDialingTimer ( ) ;
@@ -743,10 +739,9 @@ WebRTCSession.prototype._clearWaitingOfferOrAnswerTimer = function() {
743739 clearTimeout ( this . waitingOfferOrAnswerTimer ) ;
744740 this . waitingOfferOrAnswerTimer = null ;
745741 }
746- }
742+ } ;
747743
748744WebRTCSession . prototype . _startWaitingOfferOrAnswerTimer = function ( time ) {
749-
750745 var self = this ,
751746 timeout = ( config . webrtc . answerTimeInterval - time ) < 0 ? 1 : config . webrtc . answerTimeInterval - time ,
752747 waitingOfferOrAnswerTimeoutCallback = function ( ) {
@@ -755,7 +750,7 @@ WebRTCSession.prototype._startWaitingOfferOrAnswerTimer = function(time) {
755750 if ( Object . keys ( self . peerConnections ) . length > 0 ) {
756751 Object . keys ( self . peerConnections ) . forEach ( function ( key ) {
757752 var peerConnection = self . peerConnections [ key ] ;
758- if ( peerConnection . state !== RTCPeerConnection . State . CONNECTED ) {
753+ if ( peerConnection . state === RTCPeerConnection . State . CONNECTING || peerConnection . state === RTCPeerConnection . State . NEW ) {
759754 self . processOnNotAnswer ( peerConnection ) ;
760755 }
761756 } ) ;
0 commit comments