From 590b9fded3c0f7734124b003b46cafcc302439da Mon Sep 17 00:00:00 2001 From: Matthias Damm Date: Mon, 8 Jun 2020 13:01:02 +0200 Subject: [PATCH] fixed conference end handling, callback as seperate channel --- public/callcenter/WorkflowReservationController.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/public/callcenter/WorkflowReservationController.js b/public/callcenter/WorkflowReservationController.js index c828611..ac31045 100644 --- a/public/callcenter/WorkflowReservationController.js +++ b/public/callcenter/WorkflowReservationController.js @@ -15,6 +15,8 @@ function WorkflowReservationController ($scope, $rootScope, $timeout, $interval, $scope.$on('DestroyReservation', function (event) { $log.log('DestroyReservation event received'); $scope.reservation = null; + $scope.stopCounter(); + $scope.$apply(); }); $scope.startCounter = function () { @@ -51,7 +53,7 @@ function WorkflowReservationController ($scope, $rootScope, $timeout, $interval, return; } - $rootScope.$broadcast('ActivateVideo', { roomName: reservation.task.attributes.roomName }); + $rootScope.$broadcast('ActivateVideo', { roomName: reservation.task.attributes.video.roomName }); }); @@ -68,14 +70,14 @@ function WorkflowReservationController ($scope, $rootScope, $timeout, $interval, return; } - $rootScope.$broadcast('ActivateChat', { channelSid: reservation.task.attributes.channelSid }); + $rootScope.$broadcast('ActivateChat', { channelSid: reservation.task.attributes.chat.sid }); }); } - if (reservation.task.attributes.channel === 'phone' && reservation.task.attributes.type === 'inbound_call') { - + if (reservation.task.attributes.channel === 'phone') { + reservation.conference($scope.configuration.twilio.callerId, undefined, undefined, undefined, function (error, reservation) { if (error) { @@ -83,12 +85,12 @@ function WorkflowReservationController ($scope, $rootScope, $timeout, $interval, return; } - }, { 'EndConferenceOnExit': 'true' }); + }, { 'EndConferenceOnExit': true, 'EndConferenceOnCustomerExit': true, 'ConferenceRecord': $scope.configuration.twilio.voice.recording }); } /* we accept the reservation and initiate a call to the customer's phone number */ - if (reservation.task.attributes.channel === 'phone' && reservation.task.attributes.type === 'callback_request') { + if (reservation.task.attributes.channel === 'callback') { reservation.accept(