SUBSCRIBE/NOTIFY
SUSCRIBE message is similar to "Measurement Control" or "Information Request" on Radio Protocol. It request the other party to report on any specific event or specific status.
NOTIFY is similar to "Measurement Report" or "Information Response" on Radio Protocol. Basically it delivers the information that is requested by SUBSCRIBE message. (For formal description of SUBSCRIBE/NOTIFY Procedure, refer to RFC3265 Session Initiation Protocol (SIP)-Specific Event Notification)
Overall sequence for SUBSCRIBE and NOTIFY goes as follows.

What kinds of Events are supported by SUBSCRIBE ?
Of course, the most commonly used event in SUBSCRIBE is 'reg' (for registration status check), but there are may other events are available. Formal information about these events are available at Session Initiation Protocol (SIP) Event Types Namespace. Following is the list of events that I often see in my area (SIP being used in IMS).
|
Event |
Description |
Reference |
| reg | Request for IMS/SIP Registration Status | RFC 3680 |
| presence | Request for presence information (commonly used in RCS) | RFC 3856 |
| winfo | Request for Watcher information (commonly used in RCS) | RFC 3857 |
| xcap-diff | Request for Xcap-Diff information (commonly used in RCS) | RFC 3875 |
Subscription States in NOTIFY message
When the NOTIFIER (usually CSCF) and there is not the case of errors (e.g, 481, 400, 500), the notifier send NOTIFY message with a specific Subscription-State information as follows in addition to the detailed subscribed information at the body of the message (Refer to Refer to "RFC3265 3.2.4. Subscriber NOTIFY Behavior" for further details) .
|
Subscription-State |
Description |
|
| active | It means the subscription is accepted (in most case, authorized as well) | |
| pending |
It means the subscription has been received by the notifier, but there is insufficient policy information to grant or deny the subscription yet |
|
| terminated | It means the subscription is terminated and this can specify as a reason code as follows | |
deactivated
|
This mean that the subscription ended (terminated) but the subscriber (UE) SHOULD retry with a new subscription immediately. |
|
probation
|
This mean that the subscription ended (terminated) but the client SHOULD retry at some time later. | |
rejected
|
This mean that the subscription ended (terminated) due to change in authorization policy. The client SHOULD NOT retry. | |
timeout
|
This mean that the subscription ended (terminated) because it is not refreshed before it expired. The client MAY retry immediately. | |
giveup
|
This mean that the subscription ended (terminated) because the notifier could not obtain authorization in time |
|
noresource
|
This mean that the subscription ended (terminated) because the resource being monitored is no longer available. |
|
Example 1 > : Event : reg
Step 1 : SUBSCRIBE -----------------------------------
SUBSCRIBE sip:+11234567890@test.3gpp.com SIP/2.0
Via: SIP/2.0/UDP 10.133.202.46:50997;branch=z9hG4bK2968d27245f17c7bcae38c31991bfdaa
Max-Forwards: 70
Contact: <sip:+11234567890@10.133.202.46:50997>;+sip.instance="<urn:gsma:imei:00440113-904785-0>"
To: <sip:+11234567890@test.3gpp.com>
From: <sip:+11234567890@test.3gpp.com>;tag=210a54
Call-ID: d57a0b04-785ba328-13a4d876@10.133.202.46
CSeq: 14534 SUBSCRIBE
Expires: 600000
User-Agent: IM-client/OMA1.0 DUT-IMS
Event: reg
Accept: application/reginfo+xml
P-Access-Network-Info: 3GPP-E-UTRAN-FDD;utran-cell-id-3gpp="0010100010000000"
P-Preferred-Identity: <sip:+11234567890@test.3gpp.com>
Content-Length: 0
Step 2 : 200 OK -----------------------------------
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.133.202.46:50997;branch=z9hG4bK2968d27245f17c7bcae38c31991bfdaa
From: <sip:+11234567890@test.3gpp.com>;tag=210a54
To: <sip:+11234567890@test.3gpp.com>;tag=987654321
Call-ID: d57a0b04-785ba328-13a4d876@10.133.202.46
CSeq: 14534 SUBSCRIBE
Expires: 600000
Contact: <sip:10.133.202.47:5060>
Record-Route: <sip:10.133.202.47;lr>
Content-Length: 0
Step 3 : NOTIFY -----------------------------------
NOTIFY sip:+11234567890@test.3gpp.com SIP/2.0
Via: SIP/2.0/UDP 10.133.202.47:5060;branch=z9hG4bK-d1e4c4961ca9d523ae76b67e088589cd
Call-ID: d57a0b04-785ba328-13a4d876@10.133.202.46
From: <sip:+11234567890@test.3gpp.com>;tag=987654321
To: <sip:+11234567890@test.3gpp.com>;tag=210a54
Subscription-State: active;expires=600000
Event: reg
CSeq: 14534 NOTIFY
Contact: <sip:10.133.202.47:5060>
Max-Forwards: 70
Content-Type: application/reginfo+xml
Content-Length: 340
<?xml version="1.0" encoding="UTF-8"?>
<reginfo xmlns="urn:ietf:params:xml:ns:reginfo" version="0" state="full">
<registration aor="sip:+11234567890@test.3gpp.com" id="12345" state="active">
<contact id="100" state="active" event="registered" expires="600000">
<uri>sip:+11234567890@10.133.202.46:50997</uri>
</contact>
</registration>
</reginfo>
Step 4 : 200 OK -----------------------------------
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.133.202.47:5060;branch=z9hG4bK-d1e4c4961ca9d523ae76b67e088589cd
Max-Forwards: 70
Contact: <sip:+11234567890@10.133.202.46:50997>;+sip.instance="<urn:gsma:imei:00440113-904785-0>"
To: <sip:+11234567890@test.3gpp.com>;tag=210a54
From: <sip:+11234567890@test.3gpp.com>;tag=987654321
Call-ID: d57a0b04-785ba328-13a4d876@10.133.202.46
CSeq: 14534 NOTIFY
Allow: NOTIFY,SUBSCRIBE
Content-Length: 0