I understand that no problem. And I'm doing exactly what you suggested
in another topic (How to handle application session expired), But as I
said, I have Application Session Listener, and when sessionExpired
been called, I go though all Sip Sessions within this application
session and check if state is NOT TERMINATED to extend application
session. The problem is: they are all terminated even I'm still on the
phone. (no BYE, CANCEL at all)
Anyway, instead of checking state (which is not so reliable to me, or
I didn't understand sip session life cycle correctly), I check
isReadyToInvalidate() like Sip Servlets 1.1 spec recommended in
6-2-4-1. That works fine in most cases as long as I invalid Sip
Session correctly (For example: for Register, OPTIONS request. for
INVITE request, it looks like system handling that). Only one issue
now: Sometime when I get Cancel from one leg, and try to forward to
another leg, "final response already sent" exception which cause
SipSession not invalidate correctly and cause application session
leak. I'm sure I'm not getting/sending any final response on that leg
yet. I'm trying to get a very detail log and may open another topic on
that issue later.
Thanks for your advice.
Noodle