public SipServletRequest createRequest(SipApplicationSession sipAppSession, String method, URI from, URI to, String handler) { if (logger.isDebugEnabled()) { logger .debug("Creating new SipServletRequest for SipApplicationSession[" + sipAppSession + "] METHOD[" + method + "] FROM_URI[" + from + "] TO_URI[" + to + "]"); } validateCreation(method, sipAppSession); //javadoc specifies that a copy of the uri should be done hence the clone Address toA = this.createAddress(to.clone()); Address fromA = this.createAddress(from.clone()); try { return createSipServletRequest(sipAppSession, method, fromA, toA, handler, null, null); } catch (ServletParseException e) { logger.error("Error creating sipServletRequest", e); return null; } }
@Override public SipServletRequest createRequestWithCallID(SipApplicationSession sipAppSession, String method, URI from, URI to, String callID){ if (logger.isDebugEnabled()) { logger .debug("Creating new SipServletRequest for SipApplicationSession[" + sipAppSession + "] METHOD[" + method + "] FROM_URI[" + from + "] TO_URI[" + to + "]"); } validateCreation(method, sipAppSession); //javadoc specifies that a copy of the uri should be done hence the clone Address toA = this.createAddress(to.clone()); Address fromA = this.createAddress(from.clone()); try { String handler = ((MobicentsSipApplicationSession)sipAppSession).getCurrentRequestHandler(); return createSipServletRequest(sipAppSession, method, fromA, toA, handler, callID, null); } catch (ServletParseException e) { logger.error("Error creating sipServletRequest", e); return null; } }
URIImpl requestURI = (URIImpl)to.getURI().clone();