Browse Source

同步主线

pull/58/head
panlinlin 4 years ago
parent
commit
d0f5d684a9
  1. 31
      src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/MessageRequestProcessor.java
  2. BIN
      src/main/resources/wvp.sqlite

31
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/MessageRequestProcessor.java

@ -11,9 +11,15 @@ import javax.sip.header.FromHeader;
import javax.sip.message.Request; import javax.sip.message.Request;
import javax.sip.message.Response; import javax.sip.message.Response;
import com.alibaba.fastjson.JSONObject;
import com.genersoft.iot.vmp.conf.UserSetup;
import com.genersoft.iot.vmp.gb28181.bean.*; import com.genersoft.iot.vmp.gb28181.bean.*;
import com.genersoft.iot.vmp.gb28181.transmit.callback.CheckForAllRecordsThread;
import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommanderFroPlatform; import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommanderFroPlatform;
import com.genersoft.iot.vmp.gb28181.utils.NumericUtil;
import com.genersoft.iot.vmp.storager.IRedisCatchStorage; import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
import com.genersoft.iot.vmp.utils.GpsUtil;
import com.genersoft.iot.vmp.utils.SpringBeanFactory;
import com.genersoft.iot.vmp.vmanager.platform.bean.ChannelReduce; import com.genersoft.iot.vmp.vmanager.platform.bean.ChannelReduce;
import gov.nist.javax.sip.address.AddressImpl; import gov.nist.javax.sip.address.AddressImpl;
import gov.nist.javax.sip.address.SipUri; import gov.nist.javax.sip.address.SipUri;
@ -49,6 +55,10 @@ import com.genersoft.iot.vmp.common.StreamInfo;
*/ */
public class MessageRequestProcessor extends SIPRequestAbstractProcessor { public class MessageRequestProcessor extends SIPRequestAbstractProcessor {
public static volatile List<String> threadNameList = new ArrayList();
private UserSetup userSetup = (UserSetup) SpringBeanFactory.getBean("userSetup");
private final static Logger logger = LoggerFactory.getLogger(MessageRequestProcessor.class); private final static Logger logger = LoggerFactory.getLogger(MessageRequestProcessor.class);
private SIPCommander cmder; private SIPCommander cmder;
@ -417,7 +427,7 @@ public class MessageRequestProcessor extends SIPRequestAbstractProcessor {
if (parentPlatform == null) { if (parentPlatform == null) {
response404Ack(evt); response404Ack(evt);
return; return;
}else { } else {
// 回复200 OK // 回复200 OK
responseAck(evt); responseAck(evt);
@ -425,7 +435,7 @@ public class MessageRequestProcessor extends SIPRequestAbstractProcessor {
String sn = snElement.getText(); String sn = snElement.getText();
// 准备回复通道信息 // 准备回复通道信息
List<ChannelReduce> channelReduces = storager.queryChannelListInParentPlatform(parentPlatform.getServerGBId()); List<ChannelReduce> channelReduces = storager.queryChannelListInParentPlatform(parentPlatform.getServerGBId());
if (channelReduces.size() >0 ) { if (channelReduces.size() > 0) {
for (ChannelReduce channelReduce : channelReduces) { for (ChannelReduce channelReduce : channelReduces) {
DeviceChannel deviceChannel = storager.queryChannel(channelReduce.getDeviceId(), channelReduce.getChannelId()); DeviceChannel deviceChannel = storager.queryChannel(channelReduce.getDeviceId(), channelReduce.getChannelId());
cmderFroPlatform.catalogQuery(deviceChannel, parentPlatform, sn, fromHeader.getTag(), channelReduces.size()); cmderFroPlatform.catalogQuery(deviceChannel, parentPlatform, sn, fromHeader.getTag(), channelReduces.size());
@ -435,7 +445,7 @@ public class MessageRequestProcessor extends SIPRequestAbstractProcessor {
} }
}else { } else {
Iterator<Element> deviceListIterator = deviceListElement.elementIterator(); Iterator<Element> deviceListIterator = deviceListElement.elementIterator();
if (deviceListIterator != null) { if (deviceListIterator != null) {
Device device = storager.queryVideoDevice(deviceId); Device device = storager.queryVideoDevice(deviceId);
@ -477,12 +487,12 @@ public class MessageRequestProcessor extends SIPRequestAbstractProcessor {
deviceChannel.setParental(Integer.parseInt(XmlUtil.getText(itemDevice, "Parental"))); deviceChannel.setParental(Integer.parseInt(XmlUtil.getText(itemDevice, "Parental")));
} }
deviceChannel.setParentId(XmlUtil.getText(itemDevice, "ParentID")); deviceChannel.setParentId(XmlUtil.getText(itemDevice, "ParentID"));
if (XmlUtil.getText(itemDevice, "SafetyWay") == null || XmlUtil.getText(itemDevice, "SafetyWay")== "") { if (XmlUtil.getText(itemDevice, "SafetyWay") == null || XmlUtil.getText(itemDevice, "SafetyWay") == "") {
deviceChannel.setSafetyWay(0); deviceChannel.setSafetyWay(0);
} else { } else {
deviceChannel.setSafetyWay(Integer.parseInt(XmlUtil.getText(itemDevice, "SafetyWay"))); deviceChannel.setSafetyWay(Integer.parseInt(XmlUtil.getText(itemDevice, "SafetyWay")));
} }
if (XmlUtil.getText(itemDevice, "RegisterWay") == null || XmlUtil.getText(itemDevice, "RegisterWay") =="") { if (XmlUtil.getText(itemDevice, "RegisterWay") == null || XmlUtil.getText(itemDevice, "RegisterWay") == "") {
deviceChannel.setRegisterWay(1); deviceChannel.setRegisterWay(1);
} else { } else {
deviceChannel.setRegisterWay(Integer.parseInt(XmlUtil.getText(itemDevice, "RegisterWay"))); deviceChannel.setRegisterWay(Integer.parseInt(XmlUtil.getText(itemDevice, "RegisterWay")));
@ -501,7 +511,7 @@ public class MessageRequestProcessor extends SIPRequestAbstractProcessor {
deviceChannel.setEndTime(XmlUtil.getText(itemDevice, "EndTime")); deviceChannel.setEndTime(XmlUtil.getText(itemDevice, "EndTime"));
deviceChannel.setSecrecy(XmlUtil.getText(itemDevice, "Secrecy")); deviceChannel.setSecrecy(XmlUtil.getText(itemDevice, "Secrecy"));
deviceChannel.setIpAddress(XmlUtil.getText(itemDevice, "IPAddress")); deviceChannel.setIpAddress(XmlUtil.getText(itemDevice, "IPAddress"));
if (XmlUtil.getText(itemDevice, "Port") == null || XmlUtil.getText(itemDevice, "Port") =="") { if (XmlUtil.getText(itemDevice, "Port") == null || XmlUtil.getText(itemDevice, "Port") == "") {
deviceChannel.setPort(0); deviceChannel.setPort(0);
} else { } else {
deviceChannel.setPort(Integer.parseInt(XmlUtil.getText(itemDevice, "Port"))); deviceChannel.setPort(Integer.parseInt(XmlUtil.getText(itemDevice, "Port")));
@ -512,7 +522,7 @@ public class MessageRequestProcessor extends SIPRequestAbstractProcessor {
} else { } else {
deviceChannel.setLongitude(Double.parseDouble(XmlUtil.getText(itemDevice, "Longitude"))); deviceChannel.setLongitude(Double.parseDouble(XmlUtil.getText(itemDevice, "Longitude")));
} }
if (XmlUtil.getText(itemDevice, "Latitude") == null || XmlUtil.getText(itemDevice, "Latitude") =="") { if (XmlUtil.getText(itemDevice, "Latitude") == null || XmlUtil.getText(itemDevice, "Latitude") == "") {
deviceChannel.setLatitude(0.00); deviceChannel.setLatitude(0.00);
} else { } else {
deviceChannel.setLatitude(Double.parseDouble(XmlUtil.getText(itemDevice, "Latitude"))); deviceChannel.setLatitude(Double.parseDouble(XmlUtil.getText(itemDevice, "Latitude")));
@ -537,6 +547,7 @@ public class MessageRequestProcessor extends SIPRequestAbstractProcessor {
publisher.onlineEventPublish(deviceId, VideoManagerConstants.EVENT_ONLINE_KEEPLIVE); publisher.onlineEventPublish(deviceId, VideoManagerConstants.EVENT_ONLINE_KEEPLIVE);
} }
} }
}
} catch (DocumentException | SipException | InvalidArgumentException | ParseException e) { } catch (DocumentException | SipException | InvalidArgumentException | ParseException e) {
e.printStackTrace(); e.printStackTrace();
} }
@ -723,11 +734,7 @@ public class MessageRequestProcessor extends SIPRequestAbstractProcessor {
} }
} }
/**
* 收到MediaStatus消息处理
*
* @param evt
*/
private void processMessageMediaStatus(RequestEvent evt){ private void processMessageMediaStatus(RequestEvent evt){
try { try {
// 回复200 OK // 回复200 OK

BIN
src/main/resources/wvp.sqlite

Binary file not shown.
Loading…
Cancel
Save