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 @@ -520,7 +520,7 @@ public String updateBenefciaryCommunityorEducation(
public String getBeneficiaryIDs(
@ApiParam("{\"benIDRequired\":\"Integer\",\"vanID\":\"Integer\"}") @RequestBody String request,
HttpServletRequest httpRequest) {
logger.info("generateBeneficiaryIDs request " + request.toString());
logger.info("generateBeneficiaryIDs request " + request);
OutputResponse response = new OutputResponse();
try {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,14 @@
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.iemr.common.service.brd.BRDIntegrationService;
import com.iemr.common.utils.response.OutputResponse;


@RestController
@RequestMapping("/brd")
@CrossOrigin()
Expand All @@ -44,7 +40,6 @@ public String getDetails(@RequestBody String request) {
logger.error("Error while getching BRD Integration data :" + e);
response.setError(5000, "Unable to get BRD data");
}
System.out.println(response.toStringWithSerializeNulls());
return response.toStringWithSerializeNulls();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
public class CallController {
InputMapper inputMapper = new InputMapper();
final Logger logger = LoggerFactory.getLogger(this.getClass().getName());
private static final String XFORWARDEDFOR = "X-FORWARDED-FOR";
private static final String AUTHORIZATION = "authorization";
private CalltypeServiceImpl calltypeServiceImpl;

@Autowired
Expand Down Expand Up @@ -95,7 +97,7 @@ public String startCall(
HttpServletRequest fromRequest) {
OutputResponse response = new OutputResponse();
try {
String remoteAddress = fromRequest.getHeader("X-FORWARDED-FOR");
String remoteAddress = fromRequest.getHeader(XFORWARDEDFOR);
if (remoteAddress == null || remoteAddress.trim().length() == 0) {
remoteAddress = fromRequest.getRemoteAddr();
}
Expand Down Expand Up @@ -145,14 +147,13 @@ public String closeCall(
+ "\"agentIPAddress\":\"Optional String - agent IP address\", "
+ "\"agentID\":\"Optional String - agentID\", \"isSelf\":\"Optional boolean\", "
+ "\"isFeedback\":\"optional Boolean true if IVRS feedback to be taken\", "
+ "\"isTransfered\":\"Boolean - transfer call or not\""
+ "}") @RequestBody String request,
+ "\"isTransfered\":\"Boolean - transfer call or not\"" + "}") @RequestBody String request,
HttpServletRequest serverRequest) {
OutputResponse response = new OutputResponse();
try {
logger.info("closeCallReqObj " + request);
JSONObject requestObject = new JSONObject(request);
String remoteAddress = serverRequest.getHeader("X-FORWARDED-FOR");
String remoteAddress = serverRequest.getHeader(XFORWARDEDFOR);
if (remoteAddress == null || remoteAddress.trim().length() == 0) {
remoteAddress = serverRequest.getRemoteAddr();
}
Expand Down Expand Up @@ -188,7 +189,7 @@ public String closeCallV1(
OutputResponse response = new OutputResponse();
try {
JSONObject requestObject = new JSONObject(request);
String remoteAddress = serverRequest.getHeader("X-FORWARDED-FOR");
String remoteAddress = serverRequest.getHeader(XFORWARDEDFOR);
if (remoteAddress == null || remoteAddress.trim().length() == 0) {
remoteAddress = serverRequest.getRemoteAddr();
}
Expand All @@ -215,7 +216,7 @@ public String outboundCallList(@ApiParam(value = "{\"providerServiceMapID\":\" c
+ "\"filterStartDate\":\"JSON date\", " + "\"filterEndDate\":\"JSON Date\"}") @RequestBody String request,
HttpServletRequest httpRequest) {
OutputResponse response = new OutputResponse();
String auth = httpRequest.getHeader("authorization");
String auth = httpRequest.getHeader(AUTHORIZATION);
try {
response.setResponse(beneficiaryCallService.outboundCallList(request, auth));
} catch (Exception e) {
Expand Down Expand Up @@ -254,7 +255,7 @@ public String filterCallList(
+ "\"is1097\" : \"boolean true for 1097\"}") @RequestBody String request,
HttpServletRequest httpRequest) {
OutputResponse response = new OutputResponse();
String auth = httpRequest.getHeader("authorization");
String auth = httpRequest.getHeader(AUTHORIZATION);
try {
response.setResponse(beneficiaryCallService.filterCallList(request, auth));
} catch (Exception e) {
Expand All @@ -274,7 +275,7 @@ public String filterCallListPaginated(@ApiParam(value = "{\"calledServiceID\":\"
+ "\"is1097\" : \"boolean true for 1097\", \"pageNo\\\":\"optional page no\", , \"pageSize\":\"optional page size\" }") @RequestBody String request,
HttpServletRequest httpRequest) {
OutputResponse response = new OutputResponse();
String auth = httpRequest.getHeader("authorization");
String auth = httpRequest.getHeader(AUTHORIZATION);
try {
response.setResponse(beneficiaryCallService.filterCallListWithPagination(request, auth));
} catch (Exception e) {
Expand Down Expand Up @@ -469,14 +470,8 @@ public String nueisanceCallHistory(
HttpServletRequest serverRequest) {
OutputResponse response = new OutputResponse();
try {
String remoteAddress = serverRequest.getHeader("X-FORWARDED-FOR");
if (remoteAddress == null || remoteAddress.trim().length() == 0) {
remoteAddress = serverRequest.getRemoteAddr();
}
String auth = serverRequest.getHeader("authorization");
String auth = serverRequest.getHeader(AUTHORIZATION);
response.setResponse(beneficiaryCallService.nueisanceCallHistory(request, auth).toString());
// response.setResponse(beneficiaryCallService.filterCallList(request,
// auth).toString());
} catch (Exception e) {
logger.error("outboundCallList failed with error " + e.getMessage(), e);
response.setError(e);
Expand All @@ -487,7 +482,8 @@ public String nueisanceCallHistory(

@CrossOrigin()
@RequestMapping(value = "/beneficiaryByCallID", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON, headers = "Authorization")
public String beneficiaryByCallID(@ApiParam("{\"callID\":\"String\"}") @RequestBody CallRequestByIDModel request, HttpServletRequest serverRequest) {
public String beneficiaryByCallID(@ApiParam("{\"callID\":\"String\"}") @RequestBody CallRequestByIDModel request,
HttpServletRequest serverRequest) {
OutputResponse response = new OutputResponse();
try {
BeneficiaryCallModel callData = beneficiaryCallService.beneficiaryByCallID(request,
Expand Down Expand Up @@ -585,10 +581,10 @@ public String checkAutoPreviewDialing(

@CrossOrigin()
@RequestMapping(value = "/getFilePathCTI", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON, headers = "Authorization")
public String getFilePathCTI(@ApiParam("{\"agentID\":\"String\",\"callID\":\"String\"}") @RequestBody String request) {
public String getFilePathCTI(
@ApiParam("{\"agentID\":\"String\",\"callID\":\"String\"}") @RequestBody String request) {
OutputResponse response = new OutputResponse();
try {
// response.setResponse(beneficiaryCallService.CTIFilePath(request));
String pathResponse = beneficiaryCallService.cTIFilePathNew(request);
if (pathResponse != null)
response.setResponse(pathResponse);
Expand Down
Loading