调整
This commit is contained in:
parent
ad72b02371
commit
2d38c7d6ec
@ -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;
|
||||
}
|
||||
|
@ -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));
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user