|
|
@ -36,9 +36,9 @@ public class SIPProcessorObserver implements ISIPProcessorObserver { |
|
|
|
@Autowired |
|
|
|
private SipSubscribe sipSubscribe; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
@Qualifier(value = "taskExecutor") |
|
|
|
private ThreadPoolTaskExecutor poolTaskExecutor; |
|
|
|
// @Autowired
|
|
|
|
// @Qualifier(value = "taskExecutor")
|
|
|
|
// private ThreadPoolTaskExecutor poolTaskExecutor;
|
|
|
|
|
|
|
|
/** |
|
|
|
* 添加 request订阅 |
|
|
@ -71,9 +71,8 @@ public class SIPProcessorObserver implements ISIPProcessorObserver { |
|
|
|
* @param requestEvent RequestEvent事件 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Async |
|
|
|
public void processRequest(RequestEvent requestEvent) { |
|
|
|
|
|
|
|
poolTaskExecutor.execute(() -> { |
|
|
|
String method = requestEvent.getRequest().getMethod(); |
|
|
|
ISIPRequestProcessor sipRequestProcessor = requestProcessorMap.get(method); |
|
|
|
if (sipRequestProcessor == null) { |
|
|
@ -81,7 +80,6 @@ public class SIPProcessorObserver implements ISIPProcessorObserver { |
|
|
|
return; |
|
|
|
} |
|
|
|
requestProcessorMap.get(method).process(requestEvent); |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
@ -90,18 +88,9 @@ public class SIPProcessorObserver implements ISIPProcessorObserver { |
|
|
|
* @param responseEvent responseEvent事件 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Async |
|
|
|
public void processResponse(ResponseEvent responseEvent) { |
|
|
|
logger.debug(responseEvent.getResponse().toString()); |
|
|
|
// CSeqHeader cseqHeader = (CSeqHeader) responseEvent.getResponse().getHeader(CSeqHeader.NAME);
|
|
|
|
// String method = cseqHeader.getMethod();
|
|
|
|
// ISIPResponseProcessor sipRequestProcessor = responseProcessorMap.get(method);
|
|
|
|
// if (sipRequestProcessor == null) {
|
|
|
|
// logger.warn("不支持方法{}的response", method);
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
// sipRequestProcessor.process(responseEvent);
|
|
|
|
|
|
|
|
poolTaskExecutor.execute(() -> { |
|
|
|
Response response = responseEvent.getResponse(); |
|
|
|
logger.debug(responseEvent.getResponse().toString()); |
|
|
|
int status = response.getStatusCode(); |
|
|
@ -138,7 +127,6 @@ public class SIPProcessorObserver implements ISIPProcessorObserver { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|