Skip to content

Commit

Permalink
Better description of handle_subscribe().
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdan-iancu authored and razvancrainea committed Jan 12, 2015
1 parent f7a491d commit 74890a9
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 25 deletions.
33 changes: 20 additions & 13 deletions modules/presence/README
Expand Up @@ -468,19 +468,26 @@ modparam("presence", "end_sub_on_timeout", 0)

1.4.2. handle_subscribe(char* force_active)

The function which handles SUBSCRIBE requests. It stores or
updates information in database and calls functions to send
Notify messages when a Subscribe which initiate a dialog is
received

It can take one parameter meaningful when you use a
configuration with privacy rules enabled (force_active
parameter in presence_xml module not set). Supposing that you
have a means to tell that the contact the Subscribe message is
destined to( the presentity) can not upload an xcap document
with it's privacy rules, you can tell the presence server to
consider that subscription allowed(with
Subscription-Status:active) by calling handle_subscribe
This function is to be used for handling SUBSCRIBE requests. It
stores or updates the watcher/subscriber information in
database. Additionally, in response to initial SUBSCRIBE
requests (creating a new subscription session), the function
also sends back the NOTIFY (with the presence information) to
the wathcer/subscriber.

The function may take on parameter that controlls what is the
default policy (of the presentity) on accepting new
subscriptions (accept or reject) - of course, this paramter
makes sense only when using a presence configuration with
privacy rules enabled (force_active parameter in presence_xml
module is not set).

There are scenarios where the presentity (the party you
subscribe to) can not upload an XCAP document with it's privacy
rules (to controll which watchers are allowed to subscribe to
it). In such case, from script level, you can force the
presence server to consider the current subscription allowed
(with Subscription-Status:active) by calling handle_subscribe()
function with the string parameter "1".
Ex:
if(uri =~ "kphone@opensips.org")
Expand Down
32 changes: 20 additions & 12 deletions modules/presence/doc/presence_admin.xml
Expand Up @@ -552,18 +552,26 @@ modparam("presence", "end_sub_on_timeout", 0)
<function moreinfo="none">handle_subscribe(char* force_active)</function>
</title>
<para>
The function which handles SUBSCRIBE requests. It stores or
updates information in database and calls functions to send Notify
messages when a Subscribe which initiate a dialog is received
</para>
<para>
It can take one parameter meaningful when you use a configuration
with privacy rules enabled (force_active parameter in presence_xml
module not set). Supposing that you have a means to tell that the contact
the Subscribe message is destined to( the presentity) can not upload
an xcap document with it's privacy rules, you can tell the presence
server to consider that subscription allowed(with Subscription-Status:active)
by calling handle_subscribe function with the string parameter "1".
This function is to be used for handling SUBSCRIBE requests. It stores or
updates the watcher/subscriber information in database. Additionally, in
response to initial SUBSCRIBE requests (creating a new subscription session),
the function also sends back the NOTIFY (with the presence information) to
the wathcer/subscriber.
</para>
<para>
The function may take on parameter that controlls what is the default
policy (of the presentity) on accepting new subscriptions (accept or reject)
- of course, this paramter makes sense only when using
a presence configuration with privacy rules enabled (force_active parameter
in presence_xml module is not set).
</para>
<para>
There are scenarios where the presentity (the party you subscribe to) can not
upload an XCAP document with it's privacy rules (to controll which watchers are
allowed to subscribe to it). In such case, from script level, you can
force the presence server to consider the current subscription allowed
(with Subscription-Status:active) by calling handle_subscribe() function with
the string parameter "1".
<programlisting format="linespecific">
Ex:
if(uri =~ "kphone@opensips.org")
Expand Down

0 comments on commit 74890a9

Please sign in to comment.