HP-UX C SIP Stack Programmer's Guide (Novembery 2007)

246 HP-UX C SIP Stack Programmers Guide
Subscription State Machine
RVSIP_SUBS_STATE_ACTIVATED
When a notifier subscription wants to move from PENDING state to ACTIVE
state, it sends a NOTIFY request with a “Subscription-State:active” header in it.
When sending the request, the subscription assumes the ACTIVATED state.
When the notifier receives a 2xx response for this NOTIFY request, the
subscription assumes the ACTIVE state. If the notifier receives a non-2xx
response for this NOTIFY request, it remains in the ACTIVATED state.
RVSIP_SUBS_STATE_ACTIVE
The subscription is active—this state indicates a successful subscription
establishment.
A subscriber subscription reaches this state when a 2xx final response is
received for the initial SUBSCRIBE request, and a NOTIFY request with
“active” as the Subscription-state header value is received and accepted.
A notifier subscription reaches this state when a 200 final response is sent for an
initial SUBSCRIBE request, or when a 2xx response is received for a NOTIFY
request with “active” as the Subscription-State header value.
RVSIP_SUBS_STATE_REFRESHING
A subscriber subscription in ACTIVE state may call the Refresh() function to
send a refresh SUBSCRIBE request. After sending the refresh SUBSCRIBE
request, the subscription enters the REFRESHING state. The subscription
remains in this state until it receives a final response from the notifier.
If a 2xx class response is received, the subscription sets the subscription timer to
the new value that both the subscriber and notifier had agreed on in the refresh
SUBSCRIBE message and the 2xx response. If a non-2xx response is received,
the subscription timer remains as it was.
In both cases, when a response is received to the refresh SUBSCRIBE request,
the subscription assumes the ACTIVE state.
RVSIP_SUBS_STATE_REFRESH_RCVD
Upon receipt of a refresh SUBSCRIBE request by a notifier subscription, the
subscription assumes the REFRESH_RCVD state. In this state, the application
must decide whether to accept or reject the subscription refreshing using the
Subscription API.