From ed5dde81f6b5156a269b3513ea3dcd49a0ce1676 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=B7=83=E9=BE=99?= Date: Wed, 29 Mar 2023 09:59:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=85=88=E4=BD=BF=E7=94=A8SIP?= =?UTF-8?q?=E8=AE=A4=E8=AF=81=E7=94=A8=E6=88=B7=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../transmit/cmd/SIPRequestHeaderPlarformProvider.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/SIPRequestHeaderPlarformProvider.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/SIPRequestHeaderPlarformProvider.java index 86da5365..2486a52c 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/SIPRequestHeaderPlarformProvider.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/SIPRequestHeaderPlarformProvider.java @@ -94,7 +94,13 @@ public class SIPRequestHeaderPlarformProvider { SipURI requestURI = sipLayer.getSipFactory().createAddressFactory().createSipURI(parentPlatform.getServerGBId(), parentPlatform.getServerIP() + ":" + parentPlatform.getServerPort()); if (www == null) { AuthorizationHeader authorizationHeader = sipLayer.getSipFactory().createHeaderFactory().createAuthorizationHeader("Digest"); - authorizationHeader.setUsername(parentPlatform.getDeviceGBId()); + String username = parentPlatform.getUsername(); + if ( username == null || username == "" ) + { + authorizationHeader.setUsername(parentPlatform.getDeviceGBId()); + } else { + authorizationHeader.setUsername(username); + } authorizationHeader.setURI(requestURI); authorizationHeader.setAlgorithm("MD5"); registerRequest.addHeader(authorizationHeader);