diff --git a/gb28181-sip/src/main/java/cn/skcks/docking/gb28181/sip/method/register/RegisterBuilder.java b/gb28181-sip/src/main/java/cn/skcks/docking/gb28181/sip/method/register/RegisterBuilder.java index 31f710a..19fab79 100644 --- a/gb28181-sip/src/main/java/cn/skcks/docking/gb28181/sip/method/register/RegisterBuilder.java +++ b/gb28181-sip/src/main/java/cn/skcks/docking/gb28181/sip/method/register/RegisterBuilder.java @@ -10,11 +10,4 @@ import javax.sip.message.Request; public class RegisterBuilder { @Getter private static final String method = Request.REGISTER; - private String localIp; - private int localPort; - private String localId; - private String targetIp; - private int targetPort; - private String targetId; - private String transport; } diff --git a/gb28181-sip/src/main/java/cn/skcks/docking/gb28181/sip/method/register/request/RegisterRequestBuilder.java b/gb28181-sip/src/main/java/cn/skcks/docking/gb28181/sip/method/register/request/RegisterRequestBuilder.java index 69245ac..cf876af 100644 --- a/gb28181-sip/src/main/java/cn/skcks/docking/gb28181/sip/method/register/request/RegisterRequestBuilder.java +++ b/gb28181-sip/src/main/java/cn/skcks/docking/gb28181/sip/method/register/request/RegisterRequestBuilder.java @@ -25,6 +25,14 @@ import javax.sip.message.Request; @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class RegisterRequestBuilder extends RegisterBuilder { + private String localIp; + private int localPort; + private String localId; + private String targetIp; + private int targetPort; + private String targetId; + private String transport; + public Request createNoAuthorizationRequest(String callId, int expires) { String local = SipBuilder.createHostAddress(getLocalIp(), getLocalPort()); Address localAddress = SipBuilder.createAddress(SipBuilder.createSipURI(getLocalId(), local)); diff --git a/gb28181-sip/src/test/java/cn/skcks/docking/gb28181/sip/process/RequestTest.java b/gb28181-sip/src/test/java/cn/skcks/docking/gb28181/sip/process/RequestTest.java index cb8aab1..01543ed 100644 --- a/gb28181-sip/src/test/java/cn/skcks/docking/gb28181/sip/process/RequestTest.java +++ b/gb28181-sip/src/test/java/cn/skcks/docking/gb28181/sip/process/RequestTest.java @@ -41,15 +41,7 @@ public class RequestTest { .transport(ListeningPoint.UDP) .build(); - RegisterResponseBuilder registerResponseBuilder = RegisterResponseBuilder.builder() - .localIp(remoteIp) - .localPort(remotePort) - .localId(remoteId) - .targetIp(localIp) - .targetPort(localPort) - .targetId(localId) - .transport(ListeningPoint.UDP) - .build(); + RegisterResponseBuilder registerResponseBuilder = RegisterResponseBuilder.builder().build(); log.info("无密码的认证"); Request noAuthorizationRequest = registerRequestBuilder.createNoAuthorizationRequest(callId, 3600);