增加对水星IPC的兼容

增加对SIP错误的订阅,刷新通道或点播或回放出现sip错误时及时返回给页面
优化UI,增加按钮loading
This commit is contained in:
panlinlin
2020-12-26 16:44:27 +08:00
parent 17f4fe254a
commit f2279859b3
13 changed files with 176 additions and 46 deletions

View File

@@ -8,8 +8,10 @@ import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import javax.sip.*;
import javax.sip.header.CallIdHeader;
import javax.sip.message.Response;
import com.genersoft.iot.vmp.gb28181.event.SipSubscribe;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -34,6 +36,9 @@ public class SipLayer implements SipListener {
@Autowired
private SIPProcessorFactory processorFactory;
@Autowired
private SipSubscribe sipSubscribe;
private SipStack sipStack;
private SipFactory sipFactory;
@@ -139,11 +144,19 @@ public class SipLayer implements SipListener {
// 增加其它无需回复的响应如101、180等
} else {
logger.warn("接收到失败的response响应status" + status + ",message:" + response.getReasonPhrase()/* .getContent().toString()*/);
if (evt.getResponse() != null && sipSubscribe.getSize() > 0 ) {
CallIdHeader callIdHeader = (CallIdHeader)evt.getResponse().getHeader(CallIdHeader.NAME);
if (callIdHeader != null) {
SipSubscribe.Event subscribe = sipSubscribe.getSubscribe(callIdHeader.getCallId());
if (subscribe != null) {
subscribe.response(evt);
}
}
}
}
// trying不会回复
// if (status == Response.TRYING) {
// }
}
/**