| | |
| | | package com.smartor.config; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.utils.HttpUtil; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.http.HttpEntity; |
| | | import org.apache.commons.httpclient.methods.PostMethod; |
| | | import org.apache.commons.httpclient.params.HttpMethodParams; |
| | | import org.apache.http.util.EntityUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | | import sun.net.www.http.HttpClient; |
| | | |
| | | import javax.mail.Multipart; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | |
| | | map.put("dnis", dnis); |
| | | map.put("call_uuid", call_uuid); |
| | | map.put("force_call", force_call); |
| | | map.put("fs_node_id", 8021); |
| | | if (force_call == null) map.put("force_call", true); |
| | | return sendReq(map, "/tel/ai_api/outbound"); |
| | | } |
| | |
| | | * |
| | | * @return |
| | | */ |
| | | public String hangup(String kg_uuid, String dnis, String data, String app_id, String ani, String special_ch, String sign, Boolean call_uuid) { |
| | | public String hangup(String kg_uuid, String dnis, String data, String app_id, String ani, String special_ch, String sign, String call_uuid) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("kg_uuid", kg_uuid); |
| | | map.put("data", data); |
| | |
| | | phonePort = "8001"; |
| | | } |
| | | HttpEntity<String> stringHttpEntity = HttpUtil.postJsonRequestV2(phoneIP + ":" + phonePort + path, req, String.class); |
| | | String responseBody = null; |
| | | try { |
| | | responseBody = new String(stringHttpEntity.getBody().getBytes("ISO-8859-1"), "UTF-8"); |
| | | System.out.println(responseBody); |
| | | } catch (UnsupportedEncodingException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return new String(stringHttpEntity.getBody().getBytes(StandardCharsets.UTF_8)); |
| | | } |
| | | |