Skip to content

Commit

Permalink
Merge pull request #33 from lunasaw/dev_spring_boot_3
Browse files Browse the repository at this point in the history
🔧 feat: java 17
  • Loading branch information
lunasaw authored Jun 30, 2024
2 parents 4e5da15 + 3a4b6a8 commit 4ac6093
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 33 deletions.
4 changes: 2 additions & 2 deletions gb28181-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<parent>
<groupId>io.github.lunasaw</groupId>
<artifactId>sip-proxy</artifactId>
<version>1.2.0</version>
<version>1.2.3</version>
</parent>

<version>1.2.0</version>
<version>1.2.3</version>
<artifactId>gb28181-client</artifactId>
<packaging>jar</packaging>
<name>gb28181-client</name>
Expand Down
4 changes: 2 additions & 2 deletions gb28181-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<parent>
<groupId>io.github.lunasaw</groupId>
<artifactId>sip-proxy</artifactId>
<version>1.2.0</version>
<version>1.2.3</version>
</parent>

<version>1.2.0</version>
<version>1.2.3</version>
<artifactId>gb28181-common</artifactId>
<packaging>jar</packaging>
<name>gb28181-common</name>
Expand Down
4 changes: 2 additions & 2 deletions gb28181-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<parent>
<groupId>io.github.lunasaw</groupId>
<artifactId>sip-proxy</artifactId>
<version>1.2.0</version>
<version>1.2.3</version>
</parent>

<version>1.2.0</version>
<version>1.2.3</version>
<artifactId>gb28181-server</artifactId>
<packaging>jar</packaging>
<name>gb28181-server</name>
Expand Down
2 changes: 1 addition & 1 deletion gb28181-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.github.lunasaw</groupId>
<artifactId>sip-proxy</artifactId>
<version>1.2.0</version>
<version>1.2.3</version>
</parent>

<version>${gb28181-proxy.version}</version>
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>io.github.lunasaw</groupId>
<artifactId>sip-proxy</artifactId>
<version>1.2.0</version>
<version>1.2.3</version>
<packaging>pom</packaging>
<modules>
<module>sip-common</module>
Expand All @@ -28,8 +28,8 @@
<app.profiles>${project.name}</app.profiles>
<sip.version>1.3.0-91</sip.version>
<dom4j.version>2.1.4</dom4j.version>
<sip-proxy-common.version>1.2.0</sip-proxy-common.version>
<gb28181-proxy.version>1.2.0</gb28181-proxy.version>
<sip-proxy-common.version>1.2.3</sip-proxy-common.version>
<gb28181-proxy.version>1.2.3</gb28181-proxy.version>
<skywalking.version>9.1.0</skywalking.version>
</properties>

Expand Down
4 changes: 2 additions & 2 deletions sip-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<parent>
<groupId>io.github.lunasaw</groupId>
<artifactId>sip-proxy</artifactId>
<version>1.2.0</version>
<version>1.2.3</version>
</parent>

<packaging>jar</packaging>
<version>1.2.0</version>
<version>1.2.3</version>
<artifactId>sip-common</artifactId>
<name>sip-common</name>
<description>轻量级SIP框架封装</description>
Expand Down
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -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
Expand All @@ -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 {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand All @@ -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<ViaHeader> via, MaxForwardsHeader maxForwards, ContentTypeHeader contentType, Object content) {
List<ViaHeader> via, MaxForwardsHeader maxForwards, ContentTypeHeader contentType, Object content) {
try {
if (contentType == null) {
return MESSAGE_FACTORY.createResponse(statusCode, callId, cSeq, from, to, via, maxForwards);
Expand All @@ -445,7 +441,6 @@ public static Response createResponse(int statusCode, CallIdHeader callId, CSeqH
}
}


public static Response createResponse(int statusCode, Request request, List<Header> headers) {
try {
Response response = MESSAGE_FACTORY.createResponse(statusCode, request);
Expand Down

0 comments on commit 4ac6093

Please sign in to comment.