summary refs log tree commit diff
diff options
context:
space:
mode:
authorDavid Baker <dbkr@matrix.org>2014-09-11 19:16:57 +0100
committerDavid Baker <dbkr@matrix.org>2014-09-11 19:16:57 +0100
commita059ca6915d05f5a5561965d9738cfaf3e20d4a1 (patch)
treee4b830ec98a489e18c121365d280530942274ef3
parentPut back the line that adds the stream to the invite, otherwise caller->calle... (diff)
downloadsynapse-a059ca6915d05f5a5561965d9738cfaf3e20d4a1.tar.xz
few fixes for errors in glare conditions. still seem to end up with no audio if both calls are placed at the same time.
-rw-r--r--webclient/app-controller.js2
-rw-r--r--webclient/components/matrix/matrix-call.js7
2 files changed, 4 insertions, 5 deletions
diff --git a/webclient/app-controller.js b/webclient/app-controller.js
index 945f71ed20..1d38b84e8e 100644
--- a/webclient/app-controller.js
+++ b/webclient/app-controller.js
@@ -147,7 +147,7 @@ angular.module('MatrixWebClientController', ['matrixService', 'mPresence', 'even
     });
 
     $rootScope.$on(matrixPhoneService.REPLACED_CALL_EVENT, function(ngEvent, oldCall, newCall) {
-        console.log("call ID "+oldCall+" has been replaced by call ID "+newCall+"!");
+        console.log("call ID "+oldCall.call_id+" has been replaced by call ID "+newCall.call_id+"!");
         newCall.onError = $scope.onCallError;
         newCall.onHangup = $scope.onCallHangup;
         $rootScope.currentCall = newCall;
diff --git a/webclient/components/matrix/matrix-call.js b/webclient/components/matrix/matrix-call.js
index 2191bdab39..7407c6fd7c 100644
--- a/webclient/components/matrix/matrix-call.js
+++ b/webclient/components/matrix/matrix-call.js
@@ -167,9 +167,8 @@ angular.module('MatrixCall', [])
             },
         };
         this.peerConn.createAnswer(function(d) { self.createdAnswer(d); }, function(e) {}, constraints);
-        $rootScope.$apply(function() {
-            self.state = 'create_answer';
-        });
+        // This can't be in an apply() because it's called by a predecessor call under glare conditions :(
+        self.state = 'create_answer';
     };
 
     MatrixCall.prototype.gotLocalIceCandidate = function(event) {
@@ -326,7 +325,7 @@ angular.module('MatrixCall', [])
         this.state = 'ended';
         this.hangupParty = 'remote';
         this.stopAllMedia();
-        this.peerConn.close();
+        if (this.peerConn.signalingState != 'closed') this.peerConn.close();
         if (this.onHangup) this.onHangup(this);
     };