Commit 8a4e915fe1273e181d44cd152bfcb09446944b18
1 parent
217d4298
修改catalog请求还是响应的判断方法
Showing
1 changed file
with
4 additions
and
2 deletions
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/MessageRequestProcessor.java
| ... | ... | @@ -162,11 +162,13 @@ public class MessageRequestProcessor extends SIPRequestAbstractProcessor { |
| 162 | 162 | private void processMessageCatalogList(RequestEvent evt) { |
| 163 | 163 | try { |
| 164 | 164 | Element rootElement = getRootElement(evt); |
| 165 | + String name = rootElement.getName(); | |
| 165 | 166 | Element deviceIdElement = rootElement.element("DeviceID"); |
| 166 | 167 | String deviceId = deviceIdElement.getText(); |
| 167 | 168 | Element deviceListElement = rootElement.element("DeviceList"); |
| 168 | - if (deviceListElement == null) { // 存在DeviceList则为响应 catalog, 不存在DeviceList则为查询请求 | |
| 169 | - // TODO 后续将代码拆分 | |
| 169 | + // if (deviceListElement == null) { // 存在DeviceList则为响应 catalog, 不存在DeviceList则为查询请求 | |
| 170 | + if (name == "Query") { // 区分是Response——查询响应,还是Query——查询请求 | |
| 171 | + // TODO 后续将代码拆分 | |
| 170 | 172 | ParentPlatform parentPlatform = storager.queryParentPlatById(deviceId); |
| 171 | 173 | if (parentPlatform == null) { |
| 172 | 174 | response404Ack(evt); | ... | ... |