Advertisement
Guest User

Untitled

a guest
May 26th, 2015
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.14 KB | None | 0 0
  1. public void processRequest(RequestEvent evt) {
  2. try {
  3. Request req = evt.getRequest();
  4. String method = req.getMethod();
  5. boolean debugEnabled = JainSipUtils.isDebugEnabled(req);
  6.  
  7. resetMDC();
  8.  
  9. if (debugEnabled) {
  10. MDC.put(Wx2DynamicThresholdFilter.LOG_LEVEL_MDC_KEY, "debug");
  11. }
  12.  
  13.  
  14. // Add callFlow logging.
  15. TrackingId.setCallId(evt.getServerTransaction().getDialog().getCallId().toString());
  16. if(method.equals(Request.INVITE)) {
  17. // For invite log even the callId. This is needed for the call-flow
  18. // tool to correlate Locus-Id and Call-Id when rendering.
  19. WebSequenceUtil.renderInboundSipRequest(method, "CallId:" + JainSipUtils.getCallId(req));
  20.  
  21. } else {
  22. WebSequenceUtil.renderInboundSipRequest(method, "");
  23. }
  24.  
  25. if(logger.isDebugEnabled()) {
  26. logger.debug("processRequest: {}", SipLogger.obfuscateMessage(evt.getRequest().toString()));
  27. }
  28.  
  29. if(method.equals(Request.INVITE)) {
  30. doInvite(evt);
  31. } else if(method.equals(Request.INFO)) {
  32. doInfo(evt);
  33. } else if(method.equals(Request.OPTIONS)) {
  34. doOptions(evt);
  35. } else if(method.equals(Request.BYE)) {
  36. doBye(evt);
  37. } else if(method.equals(Request.ACK)) {
  38. doAck(evt);
  39. } else if(method.equals(Request.CANCEL)) {
  40. doCancel(evt);
  41. } else {
  42. JainSipStack sipStack = getSipStack(req);
  43. sipStack.sendResponse(evt.getServerTransaction(), req, null, Response.NOT_IMPLEMENTED);
  44. }
  45. } catch(IOException e) {
  46. logger.info("processRequest exception", e);
  47. } catch(ServletException e) {
  48. logger.info("processRequest exception", e);
  49. } finally {
  50. logger.debug("processRequest complete for {}", evt.getRequest().getMethod());
  51. resetMDC();
  52. TrackingId.clear();
  53. }
  54. TrackingId.clear();
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement