Module: sip-router
Branch: master
Commit: fa4ddbb3d4a56c35822e989c8e48aced51a0bd56
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=fa4ddbb…
Author: pd <peter.dunkley(a)crocodile-rcs.com>
Committer: pd <peter.dunkley(a)crocodile-rcs.com>
Date: Thu Jul 28 15:38:04 2011 +0100
modules_k/xcap_server: Improved rls_update_subs() example in README
---
modules_k/rls/README | 13 ++++++++++++-
modules_k/rls/doc/rls_admin.xml | 13 ++++++++++++-
2 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/modules_k/rls/README b/modules_k/rls/README
index b23953f..34f1d66 100644
--- a/modules_k/rls/README
+++ b/modules_k/rls/README
@@ -402,7 +402,18 @@ if(method=="NOTIFY")
Example 1.17. rls_update_subs usage
...
-rls_update_subs("sip:test@kamailio.org", "presence");
+Within event_route[xhttp:request]:
+ case "PUT":
+ xcaps_put("$var(uri)", "$var(doc_uri)",
"$rb");
+ if($xcapuri(u=>auid)=~"pres-rules") {
+ pres_update_watchers("$var(uri)",
"presence");
+ pres_refresh_watchers("$var(uri)",
"presence", 1);
+ } else if ($xcapuri(u=>auid)=~"resource-lists"
+ || $xcapuri(u=>auid)=~"rls-services") {
+ rls_update_subs("$var(uri)", "presence");
+ }
+ exit;
+ break;
...
5. Installation
diff --git a/modules_k/rls/doc/rls_admin.xml b/modules_k/rls/doc/rls_admin.xml
index bba428c..f0956b9 100644
--- a/modules_k/rls/doc/rls_admin.xml
+++ b/modules_k/rls/doc/rls_admin.xml
@@ -473,7 +473,18 @@ if(method=="NOTIFY")
<title><function>rls_update_subs</function> usage</title>
<programlisting format="linespecific">
...
-rls_update_subs("sip:test@kamailio.org", "presence");
+Within event_route[xhttp:request]:
+ case "PUT":
+ xcaps_put("$var(uri)", "$var(doc_uri)", "$rb");
+ if($xcapuri(u=>auid)=~"pres-rules") {
+ pres_update_watchers("$var(uri)", "presence");
+ pres_refresh_watchers("$var(uri)", "presence", 1);
+ } else if ($xcapuri(u=>auid)=~"resource-lists"
+ || $xcapuri(u=>auid)=~"rls-services") {
+ rls_update_subs("$var(uri)", "presence");
+ }
+ exit;
+ break;
...
</programlisting>
</example>