public void processRequest(RequestEvent requestEvent) {
//Invite received
if(requestEvent.getRequest().getMethod().equals(Request.INVITE)){
//System.out.println("INVITE bekommen");
try {
ServerTransaction serverTransaction = requestEvent.getServerTransaction();
if(serverTransaction==null){
serverTransaction = sipProvider.getNewServerTransaction(requestEvent.getRequest());
}
Response responseRing = messageFactory.createResponse(Response.RINGING, requestEvent.getRequest());
responseRing.addHeader(contactHeader);
serverTransaction.sendResponse(responseRing);
//System.out.println("Ringing sent");
//System.out.println("Ringing sent");
Response responseOk = messageFactory.createResponse(Response.OK, requestEvent.getRequest());
responseOk.addHeader(contactHeader);
serverTransaction.sendResponse(responseOk);
//System.out.println("OK sent");
//System.out.println("Ok sent");
} catch (SipException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InvalidArgumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
if(requestEvent.getRequest().getMethod().equals(Request.ACK))
{
//System.out.println("ACK bekommen");
//System.out.println("ACK bekommen");
//System.out.println(requestEvent.getDialog());
}
if(requestEvent.getRequest().getMethod().equals(Request.BYE))
{
//System.out.println("BYE bekommen");
//System.out.println("Bye bekommen");
//System.out.println(requestEvent.getDialog());
Response responseOk;
try {
responseOk = messageFactory.createResponse(Response.OK, requestEvent.getRequest());
ServerTransaction serverTransaction = requestEvent.getServerTransaction();
serverTransaction.sendResponse(responseOk);
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SipException e) {