Showing
7 changed files
with
9 additions
and
14 deletions
@@ -4,6 +4,7 @@ import com.fasterxml.jackson.databind.JsonNode; | @@ -4,6 +4,7 @@ import com.fasterxml.jackson.databind.JsonNode; | ||
4 | import lombok.Getter; | 4 | import lombok.Getter; |
5 | import lombok.extern.slf4j.Slf4j; | 5 | import lombok.extern.slf4j.Slf4j; |
6 | import org.springframework.beans.factory.annotation.Value; | 6 | import org.springframework.beans.factory.annotation.Value; |
7 | +import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; | ||
7 | import org.springframework.stereotype.Component; | 8 | import org.springframework.stereotype.Component; |
8 | import org.thingsboard.server.common.data.id.EntityId; | 9 | import org.thingsboard.server.common.data.id.EntityId; |
9 | import org.thingsboard.server.common.data.yunteng.config.media.ZLMediaKitServerConfig; | 10 | import org.thingsboard.server.common.data.yunteng.config.media.ZLMediaKitServerConfig; |
@@ -24,6 +25,8 @@ import java.util.Optional; | @@ -24,6 +25,8 @@ import java.util.Optional; | ||
24 | 25 | ||
25 | @Component("ZLMediaKitState") | 26 | @Component("ZLMediaKitState") |
26 | @TbCoreComponent | 27 | @TbCoreComponent |
28 | +@ConditionalOnExpression( | ||
29 | + "'${service.type:null}'=='tb-transport' || ('${service.type:null}'=='monolith' && '${transport.api_enabled:true}'=='true' && '${transport.gbt28181.enabled}'=='true')") | ||
27 | @Slf4j | 30 | @Slf4j |
28 | public class ZLMediaKitStateRunner { | 31 | public class ZLMediaKitStateRunner { |
29 | private final ZLMediaKitRestFulUtils zlMediaKitRestFulUtils; | 32 | private final ZLMediaKitRestFulUtils zlMediaKitRestFulUtils; |
@@ -720,7 +720,7 @@ transport: | @@ -720,7 +720,7 @@ transport: | ||
720 | # Local CoAP transport parameters | 720 | # Local CoAP transport parameters |
721 | gbt28181: | 721 | gbt28181: |
722 | # Enable/disable gbt28181 transport protocol. | 722 | # Enable/disable gbt28181 transport protocol. |
723 | - enabled: "${GBT28181_ENABLED:true}" | 723 | + enabled: "${GBT28181_ENABLED:false}" |
724 | tcp: | 724 | tcp: |
725 | # Enable/disable tcp transport protocol. | 725 | # Enable/disable tcp transport protocol. |
726 | enabled: "${TCP_ENABLED:true}" | 726 | enabled: "${TCP_ENABLED:true}" |
@@ -1232,7 +1232,7 @@ sip: | @@ -1232,7 +1232,7 @@ sip: | ||
1232 | # 如果要监听多张网卡,可以使用逗号分隔多个IP, 例如: 192.168.1.4,10.0.0.4 | 1232 | # 如果要监听多张网卡,可以使用逗号分隔多个IP, 例如: 192.168.1.4,10.0.0.4 |
1233 | # 如果不明白,就使用0.0.0.0,大部分情况都是可以的 | 1233 | # 如果不明白,就使用0.0.0.0,大部分情况都是可以的 |
1234 | # 请不要使用127.0.0.1,任何包括localhost在内的域名都是不可以的。 | 1234 | # 请不要使用127.0.0.1,任何包括localhost在内的域名都是不可以的。 |
1235 | - ip: ${GBT28181_SIP_IP:192.168.1.15} | 1235 | + ip: ${GBT28181_SIP_IP:127.0.0.1} |
1236 | # [可选] 28181服务监听的端口 | 1236 | # [可选] 28181服务监听的端口 |
1237 | port: ${GBT28181_SIP_PORT:5060} | 1237 | port: ${GBT28181_SIP_PORT:5060} |
1238 | #[可选] | 1238 | #[可选] |
@@ -1248,7 +1248,7 @@ sip: | @@ -1248,7 +1248,7 @@ sip: | ||
1248 | media: | 1248 | media: |
1249 | id: ${GBT28181_MEDIA_GENERAL_ID:D2okJWKKaQ5bX7Va} | 1249 | id: ${GBT28181_MEDIA_GENERAL_ID:D2okJWKKaQ5bX7Va} |
1250 | # [必须修改] zlm服务器的内网IP | 1250 | # [必须修改] zlm服务器的内网IP |
1251 | - ip: ${GBT28181_MEDIA_IP:192.168.1.20} | 1251 | + ip: ${GBT28181_MEDIA_IP:127.0.0.1} |
1252 | # [必须修改] zlm服务器的http.port | 1252 | # [必须修改] zlm服务器的http.port |
1253 | http-port: ${GBT28181_MEDIA_HTTP_PORT:28080} | 1253 | http-port: ${GBT28181_MEDIA_HTTP_PORT:28080} |
1254 | # [可选] zlm服务器的hook.admin_params=secret | 1254 | # [可选] zlm服务器的hook.admin_params=secret |
@@ -15,8 +15,6 @@ import org.thingsboard.server.common.data.yunteng.enums.SessionTypeEnum; | @@ -15,8 +15,6 @@ import org.thingsboard.server.common.data.yunteng.enums.SessionTypeEnum; | ||
15 | /** 视频流session管理器,管理视频预览、预览回放的通信句柄 */ | 15 | /** 视频流session管理器,管理视频预览、预览回放的通信句柄 */ |
16 | @Component | 16 | @Component |
17 | @Slf4j | 17 | @Slf4j |
18 | -@ConditionalOnExpression( | ||
19 | - "'${service.type:null}'=='tb-transport' || ('${service.type:null}'=='monolith' && '${transport.api_enabled:true}'=='true' && '${transport.gbt28181.enabled}'=='true')") | ||
20 | public class VideoStreamSessionManager { | 18 | public class VideoStreamSessionManager { |
21 | 19 | ||
22 | @Autowired private UserSetting userSetting; | 20 | @Autowired private UserSetting userSetting; |
@@ -11,7 +11,6 @@ import javax.sip.message.Request; | @@ -11,7 +11,6 @@ import javax.sip.message.Request; | ||
11 | import javax.sip.message.Response; | 11 | import javax.sip.message.Response; |
12 | import lombok.extern.slf4j.Slf4j; | 12 | import lombok.extern.slf4j.Slf4j; |
13 | import org.springframework.beans.factory.annotation.Autowired; | 13 | import org.springframework.beans.factory.annotation.Autowired; |
14 | -import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; | ||
15 | import org.springframework.stereotype.Component; | 14 | import org.springframework.stereotype.Component; |
16 | import org.springframework.util.ObjectUtils; | 15 | import org.springframework.util.ObjectUtils; |
17 | import org.thingsboard.server.common.data.yunteng.config.media.ThingsKitVersionConfig; | 16 | import org.thingsboard.server.common.data.yunteng.config.media.ThingsKitVersionConfig; |
@@ -21,8 +20,6 @@ import org.thingsboard.server.transport.util.TKSipUtils; | @@ -21,8 +20,6 @@ import org.thingsboard.server.transport.util.TKSipUtils; | ||
21 | 20 | ||
22 | /** 发送SIP信息 */ | 21 | /** 发送SIP信息 */ |
23 | @Component | 22 | @Component |
24 | -@ConditionalOnExpression( | ||
25 | - "'${service.type:null}'=='tb-transport' || ('${service.type:null}'=='monolith' && '${transport.api_enabled:true}'=='true' && '${transport.gbt28181.enabled}'=='true')") | ||
26 | @Slf4j | 23 | @Slf4j |
27 | public class SIPSender { | 24 | public class SIPSender { |
28 | 25 |
@@ -10,15 +10,12 @@ import javax.sip.address.AddressFactory; | @@ -10,15 +10,12 @@ import javax.sip.address.AddressFactory; | ||
10 | import javax.sip.address.SipURI; | 10 | import javax.sip.address.SipURI; |
11 | import javax.sip.header.*; | 11 | import javax.sip.header.*; |
12 | import org.springframework.beans.factory.annotation.Autowired; | 12 | import org.springframework.beans.factory.annotation.Autowired; |
13 | -import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; | ||
14 | import org.springframework.stereotype.Component; | 13 | import org.springframework.stereotype.Component; |
15 | import org.thingsboard.server.common.data.yunteng.config.media.SipConfig; | 14 | import org.thingsboard.server.common.data.yunteng.config.media.SipConfig; |
16 | import org.thingsboard.server.common.data.yunteng.config.media.ThingsKitVersionConfig; | 15 | import org.thingsboard.server.common.data.yunteng.config.media.ThingsKitVersionConfig; |
17 | import org.thingsboard.server.transport.gbt28181.SipLayer; | 16 | import org.thingsboard.server.transport.gbt28181.SipLayer; |
18 | 17 | ||
19 | @Component | 18 | @Component |
20 | -@ConditionalOnExpression( | ||
21 | - "'${service.type:null}'=='tb-transport' || ('${service.type:null}'=='monolith' && '${transport.api_enabled:true}'=='true' && '${transport.gbt28181.enabled}'=='true')") | ||
22 | public class AbstractSIPRequestProcess { | 19 | public class AbstractSIPRequestProcess { |
23 | @Autowired private SipConfig sipConfig; | 20 | @Autowired private SipConfig sipConfig; |
24 | @Autowired protected ThingsKitVersionConfig thingsKitVersionConfig; | 21 | @Autowired protected ThingsKitVersionConfig thingsKitVersionConfig; |
@@ -15,15 +15,12 @@ import javax.sip.address.SipURI; | @@ -15,15 +15,12 @@ import javax.sip.address.SipURI; | ||
15 | import javax.sip.header.*; | 15 | import javax.sip.header.*; |
16 | import javax.sip.message.Request; | 16 | import javax.sip.message.Request; |
17 | import javax.sip.message.Response; | 17 | import javax.sip.message.Response; |
18 | -import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; | ||
19 | import org.springframework.stereotype.Component; | 18 | import org.springframework.stereotype.Component; |
20 | import org.thingsboard.server.common.data.yunteng.dto.sip.SipMessageHeaderDTO; | 19 | import org.thingsboard.server.common.data.yunteng.dto.sip.SipMessageHeaderDTO; |
21 | import org.thingsboard.server.transport.session.GbtDeviceSessionCtx; | 20 | import org.thingsboard.server.transport.session.GbtDeviceSessionCtx; |
22 | import org.thingsboard.server.transport.util.TKSipUtils; | 21 | import org.thingsboard.server.transport.util.TKSipUtils; |
23 | 22 | ||
24 | @Component | 23 | @Component |
25 | -@ConditionalOnExpression( | ||
26 | - "'${service.type:null}'=='tb-transport' || ('${service.type:null}'=='monolith' && '${transport.api_enabled:true}'=='true' && '${transport.gbt28181.enabled}'=='true')") | ||
27 | public class SIPRequestHeaderProcess extends AbstractSIPRequestProcess { | 24 | public class SIPRequestHeaderProcess extends AbstractSIPRequestProcess { |
28 | public Request createMessageRequest( | 25 | public Request createMessageRequest( |
29 | GbtDeviceSessionCtx sessionCtx, | 26 | GbtDeviceSessionCtx sessionCtx, |
@@ -6,12 +6,15 @@ import org.slf4j.Logger; | @@ -6,12 +6,15 @@ import org.slf4j.Logger; | ||
6 | import org.slf4j.LoggerFactory; | 6 | import org.slf4j.LoggerFactory; |
7 | import org.springframework.beans.factory.InitializingBean; | 7 | import org.springframework.beans.factory.InitializingBean; |
8 | import org.springframework.beans.factory.annotation.Autowired; | 8 | import org.springframework.beans.factory.annotation.Autowired; |
9 | +import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; | ||
9 | import org.springframework.stereotype.Component; | 10 | import org.springframework.stereotype.Component; |
10 | import org.thingsboard.server.transport.gbt28181.ITimeoutProcessor; | 11 | import org.thingsboard.server.transport.gbt28181.ITimeoutProcessor; |
11 | import org.thingsboard.server.transport.SIPProcessorObserver; | 12 | import org.thingsboard.server.transport.SIPProcessorObserver; |
12 | import org.thingsboard.server.transport.gbt28181.SipSubscribe; | 13 | import org.thingsboard.server.transport.gbt28181.SipSubscribe; |
13 | 14 | ||
14 | @Component | 15 | @Component |
16 | +@ConditionalOnExpression( | ||
17 | + "'${service.type:null}'=='tb-transport' || ('${service.type:null}'=='monolith' && '${transport.api_enabled:true}'=='true' && '${transport.gbt28181.enabled}'=='true')") | ||
15 | public class TimeoutProcessorImpl implements InitializingBean, ITimeoutProcessor { | 18 | public class TimeoutProcessorImpl implements InitializingBean, ITimeoutProcessor { |
16 | 19 | ||
17 | private Logger logger = LoggerFactory.getLogger(TimeoutProcessorImpl.class); | 20 | private Logger logger = LoggerFactory.getLogger(TimeoutProcessorImpl.class); |