Module: sip-router
Branch: master
Commit: f6c6d6e94e4b37e77a2776afb3ec5ae8f1d57c93
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=f6c6d6e…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Tue Sep 21 15:20:08 2010 +0200
xcap_server: added example of handling xcap-caps request
---
modules_k/xcap_server/README | 29 +++++++++++++++++++++++
modules_k/xcap_server/doc/xcap_server_admin.xml | 29 +++++++++++++++++++++++
2 files changed, 58 insertions(+), 0 deletions(-)
diff --git a/modules_k/xcap_server/README b/modules_k/xcap_server/README
index 8abde67..4405afb 100644
--- a/modules_k/xcap_server/README
+++ b/modules_k/xcap_server/README
@@ -309,6 +309,35 @@ event_route[xhttp:request] {
$var(uri) = $xcapuri(u=>xuid);
else
$var(uri) = "sip:"+ $xcapuri(u=>xuid) + "@" + $Ri;
+
+ # handle XCAP capability request
+ if($rm=="GET" && $xcapuri(u=>auid)=="xcap-caps")
+ {
+ $var(xbody) =
+"<?xml version='1.0' encoding='UTF-8'?>
+<xcap-caps xmlns='urn:ietf:params:xml:ns:xcap-caps'>
+ <auids>
+ <auid>rls-services</auid>
+ <auid>pidf-manipulation</auid>
+ <auid>xcap-caps</auid>
+ <auid>resource-lists</auid>
+ <auid>pres-rules</auid>
+ </auids>
+ <extensions>
+ </extensions>
+ <namespaces>
+ <namespace>urn:ietf:params:xml:ns:rls-services</namespace>
+ <namespace>urn:ietf:params:xml:ns:pidf</namespace>
+ <namespace>urn:ietf:params:xml:ns:xcap-caps</namespace>
+ <namespace>urn:ietf:params:xml:ns:resource-lists</namespace>
+ <namespace>urn:ietf:params:xml:ns:pres-rules</namespace>
+ </namespaces>
+</xcap-caps>";
+ xhttp_reply("200", "ok",
"application/xcap-caps+xml",
+ "$var(xbody)");
+ exit;
+ }
+
xdbg("SCRIPT: xcap service $xcapuri(u=>auid) for
$xcapuri(u=>xuid)\n");
switch($rm) {
case "PUT":
diff --git a/modules_k/xcap_server/doc/xcap_server_admin.xml
b/modules_k/xcap_server/doc/xcap_server_admin.xml
index ecf9893..2c890c0 100644
--- a/modules_k/xcap_server/doc/xcap_server_admin.xml
+++ b/modules_k/xcap_server/doc/xcap_server_admin.xml
@@ -361,6 +361,35 @@ event_route[xhttp:request] {
$var(uri) = $xcapuri(u=>xuid);
else
$var(uri) = "sip:"+ $xcapuri(u=>xuid) + "@" + $Ri;
+
+ # handle XCAP capability request
+ if($rm=="GET" &&
$xcapuri(u=>auid)=="xcap-caps")
+ {
+ $var(xbody) =
+"<?xml version='1.0' encoding='UTF-8'?>
+<xcap-caps xmlns='urn:ietf:params:xml:ns:xcap-caps'>
+ <auids>
+ <auid>rls-services</auid>
+ <auid>pidf-manipulation</auid>
+ <auid>xcap-caps</auid>
+ <auid>resource-lists</auid>
+ <auid>pres-rules</auid>
+ </auids>
+ <extensions>
+ </extensions>
+ <namespaces>
+ <namespace>urn:ietf:params:xml:ns:rls-services</namespace>
+ <namespace>urn:ietf:params:xml:ns:pidf</namespace>
+ <namespace>urn:ietf:params:xml:ns:xcap-caps</namespace>
+ <namespace>urn:ietf:params:xml:ns:resource-lists</namespace>
+ <namespace>urn:ietf:params:xml:ns:pres-rules</namespace>
+ </namespaces>
+</xcap-caps>";
+ xhttp_reply("200", "ok",
"application/xcap-caps+xml",
+ "$var(xbody)");
+ exit;
+ }
+
xdbg("SCRIPT: xcap service $xcapuri(u=>auid) for
$xcapuri(u=>xuid)\n");
switch($rm) {
case "PUT":