String redirect_Url=sipBusyUrl.replaceAll("calleeid", targetId);
printLog("Incoming SIP Call - Channel busy - Redirect to: "+redirect_Url ,LogLevel.LOW);
Message resp=MessageFactory.createResponse(msg,302,SipResponses.reasonOf(302),new NameAddress(redirect_Url));
InviteTransactionServer ts=new InviteTransactionServer(this,msg,null);
ts.respondWith(resp);
return;
}
printLog("Invite Request - Sending busy response (486)",LogLevel.MEDIUM);
InviteTransactionServer ts=new InviteTransactionServer(this,msg,null);
ts.respondWith(MessageFactory.createResponse(msg,486,SipResponses.reasonOf(486),null));
return;
}
if (msg.isRequest() && msg.isNotify())
{
// nobody handled it, just respond 405 (method not allowed) to get it to go away
printLog("Notify Request - Sending unsupported response (405)",LogLevel.MEDIUM);
TransactionServer ts=new TransactionServer(this,msg,null);
ts.respondWith(MessageFactory.createResponse(msg,405,SipResponses.reasonOf(405),null));
return;
}
// if we are here, no listener_ID matched..
printLog("No SipListener found matching that message: message DISCARDED",LogLevel.HIGH);