修复sip消息订阅事件移除失败的BUG
This commit is contained in:
@@ -34,5 +34,5 @@ public class SipConfig {
|
||||
|
||||
private boolean alarm = false;
|
||||
|
||||
private long timeout = 15;
|
||||
private long timeout = 150;
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ public class SIPProcessorObserver implements ISIPProcessorObserver {
|
||||
SipSubscribe.EventResult<ResponseEvent> eventResult = new SipSubscribe.EventResult<>(responseEvent);
|
||||
sipEvent.getOkEvent().response(eventResult);
|
||||
}
|
||||
sipSubscribe.removeSubscribe(callIdHeader.getCallId());
|
||||
sipSubscribe.removeSubscribe(callIdHeader.getCallId() + cSeqHeader.getSeqNumber());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -118,7 +118,7 @@ public class SIPProcessorObserver implements ISIPProcessorObserver {
|
||||
SipSubscribe.EventResult<ResponseEvent> eventResult = new SipSubscribe.EventResult<>(responseEvent);
|
||||
sipEvent.getErrorEvent().response(eventResult);
|
||||
}
|
||||
sipSubscribe.removeSubscribe(callIdHeader.getCallId());
|
||||
sipSubscribe.removeSubscribe(callIdHeader.getCallId() + cSeqHeader.getSeqNumber());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,12 +75,14 @@ public class SIPSender {
|
||||
CSeqHeader cSeqHeader = (CSeqHeader) message.getHeader(CSeqHeader.NAME);
|
||||
String key = callIdHeader.getCallId() + cSeqHeader.getSeqNumber();
|
||||
SipEvent sipEvent = SipEvent.getInstance(key, eventResult -> {
|
||||
sipSubscribe.removeSubscribe(callIdHeader.getCallId());
|
||||
log.info("success");
|
||||
sipSubscribe.removeSubscribe(key);
|
||||
if(okEvent != null) {
|
||||
okEvent.response(eventResult);
|
||||
}
|
||||
}, (eventResult -> {
|
||||
sipSubscribe.removeSubscribe(callIdHeader.getCallId());
|
||||
log.info("eror");
|
||||
sipSubscribe.removeSubscribe(key);
|
||||
if (errorEvent != null) {
|
||||
errorEvent.response(eventResult);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user