mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-06-04 23:38:47 -04:00
First basic working VoIP call support
This commit is contained in:
parent
7d34a1c108
commit
ca7426eee0
4 changed files with 162 additions and 17 deletions
|
@ -85,6 +85,9 @@ angular.module('RoomController', ['ngSanitize', 'mFileInput', 'mUtilities'])
|
|||
|
||||
$rootScope.$on(matrixPhoneService.CALL_EVENT, function(ngEvent, call) {
|
||||
console.trace("incoming call");
|
||||
call.onError = $scope.onCallError;
|
||||
call.onHangup = $scope.onCallHangup;
|
||||
$scope.currentCall = call;
|
||||
});
|
||||
|
||||
$scope.paginateMore = function() {
|
||||
|
@ -93,6 +96,15 @@ angular.module('RoomController', ['ngSanitize', 'mFileInput', 'mUtilities'])
|
|||
paginate(MESSAGES_PER_PAGINATION);
|
||||
}
|
||||
};
|
||||
|
||||
$scope.answerCall = function() {
|
||||
$scope.currentCall.answer();
|
||||
};
|
||||
|
||||
$scope.hangupCall = function() {
|
||||
$scope.currentCall.hangup();
|
||||
$scope.currentCall = undefined;
|
||||
};
|
||||
|
||||
var paginate = function(numItems) {
|
||||
// console.log("paginate " + numItems);
|
||||
|
@ -438,10 +450,17 @@ angular.module('RoomController', ['ngSanitize', 'mFileInput', 'mUtilities'])
|
|||
$scope.startVoiceCall = function() {
|
||||
var call = new MatrixCall($scope.room_id);
|
||||
call.onError = $scope.onCallError;
|
||||
call.onHangup = $scope.onCallHangup;
|
||||
call.placeCall();
|
||||
$scope.currentCall = call;
|
||||
}
|
||||
|
||||
$scope.onCallError = function(errStr) {
|
||||
$scope.feedback = errStr;
|
||||
}
|
||||
|
||||
$scope.onCallHangup = function() {
|
||||
$scope.feedback = "Call ended";
|
||||
$scope.currentCall = undefined;
|
||||
}
|
||||
}]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue