# Usage of common libraries

## Introduction

### About

Common libraries are originalsy determined for usage with SER - as a collection of useful functions which are not present in the SER's code. But as the time goes it seems to be good to make them usable without SER too, at least for testing parts of SER modules and thus it is possible to use them alone now.

### Dependencies

#### libcds dependencies

Missing dependencies for CDS library! Add section with `id` `libcds.dependencies` to CDS library documentation.

#### libxcap dependencies

Missing dependencies for XCAP library! Add section with `id` `libxcap.dependencies` to XCAP library documentation.

#### libpresence dependencies

Missing dependencies for Presence library! Add section with `id` `libpresence.dependencies` to Presence library documentation.

## Installation and usage

Before installation is needed to install external libraries according to dependencies.

### Usage with SIP Express Router

These libraries are distributed together with SER, but they are not compiled together with other SER code. They must be compiled separately, before compiling SER modules which use them.

There is standalone makefile for compilation with SER named `Makefile.ser`.

#### Installation steps

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

1. Download current ser sources:

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

2. Compile and install libraries for usage with SER:

   `cd sip_router/lib`

   `make -f Makefile.ser install prefix=/base/ser/directory`

3. Compile and install SER

   `cd ..`

   `make install prefix=/base/ser/directory`

#### Running SER

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`