Browse Source

增加同步通道超时时间,修复hookIP空字符串时的hookIP的默认值赋值

pull/110/head
64850858 4 years ago
parent
commit
ecb5b69101
  1. 22
      src/main/java/com/genersoft/iot/vmp/conf/MediaConfig.java
  2. 2
      src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceQuery.java

22
src/main/java/com/genersoft/iot/vmp/conf/MediaConfig.java

@ -14,6 +14,9 @@ public class MediaConfig {
@Value("${media.hookIp:${sip.ip}}")
private String hookIp;
@Value("${sip.ip}")
private String sipIp;
@Value("${media.sdpIp:${media.ip}}")
private String sdpIp;
@ -68,7 +71,12 @@ public class MediaConfig {
}
public String getHookIp() {
return hookIp;
if (StringUtils.isEmpty(hookIp)){
return sipIp;
}else {
return hookIp;
}
}
public void setHookIp(String hookIp) {
@ -76,7 +84,11 @@ public class MediaConfig {
}
public String getSdpIp() {
return sdpIp;
if (StringUtils.isEmpty(sdpIp)){
return ip;
}else {
return sdpIp;
}
}
public void setSdpIp(String sdpIp) {
@ -84,7 +96,11 @@ public class MediaConfig {
}
public String getStreamIp() {
return streamIp;
if (StringUtils.isEmpty(streamIp)){
return ip;
}else {
return streamIp;
}
}
public void setStreamIp(String streamIp) {

2
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceQuery.java

@ -149,7 +149,7 @@ public class DeviceQuery {
msg.setData(String.format("同步通道失败,错误码: %s, %s", response.getStatusCode(), response.getReasonPhrase()));
resultHolder.invokeResult(msg);
});
DeferredResult<ResponseEntity<Device>> result = new DeferredResult<ResponseEntity<Device>>(2*1000L);
DeferredResult<ResponseEntity<Device>> result = new DeferredResult<ResponseEntity<Device>>(15*1000L);
result.onTimeout(()->{
logger.warn(String.format("设备通道信息同步超时"));
// 释放rtpserver

Loading…
Cancel
Save