From 833f1574eb79fef4611b9c64c78023a2b3469b6b Mon Sep 17 00:00:00 2001 From: Vanitha S <116701245+vanitha1822@users.noreply.github.com> Date: Wed, 23 Jul 2025 11:05:19 +0530 Subject: [PATCH 01/10] fix: video consultation functionality --- src/main/environment/common_ci.properties | 4 +- .../environment/common_example.properties | 4 +- .../videocall/VideoCallController.java | 24 +++++++- .../data/videocall/VideoCallParameters.java | 22 +++++++ .../mapper/videocall/VideoCallMapper.java | 23 +++++++- .../model/videocall/UpdateCallRequest.java | 22 +++++++ .../model/videocall/UpdateCallResponse.java | 22 +++++++ .../model/videocall/VideoCallRequest.java | 22 +++++++ .../VideoCallParameterRepository.java | 22 +++++++ .../service/videocall/VideoCallService.java | 24 +++++++- .../videocall/VideoCallServiceImpl.java | 57 +++++++++---------- 11 files changed, 208 insertions(+), 38 deletions(-) diff --git a/src/main/environment/common_ci.properties b/src/main/environment/common_ci.properties index 0184b32f..6997035e 100644 --- a/src/main/environment/common_ci.properties +++ b/src/main/environment/common_ci.properties @@ -189,8 +189,8 @@ captcha.enable-captcha=@env.ENABLE_CAPTCHA@ cors.allowed-origins=@env.CORS_ALLOWED_ORIGINS@ -video-call-url=@env.VIDEO_CALL_URL@ -jibri.output.path=@env.JIBRI_OUTPUT_PATH@ +# Jitsi configuration +videocall.url=@env.VIDEO_CALL_URL@ video.recording.path=@env.VIDEO_RECORDING_PATH@ platform.feedback.ratelimit.enabled=@env.PLATFORM_FEEDBACK_RATELIMIT_ENABLED@ diff --git a/src/main/environment/common_example.properties b/src/main/environment/common_example.properties index aca73ddb..f55f142b 100644 --- a/src/main/environment/common_example.properties +++ b/src/main/environment/common_example.properties @@ -198,8 +198,8 @@ grievanceAllocationRetryConfiguration=3 logging.path=logs/ logging.file.name=logs/common-api.log -video-call-url=https://vc.piramalswasthya.org/? -jibri.output.path=/srv/jibri/recordings +# Jitsi configuration +videocall.url=https://vc.piramalswasthya.org/? video.recording.path=/srv/recordings captcha.secret-key= diff --git a/src/main/java/com/iemr/common/controller/videocall/VideoCallController.java b/src/main/java/com/iemr/common/controller/videocall/VideoCallController.java index 8eb2a3ad..fdbd9575 100644 --- a/src/main/java/com/iemr/common/controller/videocall/VideoCallController.java +++ b/src/main/java/com/iemr/common/controller/videocall/VideoCallController.java @@ -1,3 +1,25 @@ +/* +* AMRIT – Accessible Medical Records via Integrated Technology +* Integrated EHR (Electronic Health Records) Solution +* +* Copyright (C) "Piramal Swasthya Management and Research Institute" +* +* This file is part of AMRIT. +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see https://www.gnu.org/licenses/. +*/ + package com.iemr.common.controller.videocall; import java.util.HashMap; @@ -10,7 +32,6 @@ import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -19,7 +40,6 @@ import com.iemr.common.model.videocall.VideoCallRequest; import com.iemr.common.service.videocall.VideoCallService; import com.iemr.common.utils.response.OutputResponse; -import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import jakarta.servlet.http.HttpServletRequest; diff --git a/src/main/java/com/iemr/common/data/videocall/VideoCallParameters.java b/src/main/java/com/iemr/common/data/videocall/VideoCallParameters.java index c9df2d87..48a7b8ae 100644 --- a/src/main/java/com/iemr/common/data/videocall/VideoCallParameters.java +++ b/src/main/java/com/iemr/common/data/videocall/VideoCallParameters.java @@ -1,3 +1,25 @@ +/* +* AMRIT – Accessible Medical Records via Integrated Technology +* Integrated EHR (Electronic Health Records) Solution +* +* Copyright (C) "Piramal Swasthya Management and Research Institute" +* +* This file is part of AMRIT. +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see https://www.gnu.org/licenses/. +*/ + package com.iemr.common.data.videocall; import java.sql.Timestamp; diff --git a/src/main/java/com/iemr/common/mapper/videocall/VideoCallMapper.java b/src/main/java/com/iemr/common/mapper/videocall/VideoCallMapper.java index 521d5921..7e9a8f12 100644 --- a/src/main/java/com/iemr/common/mapper/videocall/VideoCallMapper.java +++ b/src/main/java/com/iemr/common/mapper/videocall/VideoCallMapper.java @@ -1,8 +1,29 @@ +/* +* AMRIT – Accessible Medical Records via Integrated Technology +* Integrated EHR (Electronic Health Records) Solution +* +* Copyright (C) "Piramal Swasthya Management and Research Institute" +* +* This file is part of AMRIT. +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see https://www.gnu.org/licenses/. +*/ + package com.iemr.common.mapper.videocall; import java.util.List; import org.mapstruct.Mapper; -import org.mapstruct.factory.Mappers; import org.mapstruct.IterableMapping; import org.mapstruct.factory.Mappers; diff --git a/src/main/java/com/iemr/common/model/videocall/UpdateCallRequest.java b/src/main/java/com/iemr/common/model/videocall/UpdateCallRequest.java index 343198b3..681d4b63 100644 --- a/src/main/java/com/iemr/common/model/videocall/UpdateCallRequest.java +++ b/src/main/java/com/iemr/common/model/videocall/UpdateCallRequest.java @@ -1,3 +1,25 @@ +/* +* AMRIT – Accessible Medical Records via Integrated Technology +* Integrated EHR (Electronic Health Records) Solution +* +* Copyright (C) "Piramal Swasthya Management and Research Institute" +* +* This file is part of AMRIT. +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see https://www.gnu.org/licenses/. +*/ + package com.iemr.common.model.videocall; import lombok.Data; diff --git a/src/main/java/com/iemr/common/model/videocall/UpdateCallResponse.java b/src/main/java/com/iemr/common/model/videocall/UpdateCallResponse.java index f01f46f5..44c01215 100644 --- a/src/main/java/com/iemr/common/model/videocall/UpdateCallResponse.java +++ b/src/main/java/com/iemr/common/model/videocall/UpdateCallResponse.java @@ -1,3 +1,25 @@ +/* +* AMRIT – Accessible Medical Records via Integrated Technology +* Integrated EHR (Electronic Health Records) Solution +* +* Copyright (C) "Piramal Swasthya Management and Research Institute" +* +* This file is part of AMRIT. +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see https://www.gnu.org/licenses/. +*/ + package com.iemr.common.model.videocall; import java.sql.Timestamp; diff --git a/src/main/java/com/iemr/common/model/videocall/VideoCallRequest.java b/src/main/java/com/iemr/common/model/videocall/VideoCallRequest.java index d8a61eee..64abc044 100644 --- a/src/main/java/com/iemr/common/model/videocall/VideoCallRequest.java +++ b/src/main/java/com/iemr/common/model/videocall/VideoCallRequest.java @@ -1,3 +1,25 @@ +/* +* AMRIT – Accessible Medical Records via Integrated Technology +* Integrated EHR (Electronic Health Records) Solution +* +* Copyright (C) "Piramal Swasthya Management and Research Institute" +* +* This file is part of AMRIT. +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see https://www.gnu.org/licenses/. +*/ + package com.iemr.common.model.videocall; import com.fasterxml.jackson.annotation.JsonFormat; diff --git a/src/main/java/com/iemr/common/repository/videocall/VideoCallParameterRepository.java b/src/main/java/com/iemr/common/repository/videocall/VideoCallParameterRepository.java index 251b877a..99798da2 100644 --- a/src/main/java/com/iemr/common/repository/videocall/VideoCallParameterRepository.java +++ b/src/main/java/com/iemr/common/repository/videocall/VideoCallParameterRepository.java @@ -1,3 +1,25 @@ +/* +* AMRIT – Accessible Medical Records via Integrated Technology +* Integrated EHR (Electronic Health Records) Solution +* +* Copyright (C) "Piramal Swasthya Management and Research Institute" +* +* This file is part of AMRIT. +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see https://www.gnu.org/licenses/. +*/ + package com.iemr.common.repository.videocall; import java.util.List; diff --git a/src/main/java/com/iemr/common/service/videocall/VideoCallService.java b/src/main/java/com/iemr/common/service/videocall/VideoCallService.java index 9322050b..dd457688 100644 --- a/src/main/java/com/iemr/common/service/videocall/VideoCallService.java +++ b/src/main/java/com/iemr/common/service/videocall/VideoCallService.java @@ -1,5 +1,27 @@ +/* +* AMRIT – Accessible Medical Records via Integrated Technology +* Integrated EHR (Electronic Health Records) Solution +* +* Copyright (C) "Piramal Swasthya Management and Research Institute" +* +* This file is part of AMRIT. +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see https://www.gnu.org/licenses/. +*/ + package com.iemr.common.service.videocall; -import com.iemr.common.utils.response.OutputResponse; + import com.iemr.common.model.videocall.UpdateCallRequest; import com.iemr.common.model.videocall.VideoCallRequest; diff --git a/src/main/java/com/iemr/common/service/videocall/VideoCallServiceImpl.java b/src/main/java/com/iemr/common/service/videocall/VideoCallServiceImpl.java index 9db1a771..8b61d525 100644 --- a/src/main/java/com/iemr/common/service/videocall/VideoCallServiceImpl.java +++ b/src/main/java/com/iemr/common/service/videocall/VideoCallServiceImpl.java @@ -1,3 +1,25 @@ +/* +* AMRIT – Accessible Medical Records via Integrated Technology +* Integrated EHR (Electronic Health Records) Solution +* +* Copyright (C) "Piramal Swasthya Management and Research Institute" +* +* This file is part of AMRIT. +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see https://www.gnu.org/licenses/. +*/ + package com.iemr.common.service.videocall; import org.apache.commons.lang.RandomStringUtils; @@ -36,14 +58,14 @@ public class VideoCallServiceImpl implements VideoCallService { private String meetingLink; private boolean isLinkSent = false; - private String consultationStatus = "Not Initiated"; - @Value("${video-call-url}") + @Value("${videocall.url}") private String jitsiLink; public VideoCallServiceImpl() { - // this.jitsiLink = ConfigProperties.getPropertyByName("video-call-url"); - // logger.info("Jitsi Link fetched: " + this.jitsiLink); + // Default constructor + this.meetingLink = null; + this.isLinkSent = false; } @Override @@ -99,10 +121,7 @@ public String updateCallStatus(UpdateCallRequest callRequest) throws Exception { if (updateCount > 0) { videoCall.setLinkUsed(true); videoCallRepository.save(videoCall); - - // if ("Completed".equalsIgnoreCase(requestEntity.getCallStatus())) { - // saveRecordingFile(videoCall.getMeetingLink()); - // } + } else { throw new Exception("Failed to update the call status"); } @@ -110,28 +129,6 @@ public String updateCallStatus(UpdateCallRequest callRequest) throws Exception { return OutputMapper.gsonWithoutExposeRestriction() .toJson(videoCallMapper.videoCallToResponse(videoCall)); } -private void saveRecordingFile(String meetingLink) { - try { - // Configurable Jibri recording location - String jibriOutputDir = ConfigProperties.getPropertyByName("jibri.output.path"); // e.g., /srv/jibri/recordings - String saveDir = ConfigProperties.getPropertyByName("video.recording.path"); // e.g., /srv/recordings - - File jibriDir = new File(jibriOutputDir); - File[] matchingFiles = jibriDir.listFiles((dir, name) -> name.contains(meetingLink) && name.endsWith(".mp4")); - - if (matchingFiles != null && matchingFiles.length > 0) { - File recording = matchingFiles[0]; - Path targetPath = Paths.get(saveDir, meetingLink + ".mp4"); - - Files.copy(recording.toPath(), targetPath, StandardCopyOption.REPLACE_EXISTING); - logger.info("Recording file saved: " + targetPath); - } else { - logger.warn("No matching recording file found for meeting: " + meetingLink); - } - } catch (IOException e) { - logger.error("Error saving recording file: ", e); - } -} } From 114dee96205521604638b7589615bb3f22d3fd80 Mon Sep 17 00:00:00 2001 From: vanitha1822 Date: Tue, 24 Mar 2026 14:43:58 +0530 Subject: [PATCH 02/10] fix: pom version update --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 11ad9f37..7e7b29d8 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.iemr.common-API common-api - 3.6.0 + 3.7.0 war Common-API From 8e9a650515cba30bdd1ea0276bd102a22d65acc9 Mon Sep 17 00:00:00 2001 From: vanitha1822 Date: Mon, 30 Mar 2026 12:15:31 +0530 Subject: [PATCH 03/10] fix: add cti-server-ip --- src/main/java/com/iemr/common/service/cti/CTIServiceImpl.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/com/iemr/common/service/cti/CTIServiceImpl.java b/src/main/java/com/iemr/common/service/cti/CTIServiceImpl.java index 81d8953a..fccf54f5 100644 --- a/src/main/java/com/iemr/common/service/cti/CTIServiceImpl.java +++ b/src/main/java/com/iemr/common/service/cti/CTIServiceImpl.java @@ -26,6 +26,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; @@ -96,6 +97,9 @@ public class CTIServiceImpl implements CTIService { @Autowired private IEMRCalltypeRepositoryImplCustom iemrCalltypeRepositoryImplCustom; + @Value("${cti-server-ip}") + private String ctiServerIp; + public CTIServiceImpl() { if (httpUtils == null) { httpUtils = new HttpUtils(); From dfa00ac2906ceaddf0ad1394f6530d960a3c7169 Mon Sep 17 00:00:00 2001 From: vanitha1822 Date: Mon, 30 Mar 2026 13:24:24 +0530 Subject: [PATCH 04/10] fix: comment unwanted code --- .../common/service/cti/CTIServiceImpl.java | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/main/java/com/iemr/common/service/cti/CTIServiceImpl.java b/src/main/java/com/iemr/common/service/cti/CTIServiceImpl.java index fccf54f5..7e5de8e9 100644 --- a/src/main/java/com/iemr/common/service/cti/CTIServiceImpl.java +++ b/src/main/java/com/iemr/common/service/cti/CTIServiceImpl.java @@ -98,7 +98,7 @@ public class CTIServiceImpl implements CTIService { private IEMRCalltypeRepositoryImplCustom iemrCalltypeRepositoryImplCustom; @Value("${cti-server-ip}") - private String ctiServerIp; + private String serverURL; public CTIServiceImpl() { if (httpUtils == null) { @@ -118,7 +118,7 @@ public OutputResponse addUpdateAgentSkills(String request, String ipAddress) thr ObjectMapper objectMapper = new ObjectMapper(); logger.debug("addUpdateAgentSkills input is " + request); String ctiURI = ConfigProperties.getPropertyByName("add-update-agent-skills-URL"); - String serverURL = ConfigProperties.getPropertyByName("cti-server-ip"); + // String serverURL = ConfigProperties.getPropertyByName("cti-server-ip"); AgentSkills agentSkills = objectMapper.readValue(request, AgentSkills.class); String agentID = (agentSkills.getAgentID() != null) ? agentSkills.getAgentID() : ""; @@ -150,7 +150,7 @@ public OutputResponse getCampaignSkills(String request, String ipAddress) throws OutputResponse output = new OutputResponse(); ObjectMapper objectMapper = new ObjectMapper(); String ctiURI = ConfigProperties.getPropertyByName("get-campaign-skills-URL"); - String serverURL = ConfigProperties.getPropertyByName("cti-server-ip"); + // String serverURL = ConfigProperties.getPropertyByName("cti-server-ip"); CampaignSkills agentState = objectMapper.readValue(request, CampaignSkills.class); ctiURI = ctiURI.replace("CTI_SERVER", serverURL); ctiURI = ctiURI.replace("CAMPAIGN_NAME", @@ -177,7 +177,7 @@ public OutputResponse getAgentState(String request, String ipAddress) throws IEM OutputResponse output = new OutputResponse(); ObjectMapper objectMapper = new ObjectMapper(); String ctiURI = ConfigProperties.getPropertyByName("get-agent-status-URL"); - String serverURL = ConfigProperties.getPropertyByName("cti-server-ip"); + // String serverURL = ConfigProperties.getPropertyByName("cti-server-ip"); AgentState agentState = objectMapper.readValue(request, AgentState.class); String agentID = (agentState.getAgent_id() != null) ? agentState.getAgent_id() : ""; @@ -207,7 +207,7 @@ public OutputResponse getAgentCallStats(String request, String ipAddress) throws OutputResponse output = new OutputResponse(); ObjectMapper objectMapper = new ObjectMapper(); String ctiURI = ConfigProperties.getPropertyByName("get-agent-call-stats-URL"); - String serverURL = ConfigProperties.getPropertyByName("cti-server-ip"); + // String serverURL = ConfigProperties.getPropertyByName("cti-server-ip"); AgentCallStats agentState = objectMapper.readValue(request, AgentCallStats.class); String agentID = (agentState.getAgentID() != null) ? agentState.getAgentID() : ""; @@ -239,7 +239,7 @@ public OutputResponse getCampaignNames(String request, String ipAddress) throws OutputResponse output = new OutputResponse(); ObjectMapper objectMapper = new ObjectMapper(); String ctiURI = ConfigProperties.getPropertyByName("get-campaign-name-URL"); - String serverURL = ConfigProperties.getPropertyByName("cti-server-ip"); + // String serverURL = ConfigProperties.getPropertyByName("cti-server-ip"); CampaignNames agentState = objectMapper.readValue(request, CampaignNames.class); ctiURI = ctiURI.replace("CTI_SERVER", serverURL); ctiURI = ctiURI.replace("SEARCH_KEY", (agentState.getServiceName() != null) ? agentState.getServiceName() : ""); @@ -266,7 +266,7 @@ public OutputResponse doAgentLogin(String request, String ipAddress) throws IEMR OutputResponse output = new OutputResponse(); ObjectMapper objectMapper = new ObjectMapper(); String ctiURI = ConfigProperties.getPropertyByName("do-agent-login-URL"); - String serverURL = ConfigProperties.getPropertyByName("cti-server-ip"); + // String serverURL = ConfigProperties.getPropertyByName("cti-server-ip"); AgentState agentState = objectMapper.readValue(request, AgentState.class); String agentID = (agentState.getAgent_id() != null) ? agentState.getAgent_id() : ""; @@ -296,7 +296,7 @@ public OutputResponse getLoginKey(String request, String ipAddress) throws IEMRE OutputResponse output = new OutputResponse(); ObjectMapper objectMapper = new ObjectMapper(); String ctiURI = ConfigProperties.getPropertyByName("get-login-key-URL"); - String serverURL = ConfigProperties.getPropertyByName("cti-server-ip"); + // String serverURL = ConfigProperties.getPropertyByName("cti-server-ip"); AgentLoginKey agentState = objectMapper.readValue(request, AgentLoginKey.class); String decryptPassword = null; @@ -329,7 +329,7 @@ public OutputResponse agentLogout(String request, String ipAddress) throws IEMRE OutputResponse output = new OutputResponse(); ObjectMapper objectMapper = new ObjectMapper(); String ctiURI = ConfigProperties.getPropertyByName("do-agent-logout-URL"); - String serverURL = ConfigProperties.getPropertyByName("cti-server-ip"); + // String serverURL = ConfigProperties.getPropertyByName("cti-server-ip"); AgentState agentState = objectMapper.readValue(request, AgentState.class); String agentID = (agentState.getAgent_id() != null) ? agentState.getAgent_id() : ""; @@ -361,7 +361,7 @@ public OutputResponse getOnlineAgents(String request, String ipAddress) throws I OutputResponse output = new OutputResponse(); ObjectMapper objectMapper = new ObjectMapper(); String ctiURI = ConfigProperties.getPropertyByName("do-online-agent-URL"); - String serverURL = ConfigProperties.getPropertyByName("cti-server-ip"); + // String serverURL = ConfigProperties.getPropertyByName("cti-server-ip"); AgentState agentState = objectMapper.readValue(request, AgentState.class); String agentID = (agentState.getAgent_id() != null) ? agentState.getAgent_id() : ""; @@ -392,7 +392,7 @@ public OutputResponse callBeneficiary(String request, String ipAddress) throws I OutputResponse output = new OutputResponse(); ObjectMapper objectMapper = new ObjectMapper(); String ctiURI = ConfigProperties.getPropertyByName("call-beneficiary-URL"); - String serverURL = ConfigProperties.getPropertyByName("cti-server-ip"); + // String serverURL = ConfigProperties.getPropertyByName("cti-server-ip"); CallBeneficiary agentState = objectMapper.readValue(request, CallBeneficiary.class); String agentID = (agentState.getAgent_id() != null) ? agentState.getAgent_id() : ""; @@ -433,7 +433,7 @@ public OutputResponse addUpdateUserData(String request, String ipAddress) throws * SESSION_TIMEOUT&designation=DESIGNATION&resFormat=3 */ - String serverURL = ConfigProperties.getPropertyByName("cti-server-ip"); + // String serverURL = ConfigProperties.getPropertyByName("cti-server-ip"); CTIUser ctiUser = objectMapper.readValue(request, CTIUser.class); ctiURI = ctiURI.replace("CTI_SERVER", serverURL); ctiURI = ctiURI.replace("USERNAME", (ctiUser.getUsername() != null) ? ctiUser.getUsername() : ""); @@ -465,7 +465,7 @@ public OutputResponse getTransferCampaigns(String request, String ipAddress) thr OutputResponse output = new OutputResponse(); ObjectMapper objectMapper = new ObjectMapper(); String ctiURI = ConfigProperties.getPropertyByName("fetch-transferrable-campaigns-URL"); - String serverURL = ConfigProperties.getPropertyByName("cti-server-ip"); + // String serverURL = ConfigProperties.getPropertyByName("cti-server-ip"); CTICampaigns agentState = objectMapper.readValue(request, CTICampaigns.class); String agentID = (agentState.getAgent_id() != null) ? agentState.getAgent_id() : ""; @@ -497,7 +497,7 @@ public OutputResponse getCampaignRoles(String request, String remoteAddr) throws OutputResponse output = new OutputResponse(); ObjectMapper objectMapper = new ObjectMapper(); String ctiURI = ConfigProperties.getPropertyByName("get-campaign-roles-URL"); - String serverURL = ConfigProperties.getPropertyByName("cti-server-ip"); + // String serverURL = ConfigProperties.getPropertyByName("cti-server-ip"); CampaignRole campaign = objectMapper.readValue(request, CampaignRole.class); ctiURI = ctiURI.replace("CTI_SERVER", serverURL); ctiURI = ctiURI.replace("CAMPAIGN_NAME", (campaign.getCampaign() != null) ? campaign.getCampaign() : ""); @@ -529,7 +529,7 @@ public OutputResponse setCallDisposition(String request, String remoteAddr) thro String agentIP = !agentIPResp.equals(DEFAULT_IP) ? agentIPResp : remoteAddr; String ctiURI = ConfigProperties.getPropertyByName("update-call-disposition-URL"); - String serverURL = ConfigProperties.getPropertyByName("cti-server-ip"); + // String serverURL = ConfigProperties.getPropertyByName("cti-server-ip"); ctiURI = ctiURI.replace("CTI_SERVER", serverURL); ctiURI = ctiURI.replace("AGENT_ID", agentID); ctiURI = ctiURI.replace("AGENT_IP", agentIP); @@ -557,7 +557,7 @@ public OutputResponse createVoiceFile(String request, String remoteAddr) throws ObjectMapper objectMapper = new ObjectMapper(); CTIVoiceFile disposition = objectMapper.readValue(request, CTIVoiceFile.class); String ctiURI = ConfigProperties.getPropertyByName("mix-voice-file-URL"); - String serverURL = ConfigProperties.getPropertyByName("cti-server-ip"); + // String serverURL = ConfigProperties.getPropertyByName("cti-server-ip"); ctiURI = ctiURI.replace("CTI_SERVER", serverURL); ctiURI = ctiURI.replace("AGENT_ID", (disposition.getAgent_id() != null) ? disposition.getAgent_id() : ""); // ctiURI = ctiURI.replace("AGENT_IP", remoteAddr); @@ -582,7 +582,7 @@ public OutputResponse getVoiceFile(String request, String remoteAddr) throws IEM ObjectMapper objectMapper = new ObjectMapper(); CTIVoiceFile disposition = objectMapper.readValue(request, CTIVoiceFile.class); String ctiURI = ConfigProperties.getPropertyByName("get-voice-file-URL"); - String serverURL = ConfigProperties.getPropertyByName("cti-server-ip"); + // String serverURL = ConfigProperties.getPropertyByName("cti-server-ip"); ctiURI = ctiURI.replace("CTI_SERVER", serverURL); ctiURI = ctiURI.replace("AGENT_ID", (disposition.getAgent_id() != null) ? disposition.getAgent_id() : ""); // ctiURI = ctiURI.replace("AGENT_IP", remoteAddr); @@ -608,7 +608,7 @@ public OutputResponse getVoiceFileNew(String request, String remoteAddr) throws OutputResponse output = new OutputResponse(); CTIVoiceFile disposition = InputMapper.gson().fromJson(request, CTIVoiceFile.class); String ctiURI = ConfigProperties.getPropertyByName("get-voice-file-URL-New"); - String serverURL = ConfigProperties.getPropertyByName("cti-server-ip"); + // String serverURL = ConfigProperties.getPropertyByName("cti-server-ip"); ctiURI = ctiURI.replace("CTI_SERVER", serverURL); ctiURI = ctiURI.replace("AGENT_ID", (disposition.getAgent_id() != null) ? disposition.getAgent_id() : ""); // ctiURI = ctiURI.replace("AGENT_IP", remoteAddr); @@ -975,7 +975,7 @@ public OutputResponse addAutoDialNumbers(String request, String ipAddress) throw OutputResponse result = new OutputResponse(); logger.debug("addUpdateAgentSkills input is " + request); String ctiURI = ConfigProperties.getPropertyByName("add-auto-dail-numbers-URL"); - String serverURL = ConfigProperties.getPropertyByName("cti-server-ip"); + // String serverURL = ConfigProperties.getPropertyByName("cti-server-ip"); ObjectMapper objectMapper = new ObjectMapper(); AutoPreviewDial[] autoPreviewDialArray = objectMapper.readValue(request, AutoPreviewDial[].class); @@ -1016,7 +1016,7 @@ public OutputResponse setAutoDialNumbers(String request, String ipAddress) throw OutputResponse result = new OutputResponse(); logger.debug("setAutoDialNumbers input is " + request); String ctiURI = ConfigProperties.getPropertyByName("set-auto-dail-numbers-URL"); - String serverURL = ConfigProperties.getPropertyByName("cti-server-ip"); + // String serverURL = ConfigProperties.getPropertyByName("cti-server-ip"); ObjectMapper objectMapper = new ObjectMapper(); AutoPreviewDial autoPreviewDial = objectMapper.readValue(request, AutoPreviewDial.class); @@ -1059,7 +1059,7 @@ public OutputResponse getIVRSPathDetails(String request, String remoteAddress) t OutputResponse result = new OutputResponse(); logger.debug("getZoneDetails input is " + request); String ctiURI = ConfigProperties.getPropertyByName("agent-ivrs-path-URL"); - String serverURL = ConfigProperties.getPropertyByName("cti-server-ip"); + // String serverURL = ConfigProperties.getPropertyByName("cti-server-ip"); ObjectMapper objectMapper = new ObjectMapper(); AgentState zoneData = objectMapper.readValue(request, AgentState.class); From 9f379fb14a8c83231d19fc429e35a777f977cf11 Mon Sep 17 00:00:00 2001 From: vanitha1822 Date: Mon, 30 Mar 2026 14:31:34 +0530 Subject: [PATCH 05/10] fix: update videocall url property --- src/main/environment/common_docker.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/environment/common_docker.properties b/src/main/environment/common_docker.properties index a81ea62e..12408a9a 100644 --- a/src/main/environment/common_docker.properties +++ b/src/main/environment/common_docker.properties @@ -192,7 +192,7 @@ firebase.enabled=${FIREBASE_ENABLE} firebase.credential-file=${FIREBASE_CREDENTIAL} -video-call-url=${VIDEO_CALL_URL} +videocall.url=${VIDEO_CALL_URL} jibri.output.path={JIBRI_OUTPUT_PATH} video.recording.path={VIDEO_RECORDING_PATH} From f0a1177a3c630a129a6d1f7075aeec50e5db3d13 Mon Sep 17 00:00:00 2001 From: vanitha1822 Date: Mon, 30 Mar 2026 15:53:01 +0530 Subject: [PATCH 06/10] fix: update cti-server-ip --- .../service/nhm_dashboard/NHM_DashboardServiceImpl.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/iemr/common/service/nhm_dashboard/NHM_DashboardServiceImpl.java b/src/main/java/com/iemr/common/service/nhm_dashboard/NHM_DashboardServiceImpl.java index 4448cc07..d7afd579 100644 --- a/src/main/java/com/iemr/common/service/nhm_dashboard/NHM_DashboardServiceImpl.java +++ b/src/main/java/com/iemr/common/service/nhm_dashboard/NHM_DashboardServiceImpl.java @@ -32,6 +32,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import com.google.gson.Gson; @@ -61,6 +62,9 @@ public class NHM_DashboardServiceImpl implements NHM_DashboardService { @Autowired private DetailedCallReportRepo detailedCallReportRepo; + @Value("${cti-server-ip}") + private String serverURL; + public String pushAbandonCalls(AbandonCallSummary abandonCallSummary) throws Exception { logger.info("NHM_abandon call push API request : " + abandonCallSummary.toString()); @@ -227,7 +231,7 @@ public List callAgentSummaryReportCTI_API() throws IEMRExcep // throw new IEMRException("Please pass correct period for schedular - in hours"); String ctiURI = ConfigProperties.getPropertyByName("get-agent-summary-report-URL"); - String serverURL = ConfigProperties.getPropertyByName("cti-server-ip"); + // String serverURL = ConfigProperties.getPropertyByName("cti-server-ip"); ctiURI = ctiURI.replace("CTI_SERVER", serverURL); ctiURI = ctiURI.replace("END_DATE", endDate); ctiURI = ctiURI.replace("START_DATE", fromDate); @@ -272,7 +276,7 @@ public List callDetailedCallReportCTI_API() throws IEMRExcep // throw new IEMRException("Please pass correct period for schedular - in hours"); String ctiURI = ConfigProperties.getPropertyByName("get-details-call-report-URL"); - String serverURL = ConfigProperties.getPropertyByName("cti-server-ip"); + // String serverURL = ConfigProperties.getPropertyByName("cti-server-ip"); ctiURI = ctiURI.replace("CTI_SERVER", serverURL); ctiURI = ctiURI.replace("END_DATE", endDate); ctiURI = ctiURI.replace("START_DATE", fromDate); From 4b5d2500e1756350cf1712e2ee134c5243fdc03c Mon Sep 17 00:00:00 2001 From: vanitha1822 Date: Tue, 31 Mar 2026 16:26:26 +0530 Subject: [PATCH 07/10] fix: KM issue --- .../utils/km/openkm/OpenKMServiceImpl.java | 53 ++++++++++--------- 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/src/main/java/com/iemr/common/utils/km/openkm/OpenKMServiceImpl.java b/src/main/java/com/iemr/common/utils/km/openkm/OpenKMServiceImpl.java index 2be04cfc..acb47e6f 100644 --- a/src/main/java/com/iemr/common/utils/km/openkm/OpenKMServiceImpl.java +++ b/src/main/java/com/iemr/common/utils/km/openkm/OpenKMServiceImpl.java @@ -51,38 +51,43 @@ import org.glassfish.jersey.client.JerseyClientBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +@Service public class OpenKMServiceImpl implements KMService { - // private ConfigProperties configProperties; - // - // @Autowired - // public void setConfigProperties(ConfigProperties configProperties) - // { - // this.configProperties = configProperties; - // } + private final Logger logger = LoggerFactory.getLogger(this.getClass().getName()); - private static String url; - private static String username; - private static String password; - private static String kmRootPath; - private static String guestUser; - private static String guestPassword; + + @Value("${km-base-url}") + private String url; + + @Value("${km-username}") + private String username; + + @Value("${km-password}") + private String password; + + @Value("${km-root-path}") + private String kmRootPath; + + @Value("${km-guest-user}") + private String guestUser; + + @Value("${km-guest-password}") + private String guestPassword; public OpenKMServiceImpl() { } - private static OKMWebservices connector = null; + private OKMWebservices connector; + @PostConstruct public void init() { - if (connector == null) { - url = ConfigProperties.getPropertyByName("km-base-url"); - username = ConfigProperties.getPropertyByName("km-username"); - password = ConfigProperties.getPropertyByName("km-password"); - kmRootPath = ConfigProperties.getPropertyByName("km-root-path"); - guestUser = ConfigProperties.getPropertyByName("km-guest-user"); - guestPassword = ConfigProperties.getPropertyByName("km-guest-password"); - connector = OpenKMConnector.initialize(url, username, password); - - } + logger.info("KM URL: " + url); + logger.info("KM Username: " + username); + + connector = OpenKMConnector.initialize(url, username, password); + } @Override From e1c84e8d24d8ef918afc2e419e4e00c71c0574fd Mon Sep 17 00:00:00 2001 From: vanitha1822 Date: Tue, 31 Mar 2026 16:29:47 +0530 Subject: [PATCH 08/10] fix: KM issue --- .../java/com/iemr/common/utils/km/openkm/OpenKMServiceImpl.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/iemr/common/utils/km/openkm/OpenKMServiceImpl.java b/src/main/java/com/iemr/common/utils/km/openkm/OpenKMServiceImpl.java index acb47e6f..29c2717a 100644 --- a/src/main/java/com/iemr/common/utils/km/openkm/OpenKMServiceImpl.java +++ b/src/main/java/com/iemr/common/utils/km/openkm/OpenKMServiceImpl.java @@ -46,6 +46,8 @@ import com.openkm.sdk4j.exception.VirusDetectedException; import com.openkm.sdk4j.exception.WebserviceException; +import jakarta.annotation.PostConstruct; + import org.glassfish.jersey.client.ClientConfig; import org.glassfish.jersey.client.ClientProperties; import org.glassfish.jersey.client.JerseyClientBuilder; From cd61d46b0137696945f1c2bbea566eb8c313bdcd Mon Sep 17 00:00:00 2001 From: vanitha1822 Date: Tue, 31 Mar 2026 16:45:34 +0530 Subject: [PATCH 09/10] fix: remove unwanted imports --- .../iemr/common/utils/km/openkm/OpenKMServiceImpl.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/iemr/common/utils/km/openkm/OpenKMServiceImpl.java b/src/main/java/com/iemr/common/utils/km/openkm/OpenKMServiceImpl.java index 29c2717a..d004243d 100644 --- a/src/main/java/com/iemr/common/utils/km/openkm/OpenKMServiceImpl.java +++ b/src/main/java/com/iemr/common/utils/km/openkm/OpenKMServiceImpl.java @@ -48,14 +48,13 @@ import jakarta.annotation.PostConstruct; -import org.glassfish.jersey.client.ClientConfig; -import org.glassfish.jersey.client.ClientProperties; -import org.glassfish.jersey.client.JerseyClientBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -@Service +// import org.springframework.context.annotation.Primary; +// import org.springframework.stereotype.Service; +// @Service +// @Primary public class OpenKMServiceImpl implements KMService { private final Logger logger = LoggerFactory.getLogger(this.getClass().getName()); From 92d49ad2515d76f0465fd706f58300360e8572bf Mon Sep 17 00:00:00 2001 From: vanitha1822 Date: Tue, 31 Mar 2026 16:50:42 +0530 Subject: [PATCH 10/10] fix: conflicts --- .../java/com/iemr/common/utils/IEMRApplBeans.java | 12 ++++++------ .../common/utils/km/openkm/OpenKMServiceImpl.java | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/iemr/common/utils/IEMRApplBeans.java b/src/main/java/com/iemr/common/utils/IEMRApplBeans.java index 92d3c339..7747f6ee 100644 --- a/src/main/java/com/iemr/common/utils/IEMRApplBeans.java +++ b/src/main/java/com/iemr/common/utils/IEMRApplBeans.java @@ -40,12 +40,12 @@ @Configuration public class IEMRApplBeans { - @Bean - public KMService getOpenKMService() - { - KMService kmService = new OpenKMServiceImpl(); - return kmService; - } + // @Bean + // public KMService getOpenKMService() + // { + // KMService kmService = new OpenKMServiceImpl(); + // return kmService; + // } @Bean public Validator getVaidator() diff --git a/src/main/java/com/iemr/common/utils/km/openkm/OpenKMServiceImpl.java b/src/main/java/com/iemr/common/utils/km/openkm/OpenKMServiceImpl.java index d004243d..dd304a64 100644 --- a/src/main/java/com/iemr/common/utils/km/openkm/OpenKMServiceImpl.java +++ b/src/main/java/com/iemr/common/utils/km/openkm/OpenKMServiceImpl.java @@ -51,9 +51,9 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; -// import org.springframework.context.annotation.Primary; -// import org.springframework.stereotype.Service; -// @Service +import org.springframework.context.annotation.Primary; +import org.springframework.stereotype.Service; +@Service // @Primary public class OpenKMServiceImpl implements KMService {