From 2a1f979651340fbf9b530ab2d2f9e5857cbeeb1a Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期四, 02 十二月 2021 17:37:29 +0800 Subject: [PATCH] 简化zlm节点接入逻辑 --- src/main/java/com/genersoft/iot/vmp/gb28181/SipLayer.java | 20 +++----------------- 1 files changed, 3 insertions(+), 17 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/SipLayer.java b/src/main/java/com/genersoft/iot/vmp/gb28181/SipLayer.java index 3d9b827..f3d542c 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/SipLayer.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/SipLayer.java @@ -2,6 +2,7 @@ import com.genersoft.iot.vmp.conf.SipConfig; import com.genersoft.iot.vmp.gb28181.event.SipSubscribe; +import com.genersoft.iot.vmp.gb28181.transmit.ISIPProcessorObserver; import com.genersoft.iot.vmp.gb28181.transmit.SIPProcessorObserver; import gov.nist.javax.sip.SipProviderImpl; import gov.nist.javax.sip.SipStackImpl; @@ -28,27 +29,11 @@ private SipConfig sipConfig; @Autowired - private SIPProcessorObserver sipProcessorObserver; - - @Autowired - private SipSubscribe sipSubscribe; + private ISIPProcessorObserver sipProcessorObserver; private SipStackImpl sipStack; private SipFactory sipFactory; - - /** - * 娑堟伅澶勭悊鍣ㄧ嚎绋嬫睜 - */ - private ThreadPoolExecutor processThreadPool; - - public SipLayer() { - int processThreadNum = Runtime.getRuntime().availableProcessors() * 10; - LinkedBlockingQueue<Runnable> processQueue = new LinkedBlockingQueue<>(10000); - processThreadPool = new ThreadPoolExecutor(processThreadNum,processThreadNum, - 0L,TimeUnit.MILLISECONDS,processQueue, - new ThreadPoolExecutor.CallerRunsPolicy()); - } @Bean("sipFactory") @@ -85,6 +70,7 @@ try { tcpListeningPoint = sipStack.createListeningPoint(sipConfig.getMonitorIp(), sipConfig.getPort(), "TCP"); tcpSipProvider = (SipProviderImpl)sipStack.createSipProvider(tcpListeningPoint); + tcpSipProvider.setDialogErrorsAutomaticallyHandled(); tcpSipProvider.addSipListener(sipProcessorObserver); logger.info("Sip Server TCP 鍚姩鎴愬姛 port {" + sipConfig.getMonitorIp() + ":" + sipConfig.getPort() + "}"); } catch (TransportNotSupportedException e) { -- Gitblit v1.8.0