[Serusers] How to add a file to XCAP server

VinayG vinaykg at gmail.com
Wed Nov 15 12:55:30 CET 2006


hai,

We are trying to setup xcap server (http://download.dns-hosting.info/XCAP/)
with no presence functionality. we would like to use this server to store,
retrieve, modify the contact/group list documents at the server.

We have followed the instructions given for installation in the site(
http://download.dns-hosting.info/XCAP/).

Installation instructions

Setup php (Skipped this part as we are not using any authentication and also
commented authentication check code in index.php(given below) file of
xcap-server)

Setup Apache web server(no ssl support)
Create a virtual host for Apache server as follows:
<VirtualHost 192.168.3.209:80>
    ServerName          192.168.3.209
    DocumentRoot        /var/www/xcap-root
    RewriteEngine       On
    RewriteRule         /xcap-root/(.*) /xcap-root/index.php
    ProxyVia            On
#    SSLEngine           On
#    SSLCertificateFile    /path/to/server.crt
#    SSLCertificateKeyFile /path/to//server.key
#    SetEnvIf User-Agent ".*MSIE.*"      nokeepalive ssl-unclean-shutdown
</VirtualHost>

Enable php as scripting language and add index.php to the list of index
files.
LoadModule php4_module /usr/lib/apache/1.3/libphp4.so
<IfModule mod_dir.c>
    DirectoryIndex index.php
</IfModule>

Make sure the user under which the Apache server runs has the rights to
write into the root directory of the virtual host:
chmod -R g+w /var/www/xcap-root
chown -R apache /var/www/xcap-root

Setup SIP User Agent (Skipped this part, as we are facing problems in setup
of ser as presence agent)

Setup XCAP server
Create a file index.php under the xcap-root directory and change the
database connection details to the place where SER subscriber table is
located and add the IP addresses of the SER PA server in the trusted list:
<?
include("xcap-lib.php");
$XCAPServer = new XCAPServer();

$XCAPServer->AuthOptions = array(
            'dsn'          => "mysql://ser:passwd@db/ser",
            'table'          => "subscriber",
            'usernamecol' => "username",
            'passwordcol' => "password",
            'cryptType'   => "none",
            );

$XCAPServer->trustedPeers = array('21.23.228.49','21.23.228.46');

#if ($XCAPServer->authenticate() && $XCAPServer->authorize()) {
    if ($_SERVER['REQUEST_METHOD'] == "GET") {
        $XCAPServer->getFile();
    } else if ($_SERVER['REQUEST_METHOD'] == "PUT") {
        $XCAPServer->putFile();
    } else if ($_SERVER['REQUEST_METHOD'] == "DELETE") {
        $XCAPServer->deleteFile();
    }
#}
?>

In effect, we are configuring apache server to work as xcap server.

How to ADD/RETRIEVE a contact list file to/from the XCAP server?

Any help is greatly appreciated.

Thanks
Vinay G
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20061115/2aad72b7/attachment.htm>


More information about the sr-users mailing list