diff --git a/gb28181-sip/src/main/java/cn/skcks/docking/gb28181/constant/GB28181Constant.java b/gb28181-sip/src/main/java/cn/skcks/docking/gb28181/constant/GB28181Constant.java index 66729be..ca8f668 100644 --- a/gb28181-sip/src/main/java/cn/skcks/docking/gb28181/constant/GB28181Constant.java +++ b/gb28181-sip/src/main/java/cn/skcks/docking/gb28181/constant/GB28181Constant.java @@ -1,7 +1,14 @@ package cn.skcks.docking.gb28181.constant; +import javax.sip.ListeningPoint; + public class GB28181Constant { public static final String TIME_ZONE = "Asia/Shanghai"; public static final String CHARSET = "GB2312"; public static final String GEO_COORD_SYS = "WGS84"; + + public static class TransPort { + public static final String UDP = ListeningPoint.UDP; + public static final String TCP = ListeningPoint.TCP; + } } diff --git a/gb28181-sip/src/test/java/cn/skcks/docking/gb28181/sip/SipTest.java b/gb28181-sip/src/test/java/cn/skcks/docking/gb28181/sip/SipTest.java index 48e5d00..4d15bf2 100644 --- a/gb28181-sip/src/test/java/cn/skcks/docking/gb28181/sip/SipTest.java +++ b/gb28181-sip/src/test/java/cn/skcks/docking/gb28181/sip/SipTest.java @@ -1,5 +1,6 @@ package cn.skcks.docking.gb28181.sip; +import cn.skcks.docking.gb28181.constant.GB28181Constant; import cn.skcks.docking.gb28181.sip.generic.SipBuilder; import cn.skcks.docking.gb28181.sip.request.SipRequestBuilder; import cn.skcks.docking.gb28181.sip.response.SipResponseBuilder; @@ -49,7 +50,7 @@ public class SipTest { CSeqHeader cSeqHeader = SipBuilder.createCSeqHeader(1, method); // CallId @ 后面可以是地址也可以为 域 id CallIdHeader callIdHeader = SipBuilder.createCallIdHeader(MessageFormat.format("{0}@{1}", "123456", localIp)); - List viaHeaders = SipBuilder.createViaHeaders(localIp, localPort, ListeningPoint.UDP, "z9hG4bK" + "0000000001"); + List viaHeaders = SipBuilder.createViaHeaders(localIp, localPort, GB28181Constant.TransPort.TCP, "z9hG4bK" + "0000000001"); MaxForwardsHeader maxForwardsHeader = SipBuilder.createMaxForwardsHeader(70); // 创建请求