Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void processRequest(RequestEvent evt) {
- try {
- Request req = evt.getRequest();
- String method = req.getMethod();
- boolean debugEnabled = JainSipUtils.isDebugEnabled(req);
- resetMDC();
- if (debugEnabled) {
- MDC.put(Wx2DynamicThresholdFilter.LOG_LEVEL_MDC_KEY, "debug");
- }
- // Add callFlow logging.
- TrackingId.setCallId(evt.getServerTransaction().getDialog().getCallId().toString());
- if(method.equals(Request.INVITE)) {
- // For invite log even the callId. This is needed for the call-flow
- // tool to correlate Locus-Id and Call-Id when rendering.
- WebSequenceUtil.renderInboundSipRequest(method, "CallId:" + JainSipUtils.getCallId(req));
- } else {
- WebSequenceUtil.renderInboundSipRequest(method, "");
- }
- if(logger.isDebugEnabled()) {
- logger.debug("processRequest: {}", SipLogger.obfuscateMessage(evt.getRequest().toString()));
- }
- if(method.equals(Request.INVITE)) {
- doInvite(evt);
- } else if(method.equals(Request.INFO)) {
- doInfo(evt);
- } else if(method.equals(Request.OPTIONS)) {
- doOptions(evt);
- } else if(method.equals(Request.BYE)) {
- doBye(evt);
- } else if(method.equals(Request.ACK)) {
- doAck(evt);
- } else if(method.equals(Request.CANCEL)) {
- doCancel(evt);
- } else {
- JainSipStack sipStack = getSipStack(req);
- sipStack.sendResponse(evt.getServerTransaction(), req, null, Response.NOT_IMPLEMENTED);
- }
- } catch(IOException e) {
- logger.info("processRequest exception", e);
- } catch(ServletException e) {
- logger.info("processRequest exception", e);
- } finally {
- logger.debug("processRequest complete for {}", evt.getRequest().getMethod());
- resetMDC();
- TrackingId.clear();
- }
- TrackingId.clear();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement