Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
*/
package com.iemr.common.controller.cti;


import javax.ws.rs.core.MediaType;

import org.slf4j.Logger;
Expand Down Expand Up @@ -522,4 +521,21 @@
logger.info("getIVRSPathDetails sending response " + response);
return response.toString();
}

@Operation(summary = "Get disposition count for campaign")
@RequestMapping(value = "/getDispositionCount", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON, headers = "Authorization")

Check warning on line 526 in src/main/java/com/iemr/common/controller/cti/ComputerTelephonyIntegrationController.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace "@RequestMapping(method = RequestMethod.POST)" with "@PostMapping"

See more on https://sonarcloud.io/project/issues?id=PSMRI_Common-API&issues=AZ2GlS7Ilqqz0TVQof1u&open=AZ2GlS7Ilqqz0TVQof1u&pullRequest=395
public String getDispositionCount(@RequestBody String request, HttpServletRequest serverRequest) {
OutputResponse response = new OutputResponse();
try {
String remoteAddress = serverRequest.getHeader("X-FORWARDED-FOR");
if (remoteAddress == null || remoteAddress.trim().length() == 0) {

Check warning on line 531 in src/main/java/com/iemr/common/controller/cti/ComputerTelephonyIntegrationController.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use "isEmpty()" to check whether a "String" is empty or not.

See more on https://sonarcloud.io/project/issues?id=PSMRI_Common-API&issues=AZ2GlS7Ilqqz0TVQof1v&open=AZ2GlS7Ilqqz0TVQof1v&pullRequest=395
remoteAddress = serverRequest.getRemoteAddr();
}
response = ctiService.getDispositionCount(request, remoteAddress);
} catch (Exception e) {
logger.error("getDispositionCount failed with error " + e.getMessage(), e);
response.setError(e);
}
return response.toString();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.iemr.common.data.cti;
import lombok.Data;

@Data
public class DispositionCountRequest {
private String transaction_id = "CTI_GET_DISP_COUNT";

Check warning on line 6 in src/main/java/com/iemr/common/data/cti/DispositionCountRequest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this field "transaction_id" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.

See more on https://sonarcloud.io/project/issues?id=PSMRI_Common-API&issues=AZ2GlS6flqqz0TVQof1n&open=AZ2GlS6flqqz0TVQof1n&pullRequest=395
private String campaign_name;

Check warning on line 7 in src/main/java/com/iemr/common/data/cti/DispositionCountRequest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this field "campaign_name" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.

See more on https://sonarcloud.io/project/issues?id=PSMRI_Common-API&issues=AZ2GlS6flqqz0TVQof1o&open=AZ2GlS6flqqz0TVQof1o&pullRequest=395
private String disposition;
private String date;
private String enc_flag;

Check warning on line 10 in src/main/java/com/iemr/common/data/cti/DispositionCountRequest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this field "enc_flag" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.

See more on https://sonarcloud.io/project/issues?id=PSMRI_Common-API&issues=AZ2GlS6flqqz0TVQof1p&open=AZ2GlS6flqqz0TVQof1p&pullRequest=395
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package com.iemr.common.data.cti;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.google.gson.annotations.Expose;
import java.util.List;

@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class DispositionCountResponse {
@Expose
private String status;

@Expose
private Integer code;

@Expose
private String failure_reason;

Check warning on line 17 in src/main/java/com/iemr/common/data/cti/DispositionCountResponse.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this field "failure_reason" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.

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

@Expose
private Object data;

// Inner class for campaign data
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public static class CampaignData {
@Expose
private String campaign_name;

Check warning on line 27 in src/main/java/com/iemr/common/data/cti/DispositionCountResponse.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this field "campaign_name" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.

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

@Expose
private List<DispositionDetail> dispositions;
}

// Inner class for disposition detail
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public static class DispositionDetail {
@Expose
private String call_status_disposition;

Check warning on line 38 in src/main/java/com/iemr/common/data/cti/DispositionCountResponse.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this field "call_status_disposition" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.

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

@Expose
private String disposition_count;

Check warning on line 41 in src/main/java/com/iemr/common/data/cti/DispositionCountResponse.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this field "disposition_count" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.

See more on https://sonarcloud.io/project/issues?id=PSMRI_Common-API&issues=AZ2GlS6nlqqz0TVQof1t&open=AZ2GlS6nlqqz0TVQof1t&pullRequest=395
}
}
2 changes: 2 additions & 0 deletions src/main/java/com/iemr/common/service/cti/CTIService.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,6 @@
OutputResponse getIVRSPathDetails(String request, String remoteAddress)throws Exception;

OutputResponse getVoiceFileNew(String request, String remoteAddr) throws IEMRException, JSONException;

OutputResponse getDispositionCount(String request, String ipAddress) throws IEMRException, JSONException, JsonMappingException, JsonProcessingException;

Check warning on line 98 in src/main/java/com/iemr/common/service/cti/CTIService.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove the declaration of thrown exception 'com.fasterxml.jackson.databind.JsonMappingException' which is a subclass of 'com.fasterxml.jackson.core.JsonProcessingException'.

See more on https://sonarcloud.io/project/issues?id=PSMRI_Common-API&issues=AZ2GlS1alqqz0TVQof1M&open=AZ2GlS1alqqz0TVQof1M&pullRequest=395
}
92 changes: 72 additions & 20 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 All @@ -52,6 +53,8 @@
import com.iemr.common.data.cti.CampaignRole;
import com.iemr.common.data.cti.CampaignSkills;
import com.iemr.common.data.cti.CustomerLanguage;
import com.iemr.common.data.cti.DispositionCountRequest;
import com.iemr.common.data.cti.DispositionCountResponse;
import com.iemr.common.data.cti.TransferCall;
import com.iemr.common.repository.callhandling.BeneficiaryCallRepository;
import com.iemr.common.repository.callhandling.IEMRCalltypeRepositoryImplCustom;
Expand Down Expand Up @@ -93,6 +96,9 @@
@Autowired
private CTIService ctiService;

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

@Autowired
private IEMRCalltypeRepositoryImplCustom iemrCalltypeRepositoryImplCustom;

Expand All @@ -114,7 +120,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 123 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=AZ2GlS6Olqqz0TVQof1P&open=AZ2GlS6Olqqz0TVQof1P&pullRequest=395

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

String agentID = (agentSkills.getAgentID() != null) ? agentSkills.getAgentID() : "";
Expand Down Expand Up @@ -146,7 +153,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 156 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=AZ2GlS6Olqqz0TVQof1Q&open=AZ2GlS6Olqqz0TVQof1Q&pullRequest=395

CampaignSkills agentState = objectMapper.readValue(request, CampaignSkills.class);
ctiURI = ctiURI.replace("CTI_SERVER", serverURL);
ctiURI = ctiURI.replace("CAMPAIGN_NAME",
Expand All @@ -173,7 +181,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 184 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=AZ2GlS6Olqqz0TVQof1R&open=AZ2GlS6Olqqz0TVQof1R&pullRequest=395

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

String agentID = (agentState.getAgent_id() != null) ? agentState.getAgent_id() : "";
Expand Down Expand Up @@ -203,7 +212,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 215 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=AZ2GlS6Olqqz0TVQof1S&open=AZ2GlS6Olqqz0TVQof1S&pullRequest=395

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

String agentID = (agentState.getAgentID() != null) ? agentState.getAgentID() : "";
Expand Down Expand Up @@ -235,7 +245,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 248 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=AZ2GlS6Olqqz0TVQof1T&open=AZ2GlS6Olqqz0TVQof1T&pullRequest=395

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 @@ -262,7 +273,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 276 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=AZ2GlS6Olqqz0TVQof1U&open=AZ2GlS6Olqqz0TVQof1U&pullRequest=395

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

String agentID = (agentState.getAgent_id() != null) ? agentState.getAgent_id() : "";
Expand Down Expand Up @@ -292,7 +304,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 307 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=AZ2GlS6Olqqz0TVQof1V&open=AZ2GlS6Olqqz0TVQof1V&pullRequest=395

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

String decryptPassword = null;
Expand Down Expand Up @@ -325,7 +338,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 341 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=AZ2GlS6Olqqz0TVQof1W&open=AZ2GlS6Olqqz0TVQof1W&pullRequest=395

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

String agentID = (agentState.getAgent_id() != null) ? agentState.getAgent_id() : "";
Expand Down Expand Up @@ -357,7 +371,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 374 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=AZ2GlS6Olqqz0TVQof1X&open=AZ2GlS6Olqqz0TVQof1X&pullRequest=395

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

String agentID = (agentState.getAgent_id() != null) ? agentState.getAgent_id() : "";
Expand Down Expand Up @@ -388,7 +403,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 406 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=AZ2GlS6Olqqz0TVQof1Y&open=AZ2GlS6Olqqz0TVQof1Y&pullRequest=395

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

String agentID = (agentState.getAgent_id() != null) ? agentState.getAgent_id() : "";
Expand Down Expand Up @@ -429,7 +445,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 448 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=AZ2GlS6Olqqz0TVQof1Z&open=AZ2GlS6Olqqz0TVQof1Z&pullRequest=395

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 @@ -461,7 +478,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 481 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=AZ2GlS6Olqqz0TVQof1a&open=AZ2GlS6Olqqz0TVQof1a&pullRequest=395

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

String agentID = (agentState.getAgent_id() != null) ? agentState.getAgent_id() : "";
Expand Down Expand Up @@ -493,7 +511,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 514 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=AZ2GlS6Olqqz0TVQof1b&open=AZ2GlS6Olqqz0TVQof1b&pullRequest=395

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 @@ -525,7 +544,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 547 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=AZ2GlS6Olqqz0TVQof1c&open=AZ2GlS6Olqqz0TVQof1c&pullRequest=395

ctiURI = ctiURI.replace("CTI_SERVER", serverURL);
ctiURI = ctiURI.replace("AGENT_ID", agentID);
ctiURI = ctiURI.replace("AGENT_IP", agentIP);
Expand Down Expand Up @@ -553,7 +573,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 576 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=AZ2GlS6Olqqz0TVQof1d&open=AZ2GlS6Olqqz0TVQof1d&pullRequest=395

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 @@ -578,7 +599,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 602 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=AZ2GlS6Olqqz0TVQof1e&open=AZ2GlS6Olqqz0TVQof1e&pullRequest=395

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 @@ -604,7 +626,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 629 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=AZ2GlS6Olqqz0TVQof1f&open=AZ2GlS6Olqqz0TVQof1f&pullRequest=395

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 @@ -962,7 +985,9 @@

@Override
public String callPostUrl(String urlRequest, String Json) {
logger.info("From call post URL method.. URL: " + urlRequest + " Json: " + Json);

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

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Format specifiers should be used instead of string concatenation.

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

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

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use the built-in formatting to construct this argument.

See more on https://sonarcloud.io/project/issues?id=PSMRI_Common-API&issues=AZ2GlS6Olqqz0TVQof1N&open=AZ2GlS6Olqqz0TVQof1N&pullRequest=395
String result = httpUtils.post(urlRequest, Json);
logger.info("From call post URL method.. result: " + result);

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

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Format specifiers should be used instead of string concatenation.

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

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

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use the built-in formatting to construct this argument.

See more on https://sonarcloud.io/project/issues?id=PSMRI_Common-API&issues=AZ2GlS6Olqqz0TVQof1O&open=AZ2GlS6Olqqz0TVQof1O&pullRequest=395
return result;
}

Expand All @@ -971,7 +996,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 999 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=AZ2GlS6Olqqz0TVQof1i&open=AZ2GlS6Olqqz0TVQof1i&pullRequest=395

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

Expand Down Expand Up @@ -1012,7 +1038,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 1041 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=AZ2GlS6Olqqz0TVQof1j&open=AZ2GlS6Olqqz0TVQof1j&pullRequest=395

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

Expand Down Expand Up @@ -1055,7 +1082,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 1085 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=AZ2GlS6Olqqz0TVQof1k&open=AZ2GlS6Olqqz0TVQof1k&pullRequest=395

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

Expand Down Expand Up @@ -1084,4 +1112,28 @@

return result;
}

@Override
public OutputResponse getDispositionCount(String request, String ipAddress) throws IEMRException, JSONException, JsonMappingException, JsonProcessingException {

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

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove the declaration of thrown exception 'com.fasterxml.jackson.databind.JsonMappingException' which is a subclass of 'com.fasterxml.jackson.core.JsonProcessingException'.

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

OutputResponse output = new OutputResponse();
ObjectMapper objectMapper = new ObjectMapper();
String ctiURI = ConfigProperties.getPropertyByName("get-disposition-count-URL");
// // String serverURL = ConfigProperties.getPropertyByName("cti-server-ip");

Check warning on line 1122 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=AZ2GlS6Olqqz0TVQof1m&open=AZ2GlS6Olqqz0TVQof1m&pullRequest=395

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

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

String response = this.callPostUrl(ctiURI, objectMapper.writeValueAsString(dispositionRequest));

DispositionCountResponse result = objectMapper.readValue(response, DispositionCountResponse.class);

if (result.getCode() != null && result.getCode().toString().equals(CUSTOM_API_SUCCESS)) {
output.setResponse(objectMapper.writeValueAsString(result));
} else {
output.setError(OutputResponse.GENERIC_FAILURE, result.getFailure_reason(), result.getStatus());
}
return output;
}
}
3 changes: 3 additions & 0 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ get-agent-summary-report-URL=http://CTI_SERVER/apps/customize_apps/piramil_repor
## agent summary report API
get-details-call-report-URL=http://CTI_SERVER/apps/customize_apps/piramil_reports.php?report_type=acd&format=json&end_date=END_DATE&start_date=START_DATE

##1097 abandoned call report API
get-disposition-count-URL=http://CTI_SERVER/apps/CZUtilAPI.php

#============================================================================
# Configure Main Scheduler Properties
#============================================================================
Expand Down
Loading