public ServletTimer createTimer(SipApplicationSession appSession,
long delay, long period, boolean fixedDelay, boolean isPersistent,
Serializable info) {
if (period < 1) {
throw new IllegalArgumentException(
"Period should be greater than 0");
}
MobicentsSipApplicationSession sipApplicationSessionImpl = (MobicentsSipApplicationSession) appSession;
if (sipApplicationSessionImpl.isValid() == false) {
throw new IllegalStateException("Sip application session has been invalidated!!!");
}
if (!sipApplicationSessionImpl.hasTimerListener()) {
throw new IllegalStateException("No Timer listeners have been configured for this application ");
}
TimerListener timerListener = sipApplicationSessionImpl.getSipContext().getListeners().getTimerListener();
ServletTimerImpl servletTimer = createTimerLocaly(timerListener , delay, period, fixedDelay,isPersistent, info,sipApplicationSessionImpl);
return servletTimer;
}