code: public SipServletRequest createRequest(SipServletRequest origRequest,
              boolean linked, Map<String, List<String>> headerMap) throws TooManyHopsException {
  
          if (origRequest == null) {
              throw new NullPointerException("original request cannot be null");
          }
  
          if (origRequest.getMaxForwards() == 0) {
              throw new TooManyHopsException();
          }
  
          try {
              SipServletRequestImpl origRequestImpl = (SipServletRequestImpl) origRequest;
              SipServletRequestImpl newSipServletRequest = cloneRequest(origRequestImpl, headerMap);
              final MobicentsSipSession originalSession = origRequestImpl.getSipSession();
              final MobicentsSipApplicationSession appSession = originalSession
                      .getSipApplicationSession();
              final MobicentsSipSessionKey key = SessionManagerUtil.getSipSessionKey(appSession.getKey().getId(), originalSession.getKey().getApplicationName(), newSipServletRequest.getMessage(), false);
              final MobicentsSipSession session = appSession.getSipContext().getSipManager().getSipSession(key, true, sipFactoryImpl, appSession);
  
              linkedRequestMap.put(newSipServletRequest, origRequestImpl);
              linkedRequestMap.put(origRequestImpl, newSipServletRequest);
  
              if (linked) {
                  sessionMap.put(originalSession.getId(), session.getId());
                  sessionMap.put(session.getId(), originalSession.getId());
                  dumpLinkedSessions();
              }
              session.setB2buaHelper(this);
              originalSession.setB2buaHelper(this);
              session.setSessionCreatingTransactionRequest(newSipServletRequest);
              setOriginalRequest(session, newSipServletRequest);
  
              return newSipServletRequest;
          } catch (ParseException ex) {
              logger.error("Unexpected parse exception ", ex);
              throw new IllegalArgumentException(
                      "Illegal arg encountered while creating b2bua", ex);
          } catch (ServletException ex) {
              logger.error("Unexpected exception ", ex);
              throw new IllegalArgumentException(
                      "Unexpected problem while creating b2bua", ex);
          }
      }
docs: /*
  (non-Javadoc)
  @see javax.servlet.sip.B2buaHelper#createRequest(javax.servlet.sip.SipServletRequest, boolean, java.util.Map)