// Respones should use the same link
req.pushTransactionDispatcher(this);
req.pushApplicationDispatcher(_networkManager);
// trigger reporter for network manager
Reporter reporter = _networkManager.getReporter();
if (reporter != null) {
reporter.logIncomingRequest(Reporter.InterceptionType.LAYER, req, NetworkManager.class.getSimpleName());
}
_nextLayer.next(req);
if (reporter != null) {
reporter.logPostIncomingRequest(Reporter.InterceptionType.LAYER, req, NetworkManager.class.getSimpleName(), null);
}
if (SipMonitoring.isEnabled(SipMonitoring.NETWORK_MANAGER)) {
_networkManager.incrEasReceivedSipRequests();
}
} else {
SipServletResponseImpl resp = (SipServletResponseImpl) message;
Header cseq = resp.getRawHeader(Header.CSEQ);
if (cseq == null) {
if (SipMonitoring.isEnabled(SipMonitoring.NETWORK_MANAGER)) {
_networkManager.incrEasInvalidSipMessages();
}
return; // Drop since missing required header
}
String c = cseq.getValue();
int index = c.indexOf(' ');
resp.setMethod(c.substring(index + 1));
if (_log.isLoggable(Level.FINE)) {
_log.log(Level.FINE,
"Network IN response " + resp.getStatus() + " " +
resp.getMethod() + " --> \r\n" + resp.toString());
}
// trigger reporter for network manager
Reporter reporter = _networkManager.getReporter();
if (reporter != null) {
reporter.logIncomingResponse(Reporter.InterceptionType.LAYER, resp, NetworkManager.class.getSimpleName());
}
_nextLayer.next(resp);
if (reporter != null) {
reporter.logPostIncomingResponse(Reporter.InterceptionType.LAYER, resp, NetworkManager.class.getSimpleName(), null);
}
if (SipMonitoring.isEnabled(SipMonitoring.NETWORK_MANAGER)) {
_networkManager.incrEasReceivedSipResponses();
}