From 60b8934a4b68962479c650840703d9796c433a1e Mon Sep 17 00:00:00 2001 From: Lawrence <1934378145@qq.com> Date: Wed, 10 Jun 2020 13:20:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=AF=B9invite=E5=90=8Etryin?= =?UTF-8?q?g=E5=93=8D=E5=BA=94=E7=9A=84=E5=A4=84=E7=90=86=EF=BC=8C?= =?UTF-8?q?=E9=81=BF=E5=85=8D=E8=AF=AF=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../genersoft/iot/vmp/gb28181/SipLayer.java | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 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 cfea0262..b70c5eb6 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/SipLayer.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/SipLayer.java @@ -59,10 +59,10 @@ public class SipLayer implements SipListener, Runnable { @PostConstruct private void initSipServer() { - Thread thread=new Thread(this); - thread.setDaemon(true); - thread.setName("sip server thread start"); - thread.start(); + Thread thread = new Thread(this); + thread.setDaemon(true); + thread.setName("sip server thread start"); + thread.start(); } @Override @@ -84,7 +84,7 @@ public class SipLayer implements SipListener, Runnable { * 0; public static final int TRACE_MESSAGES = 16; public static final int * TRACE_EXCEPTION = 17; public static final int TRACE_DEBUG = 32; */ - properties.setProperty("gov.nist.javax.sip.TRACE_LEVEL", "0"); + properties.setProperty("gov.nist.javax.sip.TRACE_LEVEL", "32"); properties.setProperty("gov.nist.javax.sip.SERVER_LOG", "sip_server_log"); properties.setProperty("gov.nist.javax.sip.DEBUG_LOG", "sip_debug_log"); sipStack = (SipStackImpl) sipFactory.createSipStack(properties); @@ -99,13 +99,15 @@ public class SipLayer implements SipListener, Runnable { } private void startTcpListener() throws Exception { - ListeningPoint tcpListeningPoint = sipStack.createListeningPoint(sipConfig.getSipIp(), sipConfig.getSipPort(), "TCP"); + ListeningPoint tcpListeningPoint = sipStack.createListeningPoint(sipConfig.getSipIp(), sipConfig.getSipPort(), + "TCP"); tcpSipProvider = sipStack.createSipProvider(tcpListeningPoint); tcpSipProvider.addSipListener(this); } private void startUdpListener() throws Exception { - ListeningPoint udpListeningPoint = sipStack.createListeningPoint(sipConfig.getSipIp(), sipConfig.getSipPort(), "UDP"); + ListeningPoint udpListeningPoint = sipStack.createListeningPoint(sipConfig.getSipIp(), sipConfig.getSipPort(), + "UDP"); udpSipProvider = sipStack.createSipProvider(udpListeningPoint); udpSipProvider.addSipListener(this); } @@ -127,13 +129,15 @@ public class SipLayer implements SipListener, Runnable { if ((status >= 200) && (status < 300)) { // Success! ISIPResponseProcessor processor = processorFactory.createResponseProcessor(evt); processor.process(evt, this, sipConfig); + } else if (status == Response.TRYING) { + // trying不会回复 } else { logger.warn("接收到失败的response响应!status:" + status + ",message:" + response.getContent().toString()); } // trying不会回复 - if (status == Response.TRYING) { + // if (status == Response.TRYING) { - } + // } } /**