[SR-Users] Meaning of empty body in NOTIFY

Daniel-Constantine Mierla miconda at gmail.com
Fri Jun 10 16:07:21 CEST 2011



On Jun 10, 2011, at 12:27 PM, Eugen Dedu <Eugen.Dedu at pu-pm.univ-fcomte.fr> wrote:

> On 10/06/11 12:18, Daniel-Constantin Mierla wrote:
>> Hello,
>> 
>> On 6/10/11 12:04 PM, Eugen Dedu wrote:
>>> Thank you very much for your answer.
>>> 
>>> Do you confirm that for kamailio, when a user has not been online
>>> since a long time ago, (1) it answers with an empty body notify (and
>>> not with a body with Offline status), and more importantly (2) that
>>> this means the user is offline?
>>> 
>>> I ask this because this seems contradictory to what SIP standard says
>>> (see below): it does not say that empty body means offline, but just
>>> does not have "meaningful state".
>>> 
>>> In fact, opal (SIP library among others) developers (in CC) consider
>>> that empty body means no information (which is different than
>>> offline!), while kamailio uses it for offline!
>> it is not for online, it is like the others understood -- an empty body
>> does not change anything. Because of that I said that if the UA knew the
>> user is offline, it stays offline. When a UA has a user with online
>> state, if it is a notify with empty body, stays like that, nothing changes.
> 
> Ok.  But this happens when I start my application, so it does not know anything about the contacts, and it receives empty body.  So, even after this notify, it still does not know anything about that contact, is that right?

What happens if there is no reply to subscribe and no notify? Is it considered offline? If yes, then probably should stay the same for first notify with empty body.

Iirc it is a must to send a body to tell the subscription state.

> 
> Also, as the user is offline (not connected since long time ago), why then kamailio sends an empty body for him instead of sending Offline status?  This would allow the application to correctly show him as offline, instead of "nothing known".  I noticed that even after several minutes no Offline status is sent by kamailio.

The presence server sends notifications with documents published by phones. If there is no such document, I see no reason to build one, unless the user demanded that via some preferences - it would be xcap - I haven't searched the specs, just my expectation based on simple presence architecture.

> 
>>> On 09/06/11 13:10, Daniel-Constantin Mierla wrote:
>>>> Hello,
>>>> 
>>>> the notify is sent to inform about the state of the subscription, which
>>>> is active in this case. If it would the first subscription to that user
>>>> and force_active will not be set, then should be subscription state
>>>> pending, iirc.
>>>> 
>>>> The empty body does not change anything to the phone information about
>>>> the watched presentity, which was known to be offline.
>>>> 
>>>> Cheers,
>>>> Daniel
>>>> 
>>>> On 6/8/11 10:06 PM, Eugen Dedu wrote:
>>>>> No idea?
>>>>> 
>>>>> On 05/06/11 22:31, Eugen Dedu wrote:
>>>>>> Hi,
>>>>>> 
>>>>>> ekiga.net registrar uses kamailio 1.5.3 (yes, a bit old...) and for
>>>>>> users who are not registered an empty NOTIFY body is returned when
>>>>>> asked
>>>>>> by a SUBSCRIBE. What does this mean from SIP standard point of
>>>>>> view, and
>>>>>> from kamailio point of view (are they identical?) I see in
>>>>>> RFC3265/3.1.6.2:
>>>>>> .... If the resource
>>>>>> has no meaningful state at the time that the SUBSCRIBE message is
>>>>>> processed, this NOTIFY message MAY contain an empty or neutral body
>>>>>> but is difficult for me to interpret what it means.
>>>>>> 
>>>>>> Example: I ask the presence for a user xyz who registered and quit
>>>>>> application long time ago:
>>>>>> 
>>>>>> SUBSCRIBE sip:xyz at ekiga.net SIP/2.0
>>>>>> CSeq: 1 SUBSCRIBE
>>>>>> Via: SIP/2.0/UDP
>>>>>> 82.238.108.175:5060;branch=z9hG4bKdabe824f-1a8e-e011-9efc-0024d693d8e8;rport
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> User-Agent: Ekiga/3.3.1
>>>>>> From:
>>>>>> <sip:eugen.dedu at ekiga.net>;tag=4888824f-1a8e-e011-9efc-0024d693d8e8
>>>>>> Call-ID: f602824f-1a8e-e011-9efc-0024d693d8e8 at snoopy
>>>>>> Supported: eventlist
>>>>>> To: <sip:xyz at ekiga.net>
>>>>>> Accept: application/pidf+xml
>>>>>> Accept: multipart/related
>>>>>> Accept: application/rlmi+xml
>>>>>> Contact: <sip:eugen.dedu at 82.238.108.175:5060>
>>>>>> Allow:
>>>>>> INVITE,ACK,OPTIONS,BYE,CANCEL,SUBSCRIBE,NOTIFY,REFER,MESSAGE,INFO,PING,PRACK
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> Expires: 300
>>>>>> Event: presence
>>>>>> Content-Length: 0
>>>>>> Max-Forwards: 70
>>>>>> 
>>>>>> I receive the following answer:
>>>>>> 
>>>>>> NOTIFY sip:eugen.dedu at 82.238.108.175:5060 SIP/2.0
>>>>>> CSeq: 1 NOTIFY
>>>>>> Via: SIP/2.0/UDP 86.64.162.35;branch=z9hG4bK2a99.b8a72c47.0
>>>>>> User-Agent: Kamailio (1.5.3-notls (i386/linux))
>>>>>> From: sip:xyz at ekiga.net;tag=f85b0bd16aaafa8479586ac9f88b3198-10a0
>>>>>> Call-ID: f602824f-1a8e-e011-9efc-0024d693d8e8 at snoopy
>>>>>> To: sip:eugen.dedu at ekiga.net;tag=4888824f-1a8e-e011-9efc-0024d693d8e8
>>>>>> Contact: <sip:86.64.162.35:5060>
>>>>>> Subscription-State: active;expires=370
>>>>>> Event: presence
>>>>>> Content-Length: 0
>>>>>> Max-Forwards: 70
>>>>>> 
>>>>>> To resume: What does SIP standard say about this NOTIFY with empty
>>>>>> body?
>>>>>> Does this mean that the user xyz is offline?
>>>>>> 
>>>>>> Or does this mean that user's status has not changed? In fact, the
>>>>>> NOTIFY with empty body (as shown above) is the first one sent by
>>>>>> kamailio, so there is no "previous" state of that user, hence
>>>>>> "unchanged" status has no meaning.
>>>>>> 
>>>>>> Thank you,
>> 



More information about the sr-users mailing list