更新配置
This commit is contained in:
parent
9cd9ebd060
commit
b15115565c
@ -144,9 +144,8 @@ public class MessageRequestProcessor extends SIPRequestAbstractProcessor {
|
|||||||
private void processMessageCatalogList(RequestEvent evt) {
|
private void processMessageCatalogList(RequestEvent evt) {
|
||||||
try {
|
try {
|
||||||
Element rootElement = getRootElement(evt);
|
Element rootElement = getRootElement(evt);
|
||||||
String s = rootElement.toString();
|
|
||||||
Element deviceIdElement = rootElement.element("DeviceID");
|
Element deviceIdElement = rootElement.element("DeviceID");
|
||||||
String deviceId = deviceIdElement.getText().toString();
|
String deviceId = deviceIdElement.getText();
|
||||||
Element deviceListElement = rootElement.element("DeviceList");
|
Element deviceListElement = rootElement.element("DeviceList");
|
||||||
if (deviceListElement == null) {
|
if (deviceListElement == null) {
|
||||||
return;
|
return;
|
||||||
@ -164,9 +163,9 @@ public class MessageRequestProcessor extends SIPRequestAbstractProcessor {
|
|||||||
if (channelDeviceElement == null) {
|
if (channelDeviceElement == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
String channelDeviceId = channelDeviceElement.getText().toString();
|
String channelDeviceId = channelDeviceElement.getText();
|
||||||
Element channdelNameElement = itemDevice.element("Name");
|
Element channdelNameElement = itemDevice.element("Name");
|
||||||
String channelName = channdelNameElement != null ? channdelNameElement.getText().toString() : "";
|
String channelName = channdelNameElement != null ? channdelNameElement.getTextTrim().toString() : "";
|
||||||
Element statusElement = itemDevice.element("Status");
|
Element statusElement = itemDevice.element("Status");
|
||||||
String status = statusElement != null ? statusElement.getText().toString() : "ON";
|
String status = statusElement != null ? statusElement.getText().toString() : "ON";
|
||||||
DeviceChannel deviceChannel = new DeviceChannel();
|
DeviceChannel deviceChannel = new DeviceChannel();
|
||||||
@ -213,7 +212,11 @@ public class MessageRequestProcessor extends SIPRequestAbstractProcessor {
|
|||||||
deferredResultHolder.invokeResult(msg);
|
deferredResultHolder.invokeResult(msg);
|
||||||
|
|
||||||
// 回复200
|
// 回复200
|
||||||
responseAck(evt);
|
if (offLineDetector.isOnline(deviceId)) {
|
||||||
|
responseAck(evt);
|
||||||
|
publisher.onlineEventPublish(deviceId, VideoManagerConstants.EVENT_ONLINE_KEEPLIVE);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
} catch (DocumentException | SipException | InvalidArgumentException | ParseException e) {
|
} catch (DocumentException | SipException | InvalidArgumentException | ParseException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@ -359,7 +362,7 @@ public class MessageRequestProcessor extends SIPRequestAbstractProcessor {
|
|||||||
private Element getRootElement(RequestEvent evt) throws DocumentException {
|
private Element getRootElement(RequestEvent evt) throws DocumentException {
|
||||||
Request request = evt.getRequest();
|
Request request = evt.getRequest();
|
||||||
SAXReader reader = new SAXReader();
|
SAXReader reader = new SAXReader();
|
||||||
reader.setEncoding("gbk");
|
// reader.setEncoding("GB2312");
|
||||||
Document xml = reader.read(new ByteArrayInputStream(request.getRawContent()));
|
Document xml = reader.read(new ByteArrayInputStream(request.getRawContent()));
|
||||||
return xml.getRootElement();
|
return xml.getRootElement();
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
name: iot-vmp-vmanager
|
name: iot-vmp-vmanager
|
||||||
# 影子数据存储方式,支持redis、jdbc
|
# 影子数据存储方式,支持redis、jdbc,暂不支持mysql
|
||||||
database: redis
|
database: redis
|
||||||
# 通信方式,支持kafka、http
|
# 通信方式,支持kafka、http
|
||||||
communicate: http
|
communicate: http
|
||||||
|
Loading…
Reference in New Issue
Block a user