From 3a4b6a82b8098ad5c925982aee976ad09288ea1b Mon Sep 17 00:00:00 2001 From: chenzhangyue Date: Sun, 30 Jun 2024 16:24:06 +0800 Subject: [PATCH] :wrench: feat: java 17 --- gb28181-client/pom.xml | 4 +- gb28181-common/pom.xml | 4 +- gb28181-server/pom.xml | 4 +- gb28181-test/pom.xml | 2 +- pom.xml | 6 +-- sip-common/pom.xml | 4 +- .../sip/common/utils/SipRequestUtils.java | 37 ++++++++----------- 7 files changed, 28 insertions(+), 33 deletions(-) diff --git a/gb28181-client/pom.xml b/gb28181-client/pom.xml index 6d4a7f44..377e81d8 100644 --- a/gb28181-client/pom.xml +++ b/gb28181-client/pom.xml @@ -6,10 +6,10 @@ io.github.lunasaw sip-proxy - 1.2.0 + 1.2.3 - 1.2.0 + 1.2.3 gb28181-client jar gb28181-client diff --git a/gb28181-common/pom.xml b/gb28181-common/pom.xml index 7cea50dd..8a270e9f 100644 --- a/gb28181-common/pom.xml +++ b/gb28181-common/pom.xml @@ -6,10 +6,10 @@ io.github.lunasaw sip-proxy - 1.2.0 + 1.2.3 - 1.2.0 + 1.2.3 gb28181-common jar gb28181-common diff --git a/gb28181-server/pom.xml b/gb28181-server/pom.xml index 23951ad7..778e4d08 100644 --- a/gb28181-server/pom.xml +++ b/gb28181-server/pom.xml @@ -6,10 +6,10 @@ io.github.lunasaw sip-proxy - 1.2.0 + 1.2.3 - 1.2.0 + 1.2.3 gb28181-server jar gb28181-server diff --git a/gb28181-test/pom.xml b/gb28181-test/pom.xml index 85a9e88f..126d6bb7 100644 --- a/gb28181-test/pom.xml +++ b/gb28181-test/pom.xml @@ -6,7 +6,7 @@ io.github.lunasaw sip-proxy - 1.2.0 + 1.2.3 ${gb28181-proxy.version} diff --git a/pom.xml b/pom.xml index 90d8f8a9..b2666652 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ io.github.lunasaw sip-proxy - 1.2.0 + 1.2.3 pom sip-common @@ -28,8 +28,8 @@ ${project.name} 1.3.0-91 2.1.4 - 1.2.0 - 1.2.0 + 1.2.3 + 1.2.3 9.1.0 diff --git a/sip-common/pom.xml b/sip-common/pom.xml index 8360a7e3..2d25249c 100644 --- a/sip-common/pom.xml +++ b/sip-common/pom.xml @@ -6,11 +6,11 @@ io.github.lunasaw sip-proxy - 1.2.0 + 1.2.3 jar - 1.2.0 + 1.2.3 sip-common sip-common 轻量级SIP框架封装 diff --git a/sip-common/src/main/java/io/github/lunasaw/sip/common/utils/SipRequestUtils.java b/sip-common/src/main/java/io/github/lunasaw/sip/common/utils/SipRequestUtils.java index 9f151e4a..1cc742a7 100644 --- a/sip-common/src/main/java/io/github/lunasaw/sip/common/utils/SipRequestUtils.java +++ b/sip-common/src/main/java/io/github/lunasaw/sip/common/utils/SipRequestUtils.java @@ -1,7 +1,6 @@ package io.github.lunasaw.sip.common.utils; import java.text.ParseException; -import java.util.ArrayList; import java.util.List; import java.util.UUID; @@ -20,20 +19,17 @@ import javax.sip.message.Request; import javax.sip.message.Response; -import gov.nist.javax.sip.SipProviderImpl; -import gov.nist.javax.sip.header.Via; -import gov.nist.javax.sip.header.ViaList; -import gov.nist.javax.sip.message.SIPRequest; -import io.github.lunasaw.sip.common.constant.Constant; -import io.github.lunasaw.sip.common.layer.SipLayer; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.RandomStringUtils; +import org.springframework.util.ObjectUtils; import com.google.common.collect.Lists; import com.luna.common.text.RandomStrUtil; +import gov.nist.javax.sip.SipProviderImpl; +import io.github.lunasaw.sip.common.constant.Constant; +import io.github.lunasaw.sip.common.layer.SipLayer; import lombok.SneakyThrows; -import org.springframework.util.ObjectUtils; /** * @author luna @@ -47,7 +43,7 @@ public class SipRequestUtils { private static final AddressFactory ADDRESS_FACTORY; - private static final SdpFactory SDP_FACTORY; + private static final SdpFactory SDP_FACTORY; static { try { @@ -165,10 +161,10 @@ public static CallIdHeader getNewCallIdHeader(String ip, String transport) { SipProviderImpl sipProvider; if (ObjectUtils.isEmpty(ip)) { sipProvider = transport.equalsIgnoreCase(Constant.TCP) ? SipLayer.getTcpSipProvider() - : SipLayer.getUdpSipProvider(); + : SipLayer.getUdpSipProvider(); } else { sipProvider = transport.equalsIgnoreCase(Constant.TCP) ? SipLayer.getTcpSipProvider(ip) - : SipLayer.getUdpSipProvider(ip); + : SipLayer.getUdpSipProvider(ip); } if (sipProvider == null) { @@ -411,7 +407,7 @@ public static Header createHeader(String name, String value) { * 创建响应 * * @param statusCode 状态码 - * @param request 回复的请求 + * @param request 回复的请求 * @return */ public static Response createResponse(int statusCode, Request request) { @@ -423,18 +419,18 @@ public static Response createResponse(int statusCode, Request request) { } /** - * @param statusCode statusCode – 状态码 {@link Response} - * @param callId callId – 此消息的 callId 值的新 CallIdHeader 对象。 - * @param cSeq cSeq – 此消息的 cSeq 值的新 CSeqHeader 对象。 - * @param from from – 此消息的 from 值的新 FromHeader 对象。 - * @param to to – 此消息的 to 值的新 ToHeader 对象。 - * @param via via – 此消息的 ViaHeader 的新列表对象。 + * @param statusCode statusCode – 状态码 {@link Response} + * @param callId callId – 此消息的 callId 值的新 CallIdHeader 对象。 + * @param cSeq cSeq – 此消息的 cSeq 值的新 CSeqHeader 对象。 + * @param from from – 此消息的 from 值的新 FromHeader 对象。 + * @param to to – 此消息的 to 值的新 ToHeader 对象。 + * @param via via – 此消息的 ViaHeader 的新列表对象。 * @param maxForwards contentType – 此消息的内容类型值的新内容类型标头对象。 * @param contentType 响应类型 – 此消息的正文内容值的新对象。 - * @param content 内容 + * @param content 内容 */ public static Response createResponse(int statusCode, CallIdHeader callId, CSeqHeader cSeq, FromHeader from, ToHeader to, - List via, MaxForwardsHeader maxForwards, ContentTypeHeader contentType, Object content) { + List via, MaxForwardsHeader maxForwards, ContentTypeHeader contentType, Object content) { try { if (contentType == null) { return MESSAGE_FACTORY.createResponse(statusCode, callId, cSeq, from, to, via, maxForwards); @@ -445,7 +441,6 @@ public static Response createResponse(int statusCode, CallIdHeader callId, CSeqH } } - public static Response createResponse(int statusCode, Request request, List
headers) { try { Response response = MESSAGE_FACTORY.createResponse(statusCode, request);