|
@@ -83,7 +83,10 @@ JingleSessionPC.prototype.doInitialize = function () {
|
83
|
83
|
this.hadstuncandidate = false;
|
84
|
84
|
this.hadturncandidate = false;
|
85
|
85
|
this.lasticecandidate = false;
|
|
86
|
+ // True if reconnect is in progress
|
86
|
87
|
this.isreconnect = false;
|
|
88
|
+ // Set to true if the connection was ever stable
|
|
89
|
+ this.wasstable = false;
|
87
|
90
|
|
88
|
91
|
this.peerconnection = new TraceablePeerConnection(
|
89
|
92
|
this.connection.jingle.ice_config,
|
|
@@ -112,6 +115,10 @@ JingleSessionPC.prototype.doInitialize = function () {
|
112
|
115
|
};
|
113
|
116
|
this.peerconnection.onsignalingstatechange = function (event) {
|
114
|
117
|
if (!(self && self.peerconnection)) return;
|
|
118
|
+ console.info("Signaling: " + this.peerconnection.signalingState);
|
|
119
|
+ if (self.peerconnection.signalingState === 'stable') {
|
|
120
|
+ self.wasstable = true;
|
|
121
|
+ }
|
115
|
122
|
self.updateModifySourcesQueue();
|
116
|
123
|
};
|
117
|
124
|
/**
|
|
@@ -123,6 +130,7 @@ JingleSessionPC.prototype.doInitialize = function () {
|
123
|
130
|
*/
|
124
|
131
|
this.peerconnection.oniceconnectionstatechange = function (event) {
|
125
|
132
|
if (!(self && self.peerconnection)) return;
|
|
133
|
+ console.info("Ice: " + self.peerconnection.iceConnectionState);
|
126
|
134
|
self.updateModifySourcesQueue();
|
127
|
135
|
switch (self.peerconnection.iceConnectionState) {
|
128
|
136
|
case 'connected':
|
|
@@ -136,7 +144,7 @@ JingleSessionPC.prototype.doInitialize = function () {
|
136
|
144
|
case 'disconnected':
|
137
|
145
|
self.isreconnect = true;
|
138
|
146
|
// Informs interested parties that the connection has been interrupted.
|
139
|
|
- if (self.peerconnection.signalingState === 'stable')
|
|
147
|
+ if (self.wasstable)
|
140
|
148
|
self.eventEmitter.emit(XMPPEvents.CONNECTION_INTERRUPTED);
|
141
|
149
|
break;
|
142
|
150
|
case 'failed':
|