throw new NullPointerException("SipSession is null");
if (!sipSession.isValid())
throw new IllegalArgumentException("SipSession " + sipSession + " is not valid");
Session session = ((SessionIf) sipSession).getSession();
if (session.isProxy())
throw new IllegalArgumentException("SipSession " + session + " is proxy");
if (session.getUA() == null)
session.createUA(mode);
List<SipServletMessage> messages = new ArrayList<SipServletMessage>();
if (mode == UAMode.UAS)
{
for (ServerTransaction tx : session.getCallSession().getServerTransactions(session))
{
if (!tx.getRequest().isCommitted())
messages.add(tx.getRequest());
}
}
else
{
for (ClientTransaction tx : session.getCallSession().getClientTransactions(session))
{
if (!tx.isCompleted())
messages.add(tx.getRequest());
}
}
messages.addAll(session.getUA().getUncommitted2xx(mode));
messages.addAll(session.getUA().getUncommitted1xx(mode));
Collections.sort(messages, new Comparator() {
public int compare(Object message1, Object message2)
{
long cseq1 = ((SipMessage) message1).getCSeq().getNumber();