question: protected Request createRequest ( String method , AddressFactory addressFactory , HeaderFactory headerFactory , MessageFactory messageFactory , SipProvider srcProvider , SipProvider dstProvider , String contentType , String contentSubType , Object content ) throws Exception { ListeningPoint srclp = srcProvider . getListeningPoints ( ) [ 0 ] ; SipURI srcSipURI = addressFactory . createSipURI ( null , srclp . getIPAddress ( ) ) ; srcSipURI . setPort ( srclp . getPort ( ) ) ; srcSipURI . setTransportParam ( srclp . getTransport ( ) ) ; ListeningPoint dstlp = dstProvider . getListeningPoints ( ) [ 0 ] ; SipURI dstSipURI = addressFactory . createSipURI ( null , dstlp . getIPAddress ( ) ) ; dstSipURI . setPort ( dstlp . getPort ( ) ) ; dstSipURI . setTransportParam ( dstlp . getTransport ( ) ) ; CallIdHeader callId = srcProvider . getNewCallId ( ) ; callId = headerFactory . createCallIdHeader ( callId . getCallId ( ) ) ; CSeqHeader cSeq = headerFactory . createCSeqHeader ( 1L , method ) ; Address fromAddress = addressFactory . createAddress ( srcSipURI ) ; FromHeader from = headerFactory . createFromHeader ( fromAddress , Integer . toString ( srcProvider . hashCode ( ) ) ) ; Address toAddress = addressFactory . createAddress ( dstSipURI ) ; ToHeader to = headerFactory . createToHeader ( toAddress , null ) ; ContactHeader contact = headerFactory . createContactHeader ( fromAddress ) ; List via = new LinkedList ( ) ; ViaHeader viaHeader = headerFactory . createViaHeader ( srclp . getIPAddress ( ) , srclp . getPort ( ) , srclp . getTransport ( ) , "z9hG4bK" + Long . toString ( System . currentTimeMillis ( ) ) ) ; via . add ( viaHeader ) ; MaxForwardsHeader maxForwards = headerFactory . createMaxForwardsHeader ( 3 ) ; Request request = messageFactory . createRequest ( dstSipURI , method , callId , cSeq , from , to , via , maxForwards ) ; request . addHeader ( contact ) ; if ( contentType != null && contentSubType != null && content != null ) { ContentTypeHeader contentTypeHdr = headerFactory . createContentTypeHeader ( contentType , contentSubType ) ; request . setContent ( content , contentTypeHdr ) ; } addStatus ( headerFactory , request ) ; return request ; }
target:  Creates a SipRequest using the specified factories. The request has the specified method and is meant to be sent from srcProvider to dstProvider. This method is prefered to manual creation of requests as it helps avoid using RI objects instead of corresponding TI objects (or vice versa).