ua 生成格式调整

This commit is contained in:
shikong 2023-09-29 15:44:12 +08:00
parent ba6fa8f921
commit 7446bf1647

View File

@ -25,7 +25,7 @@ public class SipUtil {
@Setter
public static String UserAgent = "GB28181-Docking-Platform";
@Setter
public static String UserAgentVersion = "0.0.1";
public static String UserAgentVersion = "";
private static final char[] DEFAULT_ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyz".toCharArray();
public static String nanoId(){
@ -67,8 +67,10 @@ public class SipUtil {
public static UserAgentHeader getUserAgentHeader(){
List<String> agentParam = new ArrayList<>(3);
agentParam.add(UserAgent);
agentParam.add(" ");
agentParam.add(StringUtils.replace(UserAgentVersion,"-SNAPSHOT",""));
if(StringUtils.isNotBlank(UserAgentVersion)){
agentParam.add(" ");
agentParam.add(StringUtils.replace(UserAgentVersion,"-SNAPSHOT",""));
}
return SipFactory.getInstance().createHeaderFactory().createUserAgentHeader(agentParam);
}