|
@ -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(); |
|
|
} |
|
|
} |
|
|