Commit fc74ce9de4c38d56ee429893758776eeb5432e9b

Authored by 648540858
2 parents 33b12526 68fbc8fe

Merge branch '2.6.9' into wvp-28181-2.0

# Conflicts:
#	src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java
#	src/main/resources/application-dev.yml
src/main/java/com/genersoft/iot/vmp/conf/security/WebSecurityConfig.java
@@ -25,6 +25,7 @@ import org.springframework.web.cors.UrlBasedCorsConfigurationSource; @@ -25,6 +25,7 @@ import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
25 25
26 import java.util.ArrayList; 26 import java.util.ArrayList;
27 import java.util.Arrays; 27 import java.util.Arrays;
  28 +import java.util.Collections;
28 29
29 /** 30 /**
30 * 配置Spring Security 31 * 配置Spring Security
@@ -135,8 +136,14 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { @@ -135,8 +136,14 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
135 corsConfiguration.setAllowedHeaders(Arrays.asList("*")); 136 corsConfiguration.setAllowedHeaders(Arrays.asList("*"));
136 corsConfiguration.setAllowedMethods(Arrays.asList("*")); 137 corsConfiguration.setAllowedMethods(Arrays.asList("*"));
137 corsConfiguration.setMaxAge(3600L); 138 corsConfiguration.setMaxAge(3600L);
138 - corsConfiguration.setAllowCredentials(true);  
139 - corsConfiguration.setAllowedOrigins(userSetting.getAllowedOrigins()); 139 + if (userSetting.getAllowedOrigins() != null && !userSetting.getAllowedOrigins().isEmpty()) {
  140 + corsConfiguration.setAllowCredentials(true);
  141 + corsConfiguration.setAllowedOrigins(userSetting.getAllowedOrigins());
  142 + }else {
  143 + corsConfiguration.setAllowCredentials(false);
  144 + corsConfiguration.setAllowedOrigins(Collections.singletonList(CorsConfiguration.ALL));
  145 + }
  146 +
140 corsConfiguration.setExposedHeaders(Arrays.asList(JwtUtils.getHeader())); 147 corsConfiguration.setExposedHeaders(Arrays.asList(JwtUtils.getHeader()));
141 148
142 UrlBasedCorsConfigurationSource url = new UrlBasedCorsConfigurationSource(); 149 UrlBasedCorsConfigurationSource url = new UrlBasedCorsConfigurationSource();
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java
@@ -613,6 +613,10 @@ public class SIPCommander implements ISIPCommander { @@ -613,6 +613,10 @@ public class SIPCommander implements ISIPCommander {
613 */ 613 */
614 @Override 614 @Override
615 public void streamByeCmd(Device device, String channelId, String stream, String callId, SipSubscribe.Event okEvent) throws InvalidArgumentException, SipException, ParseException, SsrcTransactionNotFoundException { 615 public void streamByeCmd(Device device, String channelId, String stream, String callId, SipSubscribe.Event okEvent) throws InvalidArgumentException, SipException, ParseException, SsrcTransactionNotFoundException {
  616 + if (device == null) {
  617 + logger.warn("[发送BYE] device为null");
  618 + return;
  619 + }
616 List<SsrcTransaction> ssrcTransactionList = streamSession.getSsrcTransactionForAll(device.getDeviceId(), channelId, callId, stream); 620 List<SsrcTransaction> ssrcTransactionList = streamSession.getSsrcTransactionForAll(device.getDeviceId(), channelId, callId, stream);
617 if (ssrcTransactionList == null || ssrcTransactionList.isEmpty()) { 621 if (ssrcTransactionList == null || ssrcTransactionList.isEmpty()) {
618 logger.info("[发送BYE] 未找到事务信息,设备: device: {}, channel: {}", device.getDeviceId(), channelId); 622 logger.info("[发送BYE] 未找到事务信息,设备: device: {}, channel: {}", device.getDeviceId(), channelId);
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java
@@ -818,7 +818,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements @@ -818,7 +818,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
818 // 发送redis消息 818 // 发送redis消息
819 redisGbPlayMsgListener.sendMsg(streamPushItem.getServerId(), streamPushItem.getMediaServerId(), 819 redisGbPlayMsgListener.sendMsg(streamPushItem.getServerId(), streamPushItem.getMediaServerId(),
820 streamPushItem.getApp(), streamPushItem.getStream(), addressStr, port, ssrc, requesterId, 820 streamPushItem.getApp(), streamPushItem.getStream(), addressStr, port, ssrc, requesterId,
821 - channelId, mediaTransmissionTCP, platform.isRtcp(),null, responseSendItemMsg -> { 821 + channelId, mediaTransmissionTCP, platform.isRtcp(),platform.getName(), responseSendItemMsg -> {
822 SendRtpItem sendRtpItem = responseSendItemMsg.getSendRtpItem(); 822 SendRtpItem sendRtpItem = responseSendItemMsg.getSendRtpItem();
823 if (sendRtpItem == null || responseSendItemMsg.getMediaServerItem() == null) { 823 if (sendRtpItem == null || responseSendItemMsg.getMediaServerItem() == null) {
824 logger.warn("服务器端口资源不足"); 824 logger.warn("服务器端口资源不足");
src/main/java/com/genersoft/iot/vmp/media/zlm/AssistRESTfulUtils.java
@@ -161,6 +161,7 @@ public class AssistRESTfulUtils { @@ -161,6 +161,7 @@ public class AssistRESTfulUtils {
161 if (mediaServerItem == null) { 161 if (mediaServerItem == null) {
162 return null; 162 return null;
163 } 163 }
  164 + logger.info("[访问assist]: {}, 参数: {}", url, param);
164 JSONObject responseJSON = new JSONObject(); 165 JSONObject responseJSON = new JSONObject();
165 //-2自定义流媒体 调用错误码 166 //-2自定义流媒体 调用错误码
166 responseJSON.put("code",-2); 167 responseJSON.put("code",-2);
src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java
1 package com.genersoft.iot.vmp.storager.impl; 1 package com.genersoft.iot.vmp.storager.impl;
2 2
  3 +import com.baomidou.dynamic.datasource.annotation.DS;
3 import com.genersoft.iot.vmp.conf.SipConfig; 4 import com.genersoft.iot.vmp.conf.SipConfig;
4 import com.genersoft.iot.vmp.conf.UserSetting; 5 import com.genersoft.iot.vmp.conf.UserSetting;
5 import com.genersoft.iot.vmp.gb28181.bean.*; 6 import com.genersoft.iot.vmp.gb28181.bean.*;
@@ -38,6 +39,7 @@ import java.util.concurrent.ConcurrentHashMap; @@ -38,6 +39,7 @@ import java.util.concurrent.ConcurrentHashMap;
38 */ 39 */
39 @SuppressWarnings("rawtypes") 40 @SuppressWarnings("rawtypes")
40 @Component 41 @Component
  42 +@DS("master")
41 public class VideoManagerStorageImpl implements IVideoManagerStorage { 43 public class VideoManagerStorageImpl implements IVideoManagerStorage {
42 44
43 private final Logger logger = LoggerFactory.getLogger(VideoManagerStorageImpl.class); 45 private final Logger logger = LoggerFactory.getLogger(VideoManagerStorageImpl.class);
src/main/resources/all-application.yml
@@ -237,7 +237,7 @@ user-settings: @@ -237,7 +237,7 @@ user-settings:
237 register-again-after-time: 60 237 register-again-after-time: 60
238 # 国标续订方式,true为续订,每次注册在同一个会话里,false为重新注册,每次使用新的会话 238 # 国标续订方式,true为续订,每次注册在同一个会话里,false为重新注册,每次使用新的会话
239 register-keep-int-dialog: false 239 register-keep-int-dialog: false
240 - # 跨域配置,配置你访问前端页面的地址即可, 可以配置多个 240 + # 跨域配置,不配置此项则允许所有跨域请求,配置后则只允许配置的页面的地址请求, 可以配置多个
241 allowed-origins: 241 allowed-origins:
242 - http://localhost:8008 242 - http://localhost:8008
243 - http://192.168.1.3:8008 243 - http://192.168.1.3:8008
src/main/resources/application-dev.yml
@@ -110,8 +110,7 @@ user-settings: @@ -110,8 +110,7 @@ user-settings:
110 auto-apply-play: true 110 auto-apply-play: true
111 # 设备/通道状态变化时发送消息 111 # 设备/通道状态变化时发送消息
112 device-status-notify: true 112 device-status-notify: true
113 - # 跨域配置,配置你访问前端页面的地址即可, 可以配置多个  
114 - allowed-origins:  
115 - - http://localhost:8080  
116 - - http://127.0.0.1:8080 113 +# [可选] 日志配置, 一般不需要改
  114 +logging:
  115 + config: classpath:logback-spring-local.xml
117 116