/** Patch up the request line as necessary. */ protected void setRequestLineDefaults() { String method = requestLine.getMethod(); if (method == null) { CSeq cseq = (CSeq) this.getCSeq(); if (cseq != null) { method = getCannonicalName(cseq.getMethod()); requestLine.setMethod(method); } } }
/** * Create an ACK request from this request. This is suitable for generating an ACK for an INVITE * client transaction. * * @return an ACK request that is generated from this request. */ public SIPRequest createACKRequest() { RequestLine requestLine = (RequestLine) this.requestLine.clone(); requestLine.setMethod(Request.ACK); return this.createSIPRequest(requestLine, false); }
/** * Create a BYE request from this request. * * @param switchHeaders is a boolean flag that causes from and isServerTransaction to headers to * be swapped. Set this to true if you are the server of the dialog and are generating a BYE * request for the dialog. * @return a new default BYE request. */ public SIPRequest createBYERequest(boolean switchHeaders) { RequestLine requestLine = (RequestLine) this.requestLine.clone(); requestLine.setMethod("BYE"); return this.createSIPRequest(requestLine, switchHeaders); }