README.md 3.99 KB
Newer Older
Erwan Croze's avatar
Erwan Croze committed
1 2
[![pipeline status](https://gitlab.linphone.org/BC/public/flexisip/badges/master/pipeline.svg)](https://gitlab.linphone.org/BC/public/flexisip/commits/master)

3 4 5 6 7 8 9 10 11
Flexisip is a SIP server suite comprising:
 - Flexisip proxy server, a SIP proxy with media-relay built-in.
 - Flexisip presence server, a presence server using resource-lists contained in SUBSCRIBE.

It bests runs on GNU/Linux, but can also be used on MacOS X.
It is released under the AGPLv3 or later. Please understand the terms of AGPLv3 in COPYING before deploying it.

# Documentation

12
You will find a comprehensive documentation on how to use Flexisip online
13 14 15 16
here: https://wiki.linphone.org/xwiki/wiki/public/view/Flexisip/

# Dependencies

17
Flexisip depends on the following projects, added as submodule in the git repository:
18 19 20
- sofia-sip
- ortp
- bctoolbox
21
- hiredis (optionaly)
22

23
Thesedependencies below are optional, though stronly recommended for a reliable and scalable deployment:
24 25 26 27 28
- soci
- protobuf
- netsnmp

Specifically for presence server:
29
- xsd (>= 4, for old OS on which this version isn't packaged, rpm and deb
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
  are available here: http://www.codesynthesis.com/products/xsd/download.xhtml)
- pdflatex to generate the documentation in PDF format.
- xercesc3


# Compilation

Flexisip uses cmake as build system, extended by a prepare.py script written in python.
Note that some automake/autoconf scripts and Makefile.am are also present in the source code, however
they are no longer the recommended way for building flexisip, and these files will be removed in mid term.

## GNU/Linux developer build

You can issue ./prepare.py -lf to see all possible build options.
Then use the following to proceed with compilation:
Simon Morlat's avatar
Simon Morlat committed
45 46
	./prepare.py <build options>
	make
47 48 49 50 51


Alternatively, provided that ortp, bctoolbox and sofia-sip dependencies are installed on the system, flexisip's cmake
integration can be used directly, for example:

Simon Morlat's avatar
Simon Morlat committed
52 53
	cmake . -DCMAKE_INSTALL_PREFIX=/opt/belledonne-communications -DSYSCONF_INSTALL_DIR=/etc
	make
54 55 56 57 58

## rpm and deb packages

The "flexisip-rpm" ./prepare.py target can be used to generate rpm packages for flexisip and its dependencies.
"Alien" program is used internaly to convert into debian packages, when this build is run on a debian or debian like linux OS.
59 60
The following dependency packages are required (as rpm package name): 
 mbedtls-devel sqlite-devel postgresql-devel rpm-build bison speex-devel
61

62
	./prepare.py flexisip-rpm -DENABLE_REDIS=ON -DENABLE_BC_HIREDIS=ON
Simon Morlat's avatar
Simon Morlat committed
63
	make
64

65 66 67
## Docker

A docker image can be build from sources with command:
68
	cd docker && make flexisip-build
69

70 71 72 73 74 75
## Macos X

The cmake scripts of flexisip can be used to develop with Flexisip in Xcode.
You need to run:
- `./prepare.py -G Xcode flexisip \
	-DENABLE_REDIS=NO \
76 77
	-DEP_sofiasip_CONFIGURE_OPTIONS=PKG_CONFIG_PATH=/opt/local/lib/pkgconfig/ `
- `xcodebuild -project WORK/flexisip/cmake/Project.xcodeproj/ `
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
- `open WORK/flexisip/Build/flexisip/flexisip.xcodeproj`

The soci dependency is not easy to install on MacOS. If you need it, you can use these tips, based on "brew" system:

You need to install and unlink mysql :
brew install mysql
brew unlink mysql
Then install mysql-connector-c
brew install mysql-connector-c
And finally install soci with mysql
brew install soci --with-mysql

You can now use -DENABLE_SOCI=ON in your prepare options.

# Configuration


Flexisip needs a configuration file for running correctly.
You can either:
- copy and modify file flexisip.conf.sample to flexisip.conf in directory <prefix>/etc/flexisip
98
- or issue `flexisip --dump-default all > flexisip.conf` in a terminal
99 100 101 102 103 104 105 106 107 108 109 110
  to generate a configuration file with the default values.

# Developer notes

With sofia-sip, you have the choice between msg_dup and msg_copy,
sip_from_dup and sip_from_copy etc...
The difference isn't well documented in sofia-sip documentation.
However it is important to understand that
*_copy() just makes a copy of the structure, not the strings pointed by it
*_dup() makes a copy of structure plus all included strings inside.
*_copy() versions can be thus dangerous. Use *_dup() in doubt.