public async Task <demoResult> SetIsolationStatus([FromBody] IsolationStatusDto isolationStatusDto)
        {
            var result = await _callManagementService.SetIsolationStatus(isolationStatusDto.CallId, isolationStatusDto.Isolated);

            if (result.IsFailure)
            {
                return(BadRequest(result.ErrorCode));
            }

            return(Ok());
        }
Exemplo n.º 2
0
        public async Task <demoResult> SetIsolationStatus(IsolationStatusDto dto)
        {
            if (dto.CallId == Guid.Empty)
            {
                return(BadRequest(ErrorCodes.ValidationError));
            }

            var result = await _asteriskAriApiService.SetIsolationStatus(dto);

            if (result.IsFailure)
            {
                return(Answer(result));
            }

            return(Ok());
        }
        /// <summary>
        /// Установить статус изоляции.
        /// </summary>
        public async Task <Result> SetIsolationStatus(IsolationStatusDto model)
        {
            try
            {
                var args = new IsolationStasisStartEventArgs
                {
                    IsolationStatusData = model
                };

                await _commandFactory.GetCommand(StasisStartEventType.IsolationCommand).Execute(null, args);

                return(Result.Success());
            }
            catch (Exception e)
            {
                _logger.Warning(e.Message);
                return(Result.Failure(ErrorCodes.UnableToSetIsolationStatus));
            }
        }
 /// <summary>
 /// Установить статус изоляции.
 /// </summary>
 public async Task <Result> SetIsolationStatus(IsolationStatusDto model)
 {
     _logger.Information($"SetIsolationStatus. Call isolation: {model.CallId}; {model.Isolated}");
     return(await _ariWebSocketService.SetIsolationStatus(model));
 }