优先使用SIP认证用户名

This commit is contained in:
刘跃龙 2023-03-29 09:59:47 +08:00
parent 6616746ffd
commit 2ca1fabb35

View File

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