public boolean respondToReinvite(SipTransaction siptrans, int statusCode, String reasonPhrase,
      int expires, String newContact, String displayName, ArrayList<Header> additionalHeaders,
      ArrayList<Header> replaceHeaders, String body) {
    initErrorInfo();

    try {
      ContactHeader contact_hdr = null;
      if (newContact == null) {
        contact_hdr = (ContactHeader) parent.getContactInfo().getContactHeader().clone();
      } else {
        contact_hdr = parent.updateContactInfo(newContact, displayName);
      }

      if (additionalHeaders == null)
        additionalHeaders = new ArrayList<>();

      additionalHeaders.add(contact_hdr);

      if (parent.sendReply(siptrans, statusCode, reasonPhrase, null, null, expires,
          additionalHeaders, replaceHeaders, body) == null) {
        setException(parent.getException());
        setErrorMessage(parent.getErrorMessage());
        setReturnCode(parent.getReturnCode());

        return false;
      }

      return true;
    } catch (Exception ex) {
      setException(ex);
      setErrorMessage("Exception: " + ex.getClass().getName() + ": " + ex.getMessage());
      setReturnCode(SipSession.EXCEPTION_ENCOUNTERED);
      return false;
    }

  }
public boolean respondToReinvite ( SipTransaction siptrans , int statusCode , String reasonPhrase , int expires , String newContact , String displayName , ArrayList < Header > additionalHeaders , ArrayList < Header > replaceHeaders , String body ) { initErrorInfo ( ) ; try { ContactHeader contact_hdr = null ; if ( newContact == null ) { contact_hdr = ( ContactHeader ) parent . getContactInfo ( ) . getContactHeader ( ) . clone ( ) ; } else { contact_hdr = parent . updateContactInfo ( newContact , displayName ) ; } if ( additionalHeaders == null ) additionalHeaders = new ArrayList < > ( ) ; additionalHeaders . add ( contact_hdr ) ; if ( parent . sendReply ( siptrans , statusCode , reasonPhrase , null , null , expires , additionalHeaders , replaceHeaders , body ) == null ) { setException ( parent . getException ( ) ) ; setErrorMessage ( parent . getErrorMessage ( ) ) ; setReturnCode ( parent . getReturnCode ( ) ) ; return false ; } return true ; } catch ( Exception ex ) { setException ( ex ) ; setErrorMessage ( "Exception: " + ex . getClass ( ) . getName ( ) + ": " + ex . getMessage ( ) ) ; setReturnCode ( SipSession . EXCEPTION_ENCOUNTERED ) ; return false ; } }
This method is equivalent to the basic respondToReinvite() method except that it allows the
caller to specify additional JAIN-SIP API message headers to add to or replace in the outbound
message. Use of this method requires knowledge of the JAIN-SIP API.

<p>
NOTE: The additionalHeaders parameter passed to this method must contain a ContentTypeHeader in
order for a body to be included in the message.

<p>
The extra parameters supported by this method are:

@param additionalHeaders ArrayList of javax.sip.header.Header, each element a SIP header to add
to the outbound message. These headers are added to the message after a correct message
has been constructed. Note that if you try to add a header that there is only supposed
to be one of in a message, and it's already there and only one single value is allowed
for that header, then this header addition attempt will be ignored. Use the
'replaceHeaders' parameter instead if you want to replace the existing header with your
own. Use null for no additional message headers.

@param replaceHeaders ArrayList of javax.sip.header.Header, each element a SIP header to add to
the outbound message, replacing existing header(s) of that type if present in the
message. These headers are applied to the message after a correct message has been
constructed. Use null for no replacement of message headers.

@return true if the response was successfully sent, false otherwise.