Hello All,
I am trying to configure Kamailio v 3.3 to serve as a presence
server with resource lists and integrated XCAP.
I followed the respective module documentation and am trying to test
with the Boghe IMS client. I just can't get it to work!
I think I still don't have everything I need in the config file to
handle the xcap documents. Attached is the debug log from the server.
If someone has had luck setting up the presence server with integrated
xcap and resource lists please take a few minutes to take a look at
the log file and see if you can help me out. I am also posting the
xcap portion of the config file:
#!ifdef WITH_XCAPSRV
##!define WITH_XHTTPAUTH
event_route[xhttp:request] {
xdbg("===== xhttp: request [$rv] $rm => $hu\n");
#!ifdef WITH_XHTTPAUTH
if (!www_authorize("10.50.251.12", "subscriber"))
{
www_challenge("10.50.251.12", "0");
exit;
}
#!endif
if($hu=~"^/xcap-root/")
{
set_reply_close();
set_reply_no_connect();
# xcap ops
$xcapuri(u=>data) = $hu;
if($xcapuri(u=>xuid)=~"^sip:.+@.+")
$var(uri) = $xcapuri(u=>xuid);
else if($xcapuri(u=>xuid)=~".+@.+")
$var(uri) = "sip:" + $xcapuri(u=>xuid);
else
$var(uri) = "sip:"+ $xcapuri(u=>xuid) + "@"
+ $Ri;
xlog("===== xhttp: $xcapuri(u=>auid) :
$xcapuri(u=>xuid)\n");
if($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>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:pres-rules</namespace>
</namespaces>
</xcap-caps>";
xhttp_reply("200", "ok",
"application/xcap-caps+xml",
"$var(xbody)");
exit;
}
#!ifdef WITH_XHTTPAUTH
# be sure auth user access only its documents
if ($au!=$(var(uri){uri.user})) {
xhttp_reply("403", "Forbidden", "text/html",
"<html><body>$si:$sp</body></html>");
exit;
}
#!endif
switch($rm) {
case "PUT":
#xcaps_put("$var(uri)", "$hu",
"$rb");
#if($xcapuri(u=>auid)=~"pres-rules")
#{
# xlog("===== xhttp put:
refreshing watchers for $var(uri)\n");
#
pres_update_watchers("$var(uri)", "presence");
#
pres_refresh_watchers("$var(uri)", "presence", 1);
#}
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;
case "GET":
xlog("===== xhttp: get $var(uri) => $hu\n");
xcaps_get("$var(uri)", "$hu");
exit;
break;
case "DELETE":
xcaps_del("$var(uri)", "$hu");
if($xcapuri(u=>auid)=~"pres-rules")
{
xlog("===== xhttp del:
refreshing watchers for $var(uri)\n");
pres_update_watchers("$var(uri)", "presence");
pres_refresh_watchers("$var(uri)", "presence", 1);
}
exit;
break;
}
}
# http ops
xhttp_reply("200", "ok", "text/html",
"<html><body>OK:
$si:$sp</body></html>");
exit;
}
--
Sangeeta Shah