Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 46 additions & 21 deletions src/main/java/com/iemr/common/service/cti/CTIServiceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -90,6 +91,9 @@
@Autowired
private CTIService ctiService;

@Value("${cti-server-ip}")
private String serverURL;

@Autowired
private IEMRCalltypeRepositoryImplCustom iemrCalltypeRepositoryImplCustom;

Expand All @@ -111,7 +115,8 @@
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");

Check warning on line 118 in src/main/java/com/iemr/common/service/cti/CTIServiceImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This block of commented-out lines of code should be removed.

See more on https://sonarcloud.io/project/issues?id=PSMRI_Common-API&issues=AZzcK0-ygqnL18ZdhpO4&open=AZzcK0-ygqnL18ZdhpO4&pullRequest=369

AgentSkills agentSkills = objectMapper.readValue(request, AgentSkills.class);

String agentID = (agentSkills.getAgentID() != null) ? agentSkills.getAgentID() : "";
Expand Down Expand Up @@ -143,7 +148,8 @@
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");

Check warning on line 151 in src/main/java/com/iemr/common/service/cti/CTIServiceImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This block of commented-out lines of code should be removed.

See more on https://sonarcloud.io/project/issues?id=PSMRI_Common-API&issues=AZzcK0-ygqnL18ZdhpO5&open=AZzcK0-ygqnL18ZdhpO5&pullRequest=369

CampaignSkills agentState = objectMapper.readValue(request, CampaignSkills.class);
ctiURI = ctiURI.replace("CTI_SERVER", serverURL);
ctiURI = ctiURI.replace("CAMPAIGN_NAME",
Expand All @@ -170,7 +176,8 @@
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");

Check warning on line 179 in src/main/java/com/iemr/common/service/cti/CTIServiceImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This block of commented-out lines of code should be removed.

See more on https://sonarcloud.io/project/issues?id=PSMRI_Common-API&issues=AZzcK0-ygqnL18ZdhpO6&open=AZzcK0-ygqnL18ZdhpO6&pullRequest=369

AgentState agentState = objectMapper.readValue(request, AgentState.class);

String agentID = (agentState.getAgent_id() != null) ? agentState.getAgent_id() : "";
Expand Down Expand Up @@ -200,7 +207,8 @@
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");

Check warning on line 210 in src/main/java/com/iemr/common/service/cti/CTIServiceImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This block of commented-out lines of code should be removed.

See more on https://sonarcloud.io/project/issues?id=PSMRI_Common-API&issues=AZzcK0-ygqnL18ZdhpO7&open=AZzcK0-ygqnL18ZdhpO7&pullRequest=369

AgentCallStats agentState = objectMapper.readValue(request, AgentCallStats.class);

String agentID = (agentState.getAgentID() != null) ? agentState.getAgentID() : "";
Expand Down Expand Up @@ -232,7 +240,8 @@
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");

Check warning on line 243 in src/main/java/com/iemr/common/service/cti/CTIServiceImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This block of commented-out lines of code should be removed.

See more on https://sonarcloud.io/project/issues?id=PSMRI_Common-API&issues=AZzcK0-ygqnL18ZdhpO8&open=AZzcK0-ygqnL18ZdhpO8&pullRequest=369

CampaignNames agentState = objectMapper.readValue(request, CampaignNames.class);
ctiURI = ctiURI.replace("CTI_SERVER", serverURL);
ctiURI = ctiURI.replace("SEARCH_KEY", (agentState.getServiceName() != null) ? agentState.getServiceName() : "");
Expand All @@ -259,7 +268,8 @@
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");

Check warning on line 271 in src/main/java/com/iemr/common/service/cti/CTIServiceImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This block of commented-out lines of code should be removed.

See more on https://sonarcloud.io/project/issues?id=PSMRI_Common-API&issues=AZzcK0-ygqnL18ZdhpO9&open=AZzcK0-ygqnL18ZdhpO9&pullRequest=369

AgentState agentState = objectMapper.readValue(request, AgentState.class);

String agentID = (agentState.getAgent_id() != null) ? agentState.getAgent_id() : "";
Expand Down Expand Up @@ -289,7 +299,8 @@
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");

Check warning on line 302 in src/main/java/com/iemr/common/service/cti/CTIServiceImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This block of commented-out lines of code should be removed.

See more on https://sonarcloud.io/project/issues?id=PSMRI_Common-API&issues=AZzcK0-ygqnL18ZdhpO-&open=AZzcK0-ygqnL18ZdhpO-&pullRequest=369

AgentLoginKey agentState = objectMapper.readValue(request, AgentLoginKey.class);

ctiURI = ctiURI.replace("CTI_SERVER", serverURL);
Expand All @@ -315,7 +326,8 @@
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");

Check warning on line 329 in src/main/java/com/iemr/common/service/cti/CTIServiceImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This block of commented-out lines of code should be removed.

See more on https://sonarcloud.io/project/issues?id=PSMRI_Common-API&issues=AZzcK0-ygqnL18ZdhpO_&open=AZzcK0-ygqnL18ZdhpO_&pullRequest=369

AgentState agentState = objectMapper.readValue(request, AgentState.class);

String agentID = (agentState.getAgent_id() != null) ? agentState.getAgent_id() : "";
Expand Down Expand Up @@ -347,7 +359,8 @@
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");

Check warning on line 362 in src/main/java/com/iemr/common/service/cti/CTIServiceImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This block of commented-out lines of code should be removed.

See more on https://sonarcloud.io/project/issues?id=PSMRI_Common-API&issues=AZzcK0-ygqnL18ZdhpPA&open=AZzcK0-ygqnL18ZdhpPA&pullRequest=369

AgentState agentState = objectMapper.readValue(request, AgentState.class);

String agentID = (agentState.getAgent_id() != null) ? agentState.getAgent_id() : "";
Expand Down Expand Up @@ -378,7 +391,8 @@
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");

Check warning on line 394 in src/main/java/com/iemr/common/service/cti/CTIServiceImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This block of commented-out lines of code should be removed.

See more on https://sonarcloud.io/project/issues?id=PSMRI_Common-API&issues=AZzcK0-ygqnL18ZdhpPB&open=AZzcK0-ygqnL18ZdhpPB&pullRequest=369

CallBeneficiary agentState = objectMapper.readValue(request, CallBeneficiary.class);

String agentID = (agentState.getAgent_id() != null) ? agentState.getAgent_id() : "";
Expand Down Expand Up @@ -419,7 +433,8 @@
* SESSION_TIMEOUT&designation=DESIGNATION&resFormat=3
*/

String serverURL = ConfigProperties.getPropertyByName("cti-server-ip");
// String serverURL = ConfigProperties.getPropertyByName("cti-server-ip");

Check warning on line 436 in src/main/java/com/iemr/common/service/cti/CTIServiceImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This block of commented-out lines of code should be removed.

See more on https://sonarcloud.io/project/issues?id=PSMRI_Common-API&issues=AZzcK0-ygqnL18ZdhpPC&open=AZzcK0-ygqnL18ZdhpPC&pullRequest=369

CTIUser ctiUser = objectMapper.readValue(request, CTIUser.class);
ctiURI = ctiURI.replace("CTI_SERVER", serverURL);
ctiURI = ctiURI.replace("USERNAME", (ctiUser.getUsername() != null) ? ctiUser.getUsername() : "");
Expand Down Expand Up @@ -451,7 +466,8 @@
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");

Check warning on line 469 in src/main/java/com/iemr/common/service/cti/CTIServiceImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This block of commented-out lines of code should be removed.

See more on https://sonarcloud.io/project/issues?id=PSMRI_Common-API&issues=AZzcK0-ygqnL18ZdhpPD&open=AZzcK0-ygqnL18ZdhpPD&pullRequest=369

CTICampaigns agentState = objectMapper.readValue(request, CTICampaigns.class);

String agentID = (agentState.getAgent_id() != null) ? agentState.getAgent_id() : "";
Expand Down Expand Up @@ -483,7 +499,8 @@
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");

Check warning on line 502 in src/main/java/com/iemr/common/service/cti/CTIServiceImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This block of commented-out lines of code should be removed.

See more on https://sonarcloud.io/project/issues?id=PSMRI_Common-API&issues=AZzcK0-ygqnL18ZdhpPE&open=AZzcK0-ygqnL18ZdhpPE&pullRequest=369

CampaignRole campaign = objectMapper.readValue(request, CampaignRole.class);
ctiURI = ctiURI.replace("CTI_SERVER", serverURL);
ctiURI = ctiURI.replace("CAMPAIGN_NAME", (campaign.getCampaign() != null) ? campaign.getCampaign() : "");
Expand Down Expand Up @@ -515,7 +532,8 @@
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");

Check warning on line 535 in src/main/java/com/iemr/common/service/cti/CTIServiceImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This block of commented-out lines of code should be removed.

See more on https://sonarcloud.io/project/issues?id=PSMRI_Common-API&issues=AZzcK0-ygqnL18ZdhpPF&open=AZzcK0-ygqnL18ZdhpPF&pullRequest=369

ctiURI = ctiURI.replace("CTI_SERVER", serverURL);
ctiURI = ctiURI.replace("AGENT_ID", agentID);
ctiURI = ctiURI.replace("AGENT_IP", agentIP);
Expand Down Expand Up @@ -543,7 +561,8 @@
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");

Check warning on line 564 in src/main/java/com/iemr/common/service/cti/CTIServiceImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This block of commented-out lines of code should be removed.

See more on https://sonarcloud.io/project/issues?id=PSMRI_Common-API&issues=AZzcK0-ygqnL18ZdhpPG&open=AZzcK0-ygqnL18ZdhpPG&pullRequest=369

ctiURI = ctiURI.replace("CTI_SERVER", serverURL);
ctiURI = ctiURI.replace("AGENT_ID", (disposition.getAgent_id() != null) ? disposition.getAgent_id() : "");
// ctiURI = ctiURI.replace("AGENT_IP", remoteAddr);
Expand All @@ -568,7 +587,8 @@
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");

Check warning on line 590 in src/main/java/com/iemr/common/service/cti/CTIServiceImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This block of commented-out lines of code should be removed.

See more on https://sonarcloud.io/project/issues?id=PSMRI_Common-API&issues=AZzcK0-ygqnL18ZdhpPH&open=AZzcK0-ygqnL18ZdhpPH&pullRequest=369

ctiURI = ctiURI.replace("CTI_SERVER", serverURL);
ctiURI = ctiURI.replace("AGENT_ID", (disposition.getAgent_id() != null) ? disposition.getAgent_id() : "");
// ctiURI = ctiURI.replace("AGENT_IP", remoteAddr);
Expand All @@ -594,7 +614,8 @@
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");

Check warning on line 617 in src/main/java/com/iemr/common/service/cti/CTIServiceImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This block of commented-out lines of code should be removed.

See more on https://sonarcloud.io/project/issues?id=PSMRI_Common-API&issues=AZzcK0-ygqnL18ZdhpPI&open=AZzcK0-ygqnL18ZdhpPI&pullRequest=369

ctiURI = ctiURI.replace("CTI_SERVER", serverURL);
ctiURI = ctiURI.replace("AGENT_ID", (disposition.getAgent_id() != null) ? disposition.getAgent_id() : "");
// ctiURI = ctiURI.replace("AGENT_IP", remoteAddr);
Expand Down Expand Up @@ -963,7 +984,8 @@
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");

Check warning on line 987 in src/main/java/com/iemr/common/service/cti/CTIServiceImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This block of commented-out lines of code should be removed.

See more on https://sonarcloud.io/project/issues?id=PSMRI_Common-API&issues=AZzcK0-ygqnL18ZdhpPJ&open=AZzcK0-ygqnL18ZdhpPJ&pullRequest=369

ObjectMapper objectMapper = new ObjectMapper();
AutoPreviewDial[] autoPreviewDialArray = objectMapper.readValue(request, AutoPreviewDial[].class);

Expand Down Expand Up @@ -1004,7 +1026,8 @@
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");

Check warning on line 1029 in src/main/java/com/iemr/common/service/cti/CTIServiceImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This block of commented-out lines of code should be removed.

See more on https://sonarcloud.io/project/issues?id=PSMRI_Common-API&issues=AZzcK0-ygqnL18ZdhpPK&open=AZzcK0-ygqnL18ZdhpPK&pullRequest=369

ObjectMapper objectMapper = new ObjectMapper();
AutoPreviewDial autoPreviewDial = objectMapper.readValue(request, AutoPreviewDial.class);

Expand Down Expand Up @@ -1047,7 +1070,8 @@
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");

Check warning on line 1073 in src/main/java/com/iemr/common/service/cti/CTIServiceImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This block of commented-out lines of code should be removed.

See more on https://sonarcloud.io/project/issues?id=PSMRI_Common-API&issues=AZzcK0-ygqnL18ZdhpPL&open=AZzcK0-ygqnL18ZdhpPL&pullRequest=369

ObjectMapper objectMapper = new ObjectMapper();
AgentState zoneData = objectMapper.readValue(request, AgentState.class);

Expand Down Expand Up @@ -1083,7 +1107,8 @@
OutputResponse output = new OutputResponse();
ObjectMapper objectMapper = new ObjectMapper();
String ctiURI = ConfigProperties.getPropertyByName("get-disposition-count-URL");
String serverURL = ConfigProperties.getPropertyByName("cti-server-ip");
// // String serverURL = ConfigProperties.getPropertyByName("cti-server-ip");

Check warning on line 1110 in src/main/java/com/iemr/common/service/cti/CTIServiceImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This block of commented-out lines of code should be removed.

See more on https://sonarcloud.io/project/issues?id=PSMRI_Common-API&issues=AZzcK0-ygqnL18ZdhpPM&open=AZzcK0-ygqnL18ZdhpPM&pullRequest=369

DispositionCountRequest dispositionRequest = objectMapper.readValue(request, DispositionCountRequest.class);

ctiURI = ctiURI.replace("CTI_SERVER", serverURL);
Expand Down