code: public static void dumpMessage(String informationalHeader, javax.sip.message.Message msg) {
      LOG.trace(informationalHeader + "{}.......... \n {}", informationalHeader, msg);
  
      ListIterator rhdrs = msg.getHeaders(RouteHeader.NAME);
      while (rhdrs.hasNext()) {
        RouteHeader rhdr = (RouteHeader) rhdrs.next();
  
        if (rhdr != null) {
          LOG.trace("RouteHeader address: {}", rhdr.getAddress().toString());
          Iterator i = rhdr.getParameterNames();
          while (i.hasNext()) {
            String parm = (String) i.next();
            LOG.trace("RouteHeader parameter {}: {}", parm, rhdr.getParameter(parm));
          }
        }
      }
  
      ListIterator rrhdrs = msg.getHeaders(RecordRouteHeader.NAME);
      while (rrhdrs.hasNext()) {
        RecordRouteHeader rrhdr = (RecordRouteHeader) rrhdrs.next();
  
        if (rrhdr != null) {
          LOG.trace("RecordRouteHeader address: {}", rrhdr.getAddress());
          Iterator i = rrhdr.getParameterNames();
          while (i.hasNext()) {
            String parm = (String) i.next();
            LOG.trace("RecordRouteHeader parameter {}: {}", parm, rrhdr.getParameter(parm));
          }
        }
      }
    }
docs: Outputs to console the provided header string followed by the message.
  
  @param informationalHeader
  @param msg