|
@ -4,8 +4,11 @@ import java.io.ByteArrayInputStream; |
|
|
import java.text.ParseException; |
|
|
import java.text.ParseException; |
|
|
import java.util.*; |
|
|
import java.util.*; |
|
|
|
|
|
|
|
|
|
|
|
import javax.sip.address.SipURI; |
|
|
|
|
|
|
|
|
import javax.sip.header.FromHeader; |
|
|
import javax.sip.header.FromHeader; |
|
|
import javax.sip.header.HeaderAddress; |
|
|
import javax.sip.header.HeaderAddress; |
|
|
|
|
|
import javax.sip.header.ToHeader; |
|
|
import javax.sip.InvalidArgumentException; |
|
|
import javax.sip.InvalidArgumentException; |
|
|
import javax.sip.ListeningPoint; |
|
|
import javax.sip.ListeningPoint; |
|
|
import javax.sip.ObjectInUseException; |
|
|
import javax.sip.ObjectInUseException; |
|
@ -290,9 +293,13 @@ public class MessageRequestProcessor extends SIPRequestAbstractProcessor { |
|
|
deferredResultHolder.invokeResult(msg); |
|
|
deferredResultHolder.invokeResult(msg); |
|
|
} else { |
|
|
} else { |
|
|
// 此处是上级发出的DeviceControl指令
|
|
|
// 此处是上级发出的DeviceControl指令
|
|
|
if (XmlUtil.getText(rootElement, "TeleBoot").equals("Boot") ) { // 远程启动功能:需要在重新启动程序后先对SipStack解绑
|
|
|
String platformId = ((SipURI) ((HeaderAddress) evt.getRequest().getHeader(FromHeader.NAME)).getAddress().getURI()).getUser(); |
|
|
String platformId = ((SipUri) ((HeaderAddress) evt.getRequest().getHeader(FromHeader.NAME)).getAddress().getURI()).getUser(); |
|
|
String targetGBId = ((SipURI) ((HeaderAddress) evt.getRequest().getHeader(ToHeader.NAME)).getAddress().getURI()).getUser(); |
|
|
logger.info("执行远程启动命令"); |
|
|
// 远程启动功能
|
|
|
|
|
|
if (!XmlUtil.isEmpty(XmlUtil.getText(rootElement, "TeleBoot"))) { |
|
|
|
|
|
if (deviceId.equals(targetGBId)) { |
|
|
|
|
|
// 远程启动功能:需要在重新启动程序后先对SipStack解绑
|
|
|
|
|
|
logger.info("执行远程启动本平台命令"); |
|
|
ParentPlatform parentPlatform = storager.queryParentPlatById(platformId); |
|
|
ParentPlatform parentPlatform = storager.queryParentPlatById(platformId); |
|
|
cmderFroPlatform.unregister(parentPlatform, null, null); |
|
|
cmderFroPlatform.unregister(parentPlatform, null, null); |
|
|
|
|
|
|
|
@ -322,6 +329,14 @@ public class MessageRequestProcessor extends SIPRequestAbstractProcessor { |
|
|
|
|
|
|
|
|
restartThread.setDaemon(false); |
|
|
restartThread.setDaemon(false); |
|
|
restartThread.start(); |
|
|
restartThread.start(); |
|
|
|
|
|
} else { |
|
|
|
|
|
// 远程启动指定设备
|
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if (!XmlUtil.isEmpty(XmlUtil.getText(rootElement,"PTZCmd")) && !deviceId.equals(targetGBId)) { |
|
|
|
|
|
String cmdString = XmlUtil.getText(rootElement,"PTZCmd"); |
|
|
|
|
|
Device device = storager.queryVideoDeviceByPlatformIdAndChannelId(platformId, deviceId); |
|
|
|
|
|
cmder.fronEndCmd(device, deviceId, cmdString); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} catch (ParseException | SipException | InvalidArgumentException | DocumentException e) { |
|
|
} catch (ParseException | SipException | InvalidArgumentException | DocumentException e) { |
|
|