-
Notifications
You must be signed in to change notification settings - Fork 49
1097 Abandon Call Disposition Count #357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
vanitha1822
wants to merge
1
commit into
release-3.6.1
Choose a base branch
from
nd/vs/abondon_call
base: release-3.6.1
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
src/main/java/com/iemr/common/data/cti/DispositionCountRequest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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"; | ||
| private String campaign_id; | ||
| private String disposition; | ||
| private String date; | ||
| private String enc_flag; | ||
| } |
41 changes: 41 additions & 0 deletions
41
src/main/java/com/iemr/common/data/cti/DispositionCountResponse.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| package com.iemr.common.data.cti; | ||
| import lombok.Data; | ||
| import com.google.gson.annotations.Expose; | ||
| import java.util.List; | ||
|
|
||
| @Data | ||
| public class DispositionCountResponse { | ||
| @Expose | ||
| private CTIResponse response; | ||
|
|
||
| @Expose | ||
| private Integer count; | ||
|
|
||
| @Expose | ||
| private String campaign_id; | ||
|
|
||
| @Expose | ||
| private String disposition; | ||
|
|
||
| @Expose | ||
| private String date; | ||
|
|
||
| @Expose | ||
| private List<DispositionData> dispositionData; | ||
|
|
||
| @Expose | ||
| private String encryptedData; // for enc_flag = "1" | ||
|
|
||
| // Inner class for detailed disposition data | ||
| @Data | ||
| public static class DispositionData { | ||
| @Expose | ||
| private String disposition; | ||
|
|
||
| @Expose | ||
| private Integer count; | ||
|
|
||
| @Expose | ||
| private String date; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -52,6 +52,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; | ||
|
|
@@ -962,7 +964,9 @@ | |
|
|
||
| @Override | ||
| public String callPostUrl(String urlRequest, String Json) { | ||
| logger.info("From call post URL method.. URL: " + urlRequest + " Json: " + Json); | ||
| String result = httpUtils.post(urlRequest, Json); | ||
| logger.info("From call post URL method.. result: " + result); | ||
| return result; | ||
| } | ||
|
|
||
|
|
@@ -1084,4 +1088,32 @@ | |
|
|
||
| return result; | ||
| } | ||
|
|
||
| @Override | ||
| public OutputResponse getDispositionCount(String request, String ipAddress) throws IEMRException, JSONException, JsonMappingException, JsonProcessingException { | ||
|
|
||
| OutputResponse output = new OutputResponse(); | ||
| ObjectMapper objectMapper = new ObjectMapper(); | ||
| String ctiURI = ConfigProperties.getPropertyByName("get-disposition-count-URL"); | ||
| String serverURL = ConfigProperties.getPropertyByName("cti-server-ip"); | ||
| logger.info("Request="+request + ":: CTI URL="+ ctiURI + ":: Server URL="+ serverURL); | ||
Check noticeCode scanning / SonarCloud Logging should not be vulnerable to injection attacks Low
Change this code to not log user-controlled data. See more on SonarQube Cloud
|
||
| DispositionCountRequest dispositionRequest = objectMapper.readValue(request, DispositionCountRequest.class); | ||
|
|
||
| ctiURI = ctiURI.replace("CTI_SERVER", serverURL); | ||
|
|
||
| logger.info("calling disposition count URL: " + ctiURI); | ||
| logger.info("disposition Request="+dispositionRequest.toString()); | ||
| String response = this.callPostUrl(ctiURI, dispositionRequest.toString()); | ||
| logger.info("disposition count API returned: " + response); | ||
|
|
||
| DispositionCountResponse result = objectMapper.readValue(response, DispositionCountResponse.class); | ||
| CTIResponse ctiResponse = result.getResponse(); | ||
|
|
||
| if (ctiResponse.getResponse_code().equals(CUSTOM_API_SUCCESS)) { | ||
| output.setResponse(result.toString()); | ||
| } else { | ||
| output.setError(OutputResponse.GENERIC_FAILURE, ctiResponse.getReason(), ctiResponse.getStatus()); | ||
| } | ||
| return output; | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check notice
Code scanning / SonarCloud
Logging should not be vulnerable to injection attacks Low