RFC3265 (SUBSCRIBE/NOTIFY) section 3.3.4 specifies that the ending of a
subscription does not necessarily imply the ending of the dialog, as is the case
here, as the dialog was established with an INVITE and that has not yet been
There are two points in the code where a NOTIFY with "Subscription-State:
terminated" causes the SipSession to go to TERMINATED:
1. When the NOTIFY is sent, in
2. When the 200 OK for the NOTIFY is received, in
These places in the code should not be unconditionally setting the session state
to TERMINATED, instead they should be checking if there are further uses for the
session, such as other subscriptions or an INVITE application state.
However, unless I'm missing something, at the above places in the code I don't
see any state variables that would indicate that there is still an INVITE
transaction active. It seems the source of the problem occurs much earlier, in
com.ericsson.ssa.sip.UA.getFSM(SipServletMessage), where a single FSM is picked
based solely on the request method, and it seems that the SUBSCRIBE_REFERSession
does not have any knowledge of the other INVITESession.
Another point, it seems
does not work properly. It returns false when "Subscription-State:
terminated;reason=noresource", which is the header as required by the REFER RFC.
I actually see some commented out code and TODO's in UA.java that refers to
"multidialogs e.g. within a subscribe session" and such things, with references
"Not implemented, optimization for application pgm" ... ?
Used code from b30 promoted.