public static void SetIsRecorded(this EventCallStartMsg msg)
        {
            if (!msg.IsDataValid() || String.IsNullOrWhiteSpace(msg.Header?.CalledNumber))
            {
                return;
            }

            GetInteractionArguments args = new GetInteractionArguments();

            args.Ani                = msg.Header.Ani;
            args.InmateId           = msg.Header.Pin;
            args.ExternalIdentifier = msg.Header.CalledNumber;
            args.SiteId             = msg.Header.SiteId;

            RecordingLevel recordingLevel = CircuitRepo.GetRecordingLevel(args);

            msg.Data.Recorded = recordingLevel != RecordingLevel.DoNotRecord;
        }
        public IHttpActionResult GetCircuits(GetCircuitArguments args)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    List <Circuit> result = CircuitRepo.GetCircuits(args);
                    _logger.LogInfo($"GetCircuits results: {result?.Count ?? 0}");
                    _logger.LogInfo($"GetCircuits args: {JsonConvert.SerializeObject(args)}");

                    return(Ok(result));
                }

                return(BadRequest(ModelState));
            }
            catch (Exception ex)
            {
                _logger.LogError(ex, "Error trying to get circuits");
                return(InternalServerError(ex));
            }
        }