Commit 1ac7355d6773d793d1962ffadafe6df421eee84a

Authored by 芯火源
1 parent ad826a9a

fix: GBT28181协议接入的设备增加协议校验

@@ -643,12 +643,15 @@ public class SIPProcessorObserver extends SIPRequestProcessorParent @@ -643,12 +643,15 @@ public class SIPProcessorObserver extends SIPRequestProcessorParent
643 responseAck(request, Response.FORBIDDEN, "设备密码错误"); 643 responseAck(request, Response.FORBIDDEN, "设备密码错误");
644 return; 644 return;
645 } 645 }
  646 + DeviceProfile profile = msg.getDeviceProfile();
  647 + if(profile.getTransportType() != DeviceTransportType.GBT28181){
  648 + return;
  649 + }
646 GbtDeviceSessionCtx deviceSessionCtx = 650 GbtDeviceSessionCtx deviceSessionCtx =
647 deviceSessions.computeIfAbsent( 651 deviceSessions.computeIfAbsent(
648 camaraId, val -> new GbtDeviceSessionCtx(UUID.randomUUID(), context)); 652 camaraId, val -> new GbtDeviceSessionCtx(UUID.randomUUID(), context));
649 - // DeviceProfile profile = msg.getDeviceProfile();  
650 deviceSessionCtx.setDeviceInfo(msg.getDeviceInfo()); 653 deviceSessionCtx.setDeviceInfo(msg.getDeviceInfo());
651 - deviceSessionCtx.setDeviceProfile(msg.getDeviceProfile()); 654 + deviceSessionCtx.setDeviceProfile(profile);
652 deviceSessionCtx.setCharset("GB2312"); 655 deviceSessionCtx.setCharset("GB2312");
653 deviceSessionCtx.setGeoCoordSys("WGS84"); 656 deviceSessionCtx.setGeoCoordSys("WGS84");
654 deviceSessionCtx.setTreeType("CivilCode"); 657 deviceSessionCtx.setTreeType("CivilCode");