# Installation and running

Presence modules use some dynamic libraries distributed with SIP-router and the compilation procedure and running is a bit more difficult than usual. For detailed description of libraries see their separate documentation (stored in `lib/doc` subdirectory of main SIP-router directory).

## Incompatibility

XCAP module needed for authorization is not working with TLS module. For more information see pres.known_problems.

## Dependencies

Presence module dependencies may be found in sections PA module dependencies and RLS module dependencies. These modules depend on common libraries which have their own dependencies as mentioned below.

Missing dependencies for common libraries!

## Installation from CVS

There is an example of steps which need to be done while installing SIP-router with shared libraries into directory /base/ser/directory (if no directory specified - no prefix parameter given - default value is used: /usr/local/)

1. Download current SIP-router sources:

   `cvs -d :pserver:anonymous@cvs.berlios.de:/cvsroot/ser checkout sip_router`

2. Download very useful ser_ctl utility (not necessary, but it is handy for adding data into database, running XML-RPC functions etc):

   `cvs -d :pserver:anonymous@cvs.berlios.de:/cvsroot/ser checkout serctl`

3. Compile and install SIP-router with presence modules. Common libraries should be compiled automatically - it may fail in the case of unsatisfied library dependencies. You need to install all external libraries introduced in pres.dependencies

   `cd sip_router`

   `make install group_include="standard,presence,standard-dep" prefix=/base/ser/directory`

## Presence snapshots

In past there were published presence snapshots with stable and tested code and up to date documentation. This will change - tested and documented stable features will be probably imported into stable SIP-router branch (Ottendorf) and unstable ones will remain in CVS head.

## Running SIP-router

Linker used for dynamic linking must know, where to find these libraries. This may be done by setting `LD_LIBRARY_PATH` before startup.

`export LD_LIBRARY_PATH=/base/ser/directory/lib/ser`

`/base/ser/directory/sbin/ser -f /base/ser/directory/etc/ser/ser.cfg`

If you want to run SIP-router under sudo like sudo /base/ser/directory/sbin/ser -f /base/ser/directory/etc/ser/ser.cfg it need not work - it is possible that LD_LIBRARY_PATH will not be propagated in this case!

## Database initialization

This paragraph can be out-of-dated by changes in DB init scripts or in ser_ctl. It has only informative value!

It is very handy to use SIP-router together with database - at least domains and users with attributes can be stored there. First must be database created - there are scripts to do this in SIP-router's source tree in directory scripts; for example "scripts/mysql/ser_mysql.sh create" will create the database for MySQL.

Later MySQL versions can complain with current script, if so, you can try to remove qotes around $PW in script to get it into work.

After database creation you can add data using ser_ctl utility:

- add domain:

  `ser_domain add test test-domain.com`

- add user parf with password parf:

  `ser_user add parf`

  `ser_uri add parf parf@test-domain.com`

  `ser_cred add parf parf test test-domain.com parf`

Running ser_xxx without arguments shows help.

You can specify database URI used by ser_ctl; for example you can use postgres://... instead of default mysql://... etc.