Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #266 from jaoo/1078315
Browse files Browse the repository at this point in the history
Bug 1078315 - [Loop] Incoming call continues ringing, when the call is answered from another device with the same FxAccount. r=frsela
(cherry picked from commit 97ac957)
  • Loading branch information
jaoo committed Oct 29, 2014
1 parent e01ef76 commit 42def4b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
17 changes: 13 additions & 4 deletions app/call_screen/js/call_manager.js
Expand Up @@ -16,6 +16,7 @@
var _connectionTimeout;
var _callProgressHelper = null;
var _callee;
var _calleeJoined = false;
var _isCalleeUnavailable = true;
var _speakerManager;
var _onhold = function noop() {};
Expand Down Expand Up @@ -109,10 +110,11 @@
CallScreenUI.setCallStatus('calling');
return;
}

_perfDebug && PerfLog.log(_perfBranch,
'We send "accept" event through websocket');
callProgressHelper.accept();
if (_callee && _calleeJoined) {
_perfDebug && PerfLog.log(_perfBranch,
'We send "accept" event through websocket');
callProgressHelper.accept();
}
break;
case 'connecting':
_perfDebug && PerfLog.log(_perfBranch,
Expand Down Expand Up @@ -180,6 +182,7 @@
_callProgressHelper = null;

if (!reason) {
_onpeercancel();
return;
}
switch (reason) {
Expand All @@ -201,6 +204,7 @@
_onpeerended();
break;
default:
_onpeercancel();
break;
}
break;
Expand Down Expand Up @@ -487,6 +491,9 @@
});
});

if (_callee) {
_calleeJoined = true;
}

window.addEventListener('offline', _dispatchNetworkError);
_handleCallProgress(_callProgressHelper);
Expand Down Expand Up @@ -580,6 +587,8 @@
);
}

_calleeJoined = false;

if (_callProgressHelper) {
if (_isCallManagerInitialized) {
_resolvePromise(error);
Expand Down
4 changes: 2 additions & 2 deletions app/js/helpers/call_progress_helper.js
Expand Up @@ -91,7 +91,7 @@
if (that._state !== 'connected') {
var message = {};
that._state = message.state = 'terminated';
message.reason = 'Websocket onclose fired';
that._reason = message.reason = 'Websocket onclose fired';
_callback(that._onerror, [message]);
return;
}
Expand All @@ -101,7 +101,7 @@
this._ws.onerror = function onErrorWS(evt) {
var message = {};
that._state = message.state = 'terminated';
message.reason = 'Websocket onerror fired';
that._reason = message.reason = 'Websocket onerror fired';
_callback(that._onerror, [message]);
};
}
Expand Down

0 comments on commit 42def4b

Please sign in to comment.