修复获取设备信息信令Catalog不标准问题 PTZType,级联的Longitude、Latitude、PTZType等

This commit is contained in:
shizy@yisa.com 2021-12-29 17:53:05 +08:00
parent 726963ba77
commit 206f47f42a
2 changed files with 10 additions and 3 deletions

View File

@ -222,7 +222,13 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
catalogXml.append("<Secrecy>" + channel.getSecrecy() + "</Secrecy>\r\n"); catalogXml.append("<Secrecy>" + channel.getSecrecy() + "</Secrecy>\r\n");
catalogXml.append("<RegisterWay>" + channel.getRegisterWay() + "</RegisterWay>\r\n"); catalogXml.append("<RegisterWay>" + channel.getRegisterWay() + "</RegisterWay>\r\n");
catalogXml.append("<Status>" + (channel.getStatus() == 0?"OFF":"ON") + "</Status>\r\n"); catalogXml.append("<Status>" + (channel.getStatus() == 0?"OFF":"ON") + "</Status>\r\n");
catalogXml.append("<Info></Info>\r\n"); catalogXml.append("<Longitude>" + channel.getLongitude() + "</Longitude>\r\n");
catalogXml.append("<Latitude>" + channel.getLatitude() + "</Latitude>\r\n");
catalogXml.append("<IPAddress>" + channel.getIpAddress() + "</IPAddress>\r\n");
catalogXml.append("<Port>" + channel.getPort() + "</Port>\r\n");
catalogXml.append("<Info>\r\n");
catalogXml.append("<PTZType>" + channel.getPTZType() + "</PTZType>\r\n");
catalogXml.append("</Info>\r\n");
} }

View File

@ -166,10 +166,11 @@ public class CatalogResponseMessageHandler extends SIPRequestProcessorParent imp
} else { } else {
deviceChannel.setLatitude(0.00); deviceChannel.setLatitude(0.00);
} }
if (getText(itemDevice, "PTZType") == null || getText(itemDevice, "PTZType") == "") { Element InfoNode = channelDeviceElement.element("Info");
if (getText(InfoNode, "PTZType") == null || getText(InfoNode, "PTZType") == "") {
deviceChannel.setPTZType(0); deviceChannel.setPTZType(0);
} else { } else {
deviceChannel.setPTZType(Integer.parseInt(getText(itemDevice, "PTZType"))); deviceChannel.setPTZType(Integer.parseInt(getText(InfoNode, "PTZType")));
} }
deviceChannel.setHasAudio(true); // 默认含有音频播放时再检查是否有音频及是否AAC deviceChannel.setHasAudio(true); // 默认含有音频播放时再检查是否有音频及是否AAC
channelList.add(deviceChannel); channelList.add(deviceChannel);