mirror of
https://gitee.com/pan648540858/wvp-GB28181-pro.git
synced 2026-05-27 15:37:50 +08:00
Pre Merge pull request !25 from 大头虾/wvp-28181-2.0
This commit is contained in:
commit
7bba8dafc5
@ -10,6 +10,7 @@ import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
|||||||
import com.genersoft.iot.vmp.utils.GitUtil;
|
import com.genersoft.iot.vmp.utils.GitUtil;
|
||||||
import gov.nist.javax.sip.message.MessageFactoryImpl;
|
import gov.nist.javax.sip.message.MessageFactoryImpl;
|
||||||
import gov.nist.javax.sip.message.SIPRequest;
|
import gov.nist.javax.sip.message.SIPRequest;
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.util.DigestUtils;
|
import org.springframework.util.DigestUtils;
|
||||||
@ -36,7 +37,7 @@ public class SIPRequestHeaderPlarformProvider {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SipConfig sipConfig;
|
private SipConfig sipConfig;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SipLayer sipLayer;
|
private SipLayer sipLayer;
|
||||||
|
|
||||||
@ -96,8 +97,7 @@ public class SIPRequestHeaderPlarformProvider {
|
|||||||
if (www == null) {
|
if (www == null) {
|
||||||
AuthorizationHeader authorizationHeader = SipFactory.getInstance().createHeaderFactory().createAuthorizationHeader("Digest");
|
AuthorizationHeader authorizationHeader = SipFactory.getInstance().createHeaderFactory().createAuthorizationHeader("Digest");
|
||||||
String username = parentPlatform.getUsername();
|
String username = parentPlatform.getUsername();
|
||||||
if ( username == null || username == "" )
|
if (ObjectUtils.isEmpty(username)){
|
||||||
{
|
|
||||||
authorizationHeader.setUsername(parentPlatform.getDeviceGBId());
|
authorizationHeader.setUsername(parentPlatform.getDeviceGBId());
|
||||||
} else {
|
} else {
|
||||||
authorizationHeader.setUsername(username);
|
authorizationHeader.setUsername(username);
|
||||||
@ -148,7 +148,12 @@ public class SIPRequestHeaderPlarformProvider {
|
|||||||
String RESPONSE = DigestUtils.md5DigestAsHex(reStr.toString().getBytes());
|
String RESPONSE = DigestUtils.md5DigestAsHex(reStr.toString().getBytes());
|
||||||
|
|
||||||
AuthorizationHeader authorizationHeader = SipFactory.getInstance().createHeaderFactory().createAuthorizationHeader(scheme);
|
AuthorizationHeader authorizationHeader = SipFactory.getInstance().createHeaderFactory().createAuthorizationHeader(scheme);
|
||||||
authorizationHeader.setUsername(parentPlatform.getDeviceGBId());
|
String username = parentPlatform.getUsername();
|
||||||
|
if (ObjectUtils.isEmpty(username)){
|
||||||
|
authorizationHeader.setUsername(parentPlatform.getDeviceGBId());
|
||||||
|
} else {
|
||||||
|
authorizationHeader.setUsername(username);
|
||||||
|
}
|
||||||
authorizationHeader.setRealm(realm);
|
authorizationHeader.setRealm(realm);
|
||||||
authorizationHeader.setNonce(nonce);
|
authorizationHeader.setNonce(nonce);
|
||||||
authorizationHeader.setURI(requestURI);
|
authorizationHeader.setURI(requestURI);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user