Commit fc74ce9de4c38d56ee429893758776eeb5432e9b
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
Showing
7 changed files
with
21 additions
and
8 deletions
src/main/java/com/genersoft/iot/vmp/conf/security/WebSecurityConfig.java
| ... | ... | @@ -25,6 +25,7 @@ import org.springframework.web.cors.UrlBasedCorsConfigurationSource; |
| 25 | 25 | |
| 26 | 26 | import java.util.ArrayList; |
| 27 | 27 | import java.util.Arrays; |
| 28 | +import java.util.Collections; | |
| 28 | 29 | |
| 29 | 30 | /** |
| 30 | 31 | * 配置Spring Security |
| ... | ... | @@ -135,8 +136,14 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { |
| 135 | 136 | corsConfiguration.setAllowedHeaders(Arrays.asList("*")); |
| 136 | 137 | corsConfiguration.setAllowedMethods(Arrays.asList("*")); |
| 137 | 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 | 147 | corsConfiguration.setExposedHeaders(Arrays.asList(JwtUtils.getHeader())); |
| 141 | 148 | |
| 142 | 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 | 613 | */ |
| 614 | 614 | @Override |
| 615 | 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 | 620 | List<SsrcTransaction> ssrcTransactionList = streamSession.getSsrcTransactionForAll(device.getDeviceId(), channelId, callId, stream); |
| 617 | 621 | if (ssrcTransactionList == null || ssrcTransactionList.isEmpty()) { |
| 618 | 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 | 818 | // 发送redis消息 |
| 819 | 819 | redisGbPlayMsgListener.sendMsg(streamPushItem.getServerId(), streamPushItem.getMediaServerId(), |
| 820 | 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 | 822 | SendRtpItem sendRtpItem = responseSendItemMsg.getSendRtpItem(); |
| 823 | 823 | if (sendRtpItem == null || responseSendItemMsg.getMediaServerItem() == null) { |
| 824 | 824 | logger.warn("服务器端口资源不足"); | ... | ... |
src/main/java/com/genersoft/iot/vmp/media/zlm/AssistRESTfulUtils.java
| ... | ... | @@ -161,6 +161,7 @@ public class AssistRESTfulUtils { |
| 161 | 161 | if (mediaServerItem == null) { |
| 162 | 162 | return null; |
| 163 | 163 | } |
| 164 | + logger.info("[访问assist]: {}, 参数: {}", url, param); | |
| 164 | 165 | JSONObject responseJSON = new JSONObject(); |
| 165 | 166 | //-2自定义流媒体 调用错误码 |
| 166 | 167 | responseJSON.put("code",-2); | ... | ... |
src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java
| 1 | 1 | package com.genersoft.iot.vmp.storager.impl; |
| 2 | 2 | |
| 3 | +import com.baomidou.dynamic.datasource.annotation.DS; | |
| 3 | 4 | import com.genersoft.iot.vmp.conf.SipConfig; |
| 4 | 5 | import com.genersoft.iot.vmp.conf.UserSetting; |
| 5 | 6 | import com.genersoft.iot.vmp.gb28181.bean.*; |
| ... | ... | @@ -38,6 +39,7 @@ import java.util.concurrent.ConcurrentHashMap; |
| 38 | 39 | */ |
| 39 | 40 | @SuppressWarnings("rawtypes") |
| 40 | 41 | @Component |
| 42 | +@DS("master") | |
| 41 | 43 | public class VideoManagerStorageImpl implements IVideoManagerStorage { |
| 42 | 44 | |
| 43 | 45 | private final Logger logger = LoggerFactory.getLogger(VideoManagerStorageImpl.class); | ... | ... |
src/main/resources/all-application.yml
| ... | ... | @@ -237,7 +237,7 @@ user-settings: |
| 237 | 237 | register-again-after-time: 60 |
| 238 | 238 | # 国标续订方式,true为续订,每次注册在同一个会话里,false为重新注册,每次使用新的会话 |
| 239 | 239 | register-keep-int-dialog: false |
| 240 | - # 跨域配置,配置你访问前端页面的地址即可, 可以配置多个 | |
| 240 | + # 跨域配置,不配置此项则允许所有跨域请求,配置后则只允许配置的页面的地址请求, 可以配置多个 | |
| 241 | 241 | allowed-origins: |
| 242 | 242 | - http://localhost:8008 |
| 243 | 243 | - http://192.168.1.3:8008 | ... | ... |
src/main/resources/application-dev.yml
| ... | ... | @@ -110,8 +110,7 @@ user-settings: |
| 110 | 110 | auto-apply-play: true |
| 111 | 111 | # 设备/通道状态变化时发送消息 |
| 112 | 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 | ... | ... |