Category:HowTo:OpenXCAP Server

From Snom User Wiki

Jump to: navigation, search

Contents

How to set up a standalone PBX-independent XCAP-Server with OpenXCAP under Linux

Hardware requirements:

HDD: 3 GB
RAM: 300 MB

Install Linux

Latest stable Debian is recommended.
No special installation steps needed.

Image:Xcap1.png

Add OpenXCAP repository

wget http://download.ag-projects.com/agp-debian-gpg.key
apt-key add agp-debian-gpg.key

Add following line to /etc/apt/sources.list

deb http://ag-projects.com/debian stable main

Install OpenXCAP

apt-get update
apt-get upgrade
apt-get install openxcap
apt-get install python-xcaplib
apt-get install mysql-server

Create a database for OpenXCAP

mysqladmin -p create openxcap

and insert the tables

mysql -p openxcap < /usr/share/doc/openxcap/mysql-create-tables.sql
Add MySQL user

Use the following script as template, edit it first and run it against on the database:

/usr/share/doc/openxcap/mysql-create-user.sql

change it from:

GRANT ALL ON opensips.* TO openxcap@'localhost' IDENTIFIED by 'PASSWORD';
GRANT ALL ON opensips.* TO openxcap@'PRIVATE_IP_NETWORK.%' IDENTIFIED by 'PASSWORD';

to

GRANT ALL ON openxcap.* TO openxcapuser@'localhost' IDENTIFIED by 'openxcapuserpw';

and insert it with

mysql -p < /usr/share/doc/openxcap/mysql-create-user.sql

Edit the server config file

the main config file is

/etc/openxcap/config.ini

change the value of the root URI in line 20 from

root = http://xcap.example.com/xcap-root

to

root = http://insert your IP here

for example

root = http://10.110.22.235

change the backend in line 28 from

backend = OpenSIPS

to

backend = Database

At line 75 you can switch the HTTP authentication type. Possible options: digest, basic. Or deactivate authentication with line 91

trusted_peers = 10.110.22.0/24

means every client (phone) with a 10.110.22.XXX IP-address doesn't need to authenticate.

Customize line 110 and 113 with your database information
change it from

authentication_db_uri = mysql://opensips:opensipsrw@localhost/opensips
storage_db_uri = mysql://opensips:opensipsrw@localhost/opensips

to

authentication_db_uri = mysql://openxcapuser:openxcapuserpw@localhost/openxcap
storage_db_uri = mysql://openxcapuser:openxcapuserpw@localhost/openxcap

Start the server

to run the server as a daemon edit

/etc/default/openxcap

and change

RUN_OPENXCAP=no

to

RUN_OPENXCAP=yes

nowyoucan start the xcap server in deamon mode with

/etc/init.d/openxcap start

for tests or debuggingyoucan use

openxcap --no-fork

which run the process in the foreground soyoucan see what happen.
Image:Xcap2.png

Create an XCAP/SIP account

To test HTTP authentication you need to create an account with the add-openxcap-user.py script.
The syntax:

python /usr/share/doc/openxcap/add-openxcap-user.py username domain password

for example

python /usr/share/doc/openxcap/add-openxcap-user.py 468720122 10.110.22.37 1234

You get a string back like

INSERT INTO subscriber (username, domain, password, ha1) VALUES ("468720122", "10.110.22.37", "1234", "e92fb35829441aebc3b75b9b630e3e71");

now connect to the openxcap database and copy the string in. To connect to the databaseyoucan use the command

mysql -p openxcap

Image:Xcap3.png

Upload an tbook

You can use this example tbook:

<?xml version="1.0" encoding="UTF-8"?>
<resource-lists xmlns="urn:ietf:params:xml:ns:resource-lists" xmlns:cp="counterpath:properties">
 <list name="Contact List">
   <entry uri="">
     <display-name>Testentry</display-name>
     <cp:prop name="entry_id" value="534BB0BC2DDA09E2567C5D8D5B2C0120"/>
     <cp:prop name="given_name" value="Max"/>
     <cp:prop name="surname" value="Mustermann"/>
     <cp:prop name="profession" value="Dr."/>
     <cp:prop name="company" value="crashtestdummy"/>
     <cp:prop name="email_address" value="max@mustermann.de"/>
     <cp:prop name="comment" value="demonstrating xcap"/>
     <cp:prop name="sip_address" value="0042/1"/>
     <cp:prop name="mobile_number" value="0042/2"/>
     <cp:prop name="home_number" value="0042/3"/>
     <cp:prop name="home_number#1" value="0042/4"/>
     <cp:prop name="business_number" value="0042/5"/>
     <cp:prop name="business_number#1" value="0042/6"/>
     <cp:prop name="category" value="Arbeit"/>
   </entry>
 </list>
</resource-lists>

Upload it via

xcapclient --sip-address=468720122@10.110.22.37 --xcap-root=http://10.110.22.235 --filename=contacts-resource-list.xml --app=resource-lists -i tbook_file put

How to setup the phone

The relevant settings are:

user_name1

Setup an SIP-Identity that exists on the XCAP-Server

user_host1

The Registrar.
e.g.:10.110.22.37

xcap_tbook_sync_interval

After this time the internal tbook sync with the xcap server.
e.g.:60 for every minute.

xcap_server_name

The name or IP of the XCAP-Server.
e.g.:10.110.22.235

xcap_server_port

The port of the XCAP-Server.
e.g.:80

xcap_directory_auid

The Application Unique ID.
e.g.:resource-lists/

xcap_via_tls

Secure communication with the server.
e.g.:off

user_server_type1

Must set to bria


Settings-URL

/settings.htm?settings=save&user_host1=10.110.22.37&user_server_type1=bria&xcap_server_name=10.110.22.235&xcap_server_port=80&xcap_directory_auid=resource-lists/&xcap_via_tls=off&xcap_tbook_sync_interval=60

To download a tbook via browser the link schema is:

http://10.110.22.235/resource-lists/users/sip:IDENTITY_FROM_ABOVE@10.110.22.37/contacts-resource-list.xml

XCAP resources

  • [1] How to configure XCAP on snom phones
  • [2] XCAP RFC
  • [3] Debian Website
  • [4] OpenXCAP Website
  • [5] HTTP Basic access authentication
  • [6] HTTP Digest access authentication
  • [7][MySQL Grant Syntax
  • [8] XCAP in the Wikipedia

This category currently contains no pages or media.

Personal tools
Interoperability