public void processInvite(RequestEvent requestEvent,ServerTransaction serverTransaction){
  SipProvider sipProvider=(SipProvider)requestEvent.getSource();
  Request request=requestEvent.getRequest();
  initialInvitePayload=new String((byte[])request.getContent());
  try {
    serverTransaction=sipProvider.getNewServerTransaction(request);
    dialog=(DialogExt)sipProvider.getNewDialog(serverTransaction);
    dialog.disableSequenceNumberValidation();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  try {
    Response okResponse=messageFactory.createResponse(180,request);
    FromHeader from=(FromHeader)okResponse.getHeader(FromHeader.NAME);
    from.removeParameter("tag");
    Address address=addressFactory.createAddress("UAS <sip:" + myAddress + ":"+ myPort+ ">");
    ContactHeader contactHeader=headerFactory.createContactHeader(address);
    ToHeader toHeader=(ToHeader)okResponse.getHeader(ToHeader.NAME);
    toHeader.setTag("4321");
    FromHeader fromHeader=(FromHeader)okResponse.getHeader(FromHeader.NAME);
    fromHeader.setTag("12345");
    okResponse.addHeader(contactHeader);
    serverTransaction.sendResponse(okResponse);
  }
 catch (  Exception ex) {
    ex.printStackTrace();
  }
  try {
    Response okResponse=messageFactory.createResponse(200,request);
    FromHeader from=(FromHeader)okResponse.getHeader(FromHeader.NAME);
    from.removeParameter("tag");
    Address address=addressFactory.createAddress("UAS <sip:" + myAddress + ":"+ myPort+ ">");
    ContactHeader contactHeader=headerFactory.createContactHeader(address);
    ToHeader toHeader=(ToHeader)okResponse.getHeader(ToHeader.NAME);
    toHeader.setTag("4321");
    FromHeader fromHeader=(FromHeader)okResponse.getHeader(FromHeader.NAME);
    fromHeader.setTag("12345");
    okResponse.addHeader(contactHeader);
    serverTransaction.sendResponse(okResponse);
  }
 catch (  Exception ex) {
    ex.printStackTrace();
  }
}

public void processInvite ( RequestEvent requestEvent , ServerTransaction serverTransaction ) { SipProvider sipProvider = ( SipProvider ) requestEvent . getSource ( ) ; Request request = requestEvent . getRequest ( ) ; initialInvitePayload = new String ( ( byte [ ] ) request . getContent ( ) ) ; try { serverTransaction = sipProvider . getNewServerTransaction ( request ) ; dialog = ( DialogExt ) sipProvider . getNewDialog ( serverTransaction ) ; dialog . disableSequenceNumberValidation ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } try { Response okResponse = messageFactory . createResponse ( 180 , request ) ; FromHeader from = ( FromHeader ) okResponse . getHeader ( FromHeader . NAME ) ; from . removeParameter ( "tag" ) ; Address address = addressFactory . createAddress ( "UAS <sip:" + myAddress + ":" + myPort + ">" ) ; ContactHeader contactHeader = headerFactory . createContactHeader ( address ) ; ToHeader toHeader = ( ToHeader ) okResponse . getHeader ( ToHeader . NAME ) ; toHeader . setTag ( "4321" ) ; FromHeader fromHeader = ( FromHeader ) okResponse . getHeader ( FromHeader . NAME ) ; fromHeader . setTag ( "12345" ) ; okResponse . addHeader ( contactHeader ) ; serverTransaction . sendResponse ( okResponse ) ; } catch ( Exception ex ) { ex . printStackTrace ( ) ; } try { Response okResponse = messageFactory . createResponse ( 200 , request ) ; FromHeader from = ( FromHeader ) okResponse . getHeader ( FromHeader . NAME ) ; from . removeParameter ( "tag" ) ; Address address = addressFactory . createAddress ( "UAS <sip:" + myAddress + ":" + myPort + ">" ) ; ContactHeader contactHeader = headerFactory . createContactHeader ( address ) ; ToHeader toHeader = ( ToHeader ) okResponse . getHeader ( ToHeader . NAME ) ; toHeader . setTag ( "4321" ) ; FromHeader fromHeader = ( FromHeader ) okResponse . getHeader ( FromHeader . NAME ) ; fromHeader . setTag ( "12345" ) ; okResponse . addHeader ( contactHeader ) ; serverTransaction . sendResponse ( okResponse ) ; } catch ( Exception ex ) { ex . printStackTrace ( ) ; } }
process the invite request .
