Skip to content

Commit

Permalink
fixed conference end handling, callback as seperate channel
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Damm committed Jun 8, 2020
1 parent 6556d03 commit 590b9fd
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions public/callcenter/WorkflowReservationController.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down Expand Up @@ -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 });

});

Expand All @@ -68,27 +70,27 @@ 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) {
$log.error(error);
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(

Expand Down

0 comments on commit 590b9fd

Please sign in to comment.