修改挂断接口

master
wjt 1 year ago
parent e4001ffaab
commit 29e38d35e3

@ -176,6 +176,7 @@ public class TelephoneCallController {
@PostMapping("/cti/stop") @PostMapping("/cti/stop")
@ApiOperation("cti挂断呼叫") @ApiOperation("cti挂断呼叫")
@Log("请求挂断")
public CommonResponse<Object> ctiCallStop(@RequestBody TelephoneCallStopDTO telephoneCallStopDTO) { public CommonResponse<Object> ctiCallStop(@RequestBody TelephoneCallStopDTO telephoneCallStopDTO) {
return telephoneCallService.ctiCallStop(telephoneCallStopDTO); return telephoneCallService.ctiCallStop(telephoneCallStopDTO);
} }

@ -11,4 +11,5 @@ public class TelephoneCallStopDTO {
private String content; private String content;
private String callId; private String callId;
private String sessionid; private String sessionid;
private String caller;
} }

@ -54,15 +54,12 @@ public class CtiCallReq {
public Boolean stopReq(TelephoneCallStopDTO telephoneCallStopDTO) { public Boolean stopReq(TelephoneCallStopDTO telephoneCallStopDTO) {
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.putOpt("reqId", telephoneCallStopDTO.getCallId()); json.putOpt("reqId", telephoneCallStopDTO.getCallId());
json.putOpt("callId", telephoneCallStopDTO.getSessionid()); json.putOpt("caller", telephoneCallStopDTO.getCaller());
json.putOpt("orgCode", orgCode); json.putOpt("orgCode", orgCode);
json.putOpt("action", "1001"); json.putOpt("action", "1001");
HttpResponse httpResponse = HttpRequest.post(reqUrl).body(JSONUtil.toJsonPrettyStr(json)).execute(); String httpResponse = sendCallReq(JSONUtil.toJsonPrettyStr(json), reqUrl).body();
log.info("请求挂断,session={},{}", telephoneCallStopDTO.getSessionid(), httpResponse.body()); CtiCallResponse ctiCallResponse = JSONUtil.toBean(httpResponse, CtiCallResponse.class);
if (httpResponse.isOk()) { return ctiCallResponse.getResult();
return Boolean.TRUE;
}
return Boolean.FALSE;
} }
public Boolean setReq(String callBackUrl, String notifyUrl) { public Boolean setReq(String callBackUrl, String notifyUrl) {

@ -380,6 +380,7 @@ public class TelephoneCallServiceImpl implements TelephoneCallService {
telephoneCallStopDTO.setSessionid(requestId); telephoneCallStopDTO.setSessionid(requestId);
telephoneCallStopDTO.setContent(content); telephoneCallStopDTO.setContent(content);
telephoneCallStopDTO.setCallId(requestId); telephoneCallStopDTO.setCallId(requestId);
telephoneCallStopDTO.setCaller(telephoneCallReqDTO.getTelA());
return CommonResponse.createBySuccess(telephoneCallStopDTO); return CommonResponse.createBySuccess(telephoneCallStopDTO);
} }

@ -3,7 +3,6 @@ package com.baiye.module.service;
import com.baiye.http.CommonResponse; import com.baiye.http.CommonResponse;
import com.baiye.model.dto.HomePageReportDTO; import com.baiye.model.dto.HomePageReportDTO;
import com.baiye.model.dto.ReportStageAndTurnoverDto; import com.baiye.model.dto.ReportStageAndTurnoverDto;
import com.baiye.module.entity.ReportTokerCall;
import com.baiye.module.entity.dto.ReportTokerDTO; import com.baiye.module.entity.dto.ReportTokerDTO;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;

Loading…
Cancel
Save