修改挂断接口

master
wjt 1 year ago
parent e4001ffaab
commit 29e38d35e3

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

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

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

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

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

Loading…
Cancel
Save