public bool Handle(Dto.EventBus.ChannelStateChangedEvent evt) { try { var apiConfig = SysConfigService.Get <VideoRecorder>(); if (evt.State == EnumRoomState.InMedicalTreatment && !string.IsNullOrEmpty(evt.ChannelID)) { var response = WebAPIHelper.HttpGet($"{apiConfig.VideoRecorderApiUrl.TrimEnd('/')}/api/StartRecord?ChannelID={evt.ChannelID}", ""); var result = 0; if (int.TryParse(response, out result)) { if (result > 0) { return(false); } else { return(false); } } else { return(false); } } } catch (Exception ex) { LogHelper.DefaultLogger.Error(ex.Message, ex); return(false); } return(true); }