}
public void timeout(GeneralTimer timer) {
TransactionTimer tt = (TransactionTimer) timer.getInfo();
SipServletRequestImpl req = null;
Dispatcher d = null;
switch (tt) {
case TimerE:
synchronized (this) {
if ((_state == TRYING) || (_state == PROCEEDING)) {
long delay = T2; // default to PROCEEDING delay
if (_state == TRYING) {
// Have to dirty cast in order not to reimplement hole
// structure
delay = ((GeneralTimerImpl) timer).getDelay();
// calculate next timer*2 but less then T2 (4sec)
delay = ((delay * 2) <= T2) ? (delay * 2) : T2;
}
if (_timerE != null) {
_timerE.cancel();
}
// schedule new timer
_timerE = _timerService.createTimer(this, delay,
TimerE);
// resend the request
getRequest().restoreRetransmissionApplicationStack();
req = (SipServletRequestImpl) getRequest().clone();
}
}
// dispatch after synch block...
if (req != null) {
d = req.popDispatcher();
if (d != null) {
d.dispatch(req);
}
if (SipMonitoring.isEnabled(SipMonitoring.TRANSACTION_MANAGER)) {
updateLastAccessTimestamp();
}