Commit 60b8934a4b68962479c650840703d9796c433a1e

Authored by Lawrence
1 parent 89c62240

修正对invite后trying响应的处理,避免误报错

src/main/java/com/genersoft/iot/vmp/gb28181/SipLayer.java
@@ -59,10 +59,10 @@ public class SipLayer implements SipListener, Runnable { @@ -59,10 +59,10 @@ public class SipLayer implements SipListener, Runnable {
59 59
60 @PostConstruct 60 @PostConstruct
61 private void initSipServer() { 61 private void initSipServer() {
62 - Thread thread=new Thread(this);  
63 - thread.setDaemon(true);  
64 - thread.setName("sip server thread start");  
65 - thread.start(); 62 + Thread thread = new Thread(this);
  63 + thread.setDaemon(true);
  64 + thread.setName("sip server thread start");
  65 + thread.start();
66 } 66 }
67 67
68 @Override 68 @Override
@@ -84,7 +84,7 @@ public class SipLayer implements SipListener, Runnable { @@ -84,7 +84,7 @@ public class SipLayer implements SipListener, Runnable {
84 * 0; public static final int TRACE_MESSAGES = 16; public static final int 84 * 0; public static final int TRACE_MESSAGES = 16; public static final int
85 * TRACE_EXCEPTION = 17; public static final int TRACE_DEBUG = 32; 85 * TRACE_EXCEPTION = 17; public static final int TRACE_DEBUG = 32;
86 */ 86 */
87 - properties.setProperty("gov.nist.javax.sip.TRACE_LEVEL", "0"); 87 + properties.setProperty("gov.nist.javax.sip.TRACE_LEVEL", "32");
88 properties.setProperty("gov.nist.javax.sip.SERVER_LOG", "sip_server_log"); 88 properties.setProperty("gov.nist.javax.sip.SERVER_LOG", "sip_server_log");
89 properties.setProperty("gov.nist.javax.sip.DEBUG_LOG", "sip_debug_log"); 89 properties.setProperty("gov.nist.javax.sip.DEBUG_LOG", "sip_debug_log");
90 sipStack = (SipStackImpl) sipFactory.createSipStack(properties); 90 sipStack = (SipStackImpl) sipFactory.createSipStack(properties);
@@ -99,13 +99,15 @@ public class SipLayer implements SipListener, Runnable { @@ -99,13 +99,15 @@ public class SipLayer implements SipListener, Runnable {
99 } 99 }
100 100
101 private void startTcpListener() throws Exception { 101 private void startTcpListener() throws Exception {
102 - ListeningPoint tcpListeningPoint = sipStack.createListeningPoint(sipConfig.getSipIp(), sipConfig.getSipPort(), "TCP"); 102 + ListeningPoint tcpListeningPoint = sipStack.createListeningPoint(sipConfig.getSipIp(), sipConfig.getSipPort(),
  103 + "TCP");
103 tcpSipProvider = sipStack.createSipProvider(tcpListeningPoint); 104 tcpSipProvider = sipStack.createSipProvider(tcpListeningPoint);
104 tcpSipProvider.addSipListener(this); 105 tcpSipProvider.addSipListener(this);
105 } 106 }
106 107
107 private void startUdpListener() throws Exception { 108 private void startUdpListener() throws Exception {
108 - ListeningPoint udpListeningPoint = sipStack.createListeningPoint(sipConfig.getSipIp(), sipConfig.getSipPort(), "UDP"); 109 + ListeningPoint udpListeningPoint = sipStack.createListeningPoint(sipConfig.getSipIp(), sipConfig.getSipPort(),
  110 + "UDP");
109 udpSipProvider = sipStack.createSipProvider(udpListeningPoint); 111 udpSipProvider = sipStack.createSipProvider(udpListeningPoint);
110 udpSipProvider.addSipListener(this); 112 udpSipProvider.addSipListener(this);
111 } 113 }
@@ -127,13 +129,15 @@ public class SipLayer implements SipListener, Runnable { @@ -127,13 +129,15 @@ public class SipLayer implements SipListener, Runnable {
127 if ((status >= 200) && (status < 300)) { // Success! 129 if ((status >= 200) && (status < 300)) { // Success!
128 ISIPResponseProcessor processor = processorFactory.createResponseProcessor(evt); 130 ISIPResponseProcessor processor = processorFactory.createResponseProcessor(evt);
129 processor.process(evt, this, sipConfig); 131 processor.process(evt, this, sipConfig);
  132 + } else if (status == Response.TRYING) {
  133 + // trying不会回复
130 } else { 134 } else {
131 logger.warn("接收到失败的response响应!status:" + status + ",message:" + response.getContent().toString()); 135 logger.warn("接收到失败的response响应!status:" + status + ",message:" + response.getContent().toString());
132 } 136 }
133 // trying不会回复 137 // trying不会回复
134 - if (status == Response.TRYING) { 138 + // if (status == Response.TRYING) {
135 139
136 - } 140 + // }
137 } 141 }
138 142
139 /** 143 /**