________________________________________
From: [email protected] 
[[email protected]] On Behalf Of [email protected] 
[[email protected]]

The new version of sipXtackLib (4.2) doesn't seem to support sending of NOTIFY 
messages
with empty body.It treats Subscription as failure instead.
_______________________________________________

Yes, this is intentional.  Subscriptions are handled by the SipSubscribeServer 
class.  The model is that the SipSubscribeServer object maintains a database of 
values for the subscribable URIs.  The "application" updates the database when 
the values change.  On the "outside", the SipSubscribeServer object receives 
incoming SUBSCRIBE messages and generates NOTIFYs as necessary.

The question arises of how the SipSubscribeServer knows which URIs can be 
subscribed to, and which "do not exist", that is, SUBSCRIBEs to them should 
receive 404 responses and not establish a subscription.  Previously, *all* URIs 
were subscribable; if there was no value in the database, a NOTIFY was returned 
that had no body.  This produced poor results, as an element that mistakenly 
subscribed to an invalid URI would receive a 200 response.  The new behavior is 
that a URI is subscribable only if there is data for the URI in the database; 
if there is none, the SUBSCRIBE fails with a 404 response.

However, if you set up "default" content (see SipPublishContentMgr.h for the 
details), then if a SUBSCRIBE arrives for a URI for which there is no content 
in the database, the subscription will be allowed and default content will be 
provided for that URI (or the "default content constructor" will be called to 
provide the content).

There are no plans to truly allow sending NOTIFY with no body, as that would be 
pointless.  Although it is possible to store a body which is the null string.  
However, it still must have a proper MIME type, so the NOTIFY "has a body which 
has zero bytes" rather than "has no body" -- the Content-Type is set 
appropriately.

Dale
_______________________________________________
sipx-dev mailing list
[email protected]
List Archive: http://list.sipfoundry.org/archive/sipx-dev/

Reply via email to