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);