INSTALL
cb7dae9d
 
77d7e325
      ==================================================
ea828a39
 
b4ebc4a8
           Kamailio SIP Server Installation Notes
ea828a39
 
b4ebc4a8
                  http://www.kamailio.org
ea828a39
 
77d7e325
      ==================================================
b8bc4cf8
 
220b7820
   Welcome! This is an amazingly flexible, robust and secure SIP server
   built on years of experience in several Open Source projects. It's a merge
   of the SIP Express Router (SER) and the Kamailio (OpenSER) products produced
dd8f5488
   by a joint development team.
220b7820
 
097637b2
   This memo gives you hints on how to set up the Kamailio quickly.
dd8f5488
 
220b7820
   You can find a similar tutorial and many more on project's web site:
dd8f5488
     - https://www.kamailio.org/w/documentation/
     - https://www.kamailio.org/wiki/
 
f9882aab
 
df0c82a0
 Table of Contents
 =================
b8bc4cf8
 
097637b2
 1. Supported Architectures And Requirements
f0f0b444
 2. How-To Build Kamailio From The Source Code Distribution
097637b2
    2.1 Kamailio Fast Track Installation
    2.2 Details Installing From Source Code
f0f0b444
      A) Build Commands
097637b2
 3. Quick-Start Installation Guide
620ce0e2
    A) Getting Help
b8bc4cf8
    B) Disclaimers
f0f0b444
    C) Quick Start
    D) Kamailio With Persistent Data Storage
097637b2
 4. Troubleshooting
e3eb4e3e
 
77d7e325
 
097637b2
 1. Supported Architectures And Requirements
b8bc4cf8
 -------------------------------------------
550bb8c3
 
77d7e325
 Supported operating systems:
  - Linux (Debian, Ubuntu, Fedora, RedHat, CentOS, OpenSUSE, Gentoo, a.s.o.)
  - FreeBSD, NetBSD, OpenBSD, Dragonfly BSD
  - Solaris
  - OS/X, Darwin
 
f0f0b444
 Note that some modules have dependencies on the Linux operating system.
 This is clearly noted in the README files.
 
77d7e325
 Partially supported
  - Windows+Cygwin (core + static modules only, no IPv6, no
    TCP, no dynamic modules)
df0c82a0
 
77d7e325
 Supported architectures
  - i386, x86_64 (amd64), armv4l, sparc64, powerpc, powerpc64
 
 Experimental architectures:
  - mips1, mips2, sparc32, alpha
9d24a262
 
6de5485d
 (for other architectures the Makefiles might need to be edited)
550bb8c3
 
628e3a5a
 There are various configuration options defined in the Makefile.
 
9d24a262
 Requirements:
550bb8c3
 
dd8f5488
 - gcc or clang:
7ddb20da
      gcc >= 2.9x; 3.[12] recommended (it will work with older version
      but it might require some options tweaking for best performance)
      clang >= version 3.3
2824e49d
 - bison or yacc (Berkley Yacc)
550bb8c3
 - flex
df0c82a0
 - GNU make (on Linux this is the standard "make", on *BSD and Solaris it is
5d1a75a6
   called "gmake") version >= 3.80 (recommended 3.81).
5b0cb4c6
 - sed and tr (used in the makefiles)
 - GNU tar ("gtar" on Solaris) and gzip if you want "make tar" to work
9d24a262
 - GNU install, BSD install or Solaris install if you want "make
5b0cb4c6
   install", "make bin", "make sunpkg" to work
2824e49d
 - libmysqlclient & libz (zlib) if you want MySQL support (the db_mysql module)
dd8f5488
 - libxml2 if you want to compile the cpl-c (CPL support) or pa (presence)
5d1a75a6
    modules
dd8f5488
 - freeradius, radcli or libradiusclient-ng (> 5.0) if you need RADIUS support
   (the auth_radius, acc_radius and misc_radius modules)
df0c82a0
 - libpq if you need PostgreSQL support (the db_postgres module)
77d7e325
 - libexpat if you want the jabber gateway support (the jabber module) or the
   XMPP gateway support
 - libxml2 if you want to use the cpl-c (Call Processing Language) or
   the presence modules (presence and pua*)
 - libradius-ng -libs and devel headers- if you want to use functionalities
   with radius support - authentication, accounting, group support, etc
 - unixodbc - libs and devel headers - if you want UNIXODBC support as
   DB underlayer
2824e49d
 - libperl - libs and devel headers - if you want the perl connector to support
   perl scripting from your config file (perl module)
dd8f5488
 - libsnmp9 - libs and devel headers - if you want SNMP client functionality
77d7e325
   (SNMP AgentX subagent) for Kamailio
 - libldap libs and devel headers v2.1 or greater - if you want LDAP support
 - libpcre libs and devel headers - if you want to compile the lcr and dialplan
   modules
d4d6d3c0
 - libsctp devel headers - if you want to compile the SCTP transport in the core
2824e49d
 - libssl devel headers (openssl project) - if you want to compile the TLS module
 - libunistring - for the WebSocket module
 - python and devel headers for the Python module
 - jdk and gcj for Java module
50903b62
 - the jansson library for the jansson module used for JSON document handling
5b0cb4c6
 
f0f0b444
 Some modules have other requirements on third-party libraries. This is documented
 in the README for the specific module.
550bb8c3
 
b2dec9c6
 OS Notes:
550bb8c3
 
9d24a262
  FreeBSD/OpenBSD/NetBSD: make sure gmake, bison or yacc & flex are installed.
dd8f5488
 
9d24a262
   FreeBSD 5.4:
df0c82a0
   ------------
9d24a262
   If you want to compile all the modules, you will need the following packages:
   - mysql-client-* (any version, install one of the mysql*-client ports) for
df0c82a0
     libmysqlclient
9d24a262
   - postgresql-libpqxx-2.4.2_1 (/usr/ports/databases/postgresql-libpqxx) for
df0c82a0
     libpq
9d24a262
   - expat-1.95.8 (/usr/ports/textproc/expat2) for libexpat
   - libxml2-2.6.18 (/usr/ports/textproc/libxml2) for libxml2
dd8f5488
   - radiusclient-0.4.7 (/usr/ports/net/radiusclient) for libradiusclient-ng
9d24a262
   NOTE: you'll need to add radiusclient_ng=4 to the gmake command line if you
   use the 0.4.* version.
dd8f5488
 
77d7e325
   Compile example (all the modules and SIP server core in a tar.gz):
9d24a262
      gmake bin radiusclient_ng=4 include_modules="mysql jabber cpl-c auth_radius group_radius uri_radius postgres pa"
 
   OpenBSD 3.7
df0c82a0
   -----------
9d24a262
   - mysql-client-4.0.23 (/usr/ports/databases/mysql) for libmysqlclient
   - expat-1.95.6 (/usr/ports/textproc/expat) for libexpat
   - libxml-2.6.16p0 (/usr/ports/textproc/libxml) for libxml2
dd8f5488
   - radiusclient-ng-0.5.1 from
9d24a262
    http://download.berlios.de/radiusclient-ng/radiusclient-ng-0.5.1.tar.gz
dd8f5488
    (you need to download and install it, since there is no "official"
    openbsd port for it) for libradiusclient-ng
df0c82a0
 
77d7e325
   Compile example (all the modules and SIP server core in a tar.gz):
9d24a262
      gmake bin include_modules="mysql jabber cpl-c auth_radius group_radius uri_radius pa"
 
   NetBSD 2.0
df0c82a0
   ----------
9d24a262
   - mysql-client-4.1.12 (/usr/pkgsrc/databases/mysql4-client) for libmysqlclient
   - expat-1.95.8nb2 (/usr/pkgsrc/textproc/expat) for libexpat
   - libxml2-2.6.19 (/usr/pkgsrc/textproc/libxml2) for libxml2
   - radiusclient-ng-0.5.1 (see OpenBSD)
dd8f5488
 
77d7e325
   Compile example (all the modules and SIP server in a tar.gz):
9d24a262
      gmake bin include_modules="mysql jabber cpl-c auth_radius group_radius uri_radius pa"
 
df0c82a0
   Solaris 10
   ----------
   As above; you can use Solaris's yacc instead of bison. You might also
   need gtar and ginstall. If you don't have ginstall you can use Solaris
9d24a262
   install, just make sure it's in the PATH (it's usually in /usr/sbin) and
   add INSTALL=install either to the environment or to the make command line
   (e.g.: gmake INSTALL=install all).
dd8f5488
 
77d7e325
   Compile example (all the modules and SIP server in a tar.gz):
9d24a262
      gmake bin INSTALL=install include_modules="mysql jabber cpl-c auth_radius group_radius uri_radius postgres pa"
 
df0c82a0
   Linux
   -----
f0f0b444
   Kamailio is part of the official Debian distribution. You can download binary modules
   directly using normal packet management.
 
df0c82a0
   Needed packages for compiling all the modules:
   * Debian:
9d24a262
       - libmysqlclient-dev for libmysqlclient
       - libpq-dev for libpq
       - libexpat1-dev for libexpat
       - libxml2-dev for libxml2
77d7e325
       - libradiusclient-ng-dev for libradiusclient
 	  - other libraries are needed for some other modules,
 	    see README of the module you want to use
097637b2
     Kamailio have APT deb repositories that allow you to
 	install the binaries easily - see the web site for more details:
77d7e325
 	  - http://kamailio.org
9d24a262
 
f0f0b444
 
03023127
  Cygwin  (alpha state, partial support)
df0c82a0
  --------------------------------------
5d1a75a6
  make sure make, bison, flex, minires and minires-devel (needed for the
  resolver functions) are installed.
dd8f5488
 
097637b2
  Only building Kamailio's core and some static modules is supported for now.
03023127
  Stuff known not to work:
            - IPv6 (cygwin doesn't support it yet)
dd8f5488
            - TCP (the tcp code heavily depends on file descriptor passing
03023127
              between processes, which is not yet supported by cygwin)
            - dynamic modules (non statically linked -- not supported because
              backlinking doesn't work in windows by design)
 
9d24a262
 
097637b2
   Compile example (all the modules and Kamailio in a tar.gz):
9d24a262
      make bin include_modules="mysql jabber cpl-c auth_radius group_radius uri_radius postgres pa"
 
550bb8c3
 
097637b2
 2. Howto Build Kamailio From Source Code Distribution
620ce0e2
 -------------------------------------------------------
b4ebc4a8
 
 (NOTE: if make doesn't work try gmake instead)
 
097637b2
 2.1 Kamailio Fast Track Installation
b4ebc4a8
 ....................................
 
 
2824e49d
 If you are familiar with Unix/Linux build tools aready and you installed
 the required dependencies, then you can just follow this section, otherwise
b4ebc4a8
 skip over it.
 
097637b2
 To get Kamailio installed, in the folder with source code run:
b4ebc4a8
 
   make cfg
   make all
   make install
 
 If you want to install with additional modules, for example with mysql and
 tls, run:
 
   make include_modules="db_mysql tls" cfg
   make all
   make install
 
f0f0b444
 2.2 Details - Installing From Source Code
dd8f5488
 .........................................
247c2b65
 
097637b2
 Build Commands
247c2b65
 
097637b2
   Kamailio is split in four main parts: The core, the modules, the
f0f0b444
   utilities, and the various scripts/examples.  When you build, you can decide to build
df0c82a0
   only the core, the modules, both, or all.
247c2b65
 
097637b2
 * Compile Kamailio core only:
77d7e325
 	make
247c2b65
 
1ec7aeb1
 Compile modules except some explicitly excepted (see below)
dd8f5488
 	make modules  - all modules in the modules/ directory
 	make modules-all or make every-module  - all the modules
1ec7aeb1
 
df0c82a0
 * Compile all:
 	make all
247c2b65
 
df0c82a0
 * Explicitly excepted modules:
   By default make all will not build modules that require external libraries or
77d7e325
   that are considered to be "experimental". For example, modules that have external
df0c82a0
   dependencies are: db_mysql, jabber, cpl-c, auth_radius, group_radius, uri_radius,
097637b2
   avp_radius, db_postgres, db_berkeley, carrierroute, ...
1ec7aeb1
 
df0c82a0
 Including groups of modules:
   Instead of compiling the default modules only, you can specify groups of
   modules to include, according to their status:
097637b2
   - standard - Modules in this group are considered a standard part of Kamailio
77d7e325
     (due to widespread usage) but they have no dependencies (note that some of
220b7820
     these interplay with external systems. However, they don't have compile
     or link dependencies).
1ec7aeb1
 
df0c82a0
   - db - Modules in this group use databases and need a database driver to run.
77d7e325
     Included are drivers for the text mode db (dbtext) and for dumping
097637b2
     large amount of data to files (db_flatstore). See also the mysql or
77d7e325
     postgres groups.
380398ad
 
097637b2
   - standard_dep -  Modules in this group are considered a standard part of Kamailio
     (due to widespread usage) but they have dependencies that must be satisfied
220b7820
     for compilation.
77d7e325
     NOTE! All presence modules (dialog, pa, presence_b2b, rls, xcap) have been
 	included in this group due to interdependencies
 
   - stable - Modules in this group satisfy specific or niche applications,
220b7820
     and are considered stable for production use. They may or may not have dependencies
77d7e325
 
   - experimental - Modules in this group are either not complete, untested, or
     without enough reports of usage to allow the module into the stable group.
 	They may or may not have dependencies.
1ec7aeb1
 
097637b2
 There is another set of groups mainly used by Kamailio, where modules
77d7e325
 are grouped based on Debian packaging rules. For example:
097637b2
    - kstandard - Kamailio standard modules
1ec7aeb1
 
097637b2
    - kpresence - Kamailio SIMPLE presence server modules
1ec7aeb1
 
df0c82a0
 * To compile core with standard modules:
 	make group_include="standard" all
 
 * To compile all modules (provided you have all the required libraries installed) use:
 	make group_include="standard standard-dep stable experimental" all
 
   There are also in addition some "convenience" groups:
 
2824e49d
 	mysql 		- Include all the db modules dependent and the MySQL db driver
 	postgres 	- Include all the db modules and the PostgreSQL db driver
df0c82a0
 	radius 		- Include all modules on radiusclient
 	presence 	- Include all the presence modules
 
2824e49d
   Ex. to make a standard installation with MySQL, use:
df0c82a0
 	make group_include="standard mysql" all
 
dd8f5488
   In addition to group_include (or instead), you can use
df0c82a0
 	include_modules="modA modB"
   to specify exactly the modules you want to include, ex.
 	make include_modules="mymodule" modules
 
77d7e325
   You can also explicitly skip modules using skip_modules. Let's say you want all
   the standard and standard-dep modules except domain:
df0c82a0
 	make group_include="standard standard-dep" skip_modules="domain" all
 
   NOTE!!! As this mechanism is very powerful, you may be uncertain which
77d7e325
   modules that will be included. Just replace all (or modules) with print-modules
   and you will see which modules will be included and excluded, ex:
df0c82a0
 	make print-modules
   will show which modules are excluded by default.
 
   If you want to install or to build a binary package (a tar.gz with
097637b2
   Kamailio core and the modules), substitute "all" in the above command with
df0c82a0
   "install" or "bin".
 
 
 * More compile examples:
 
   - compile with profiling
 	make PROFILE=-pg all
   - compile debug mode version
 	make mode=debug all
   - compile debug version with profiling
 	make mode=debug PROFILE=-pg all
   - compile only the print module
 	make modules=modules/print modules
dd8f5488
   - compile by default only the print module, in debuging mode and with
df0c82a0
     profiling:
 	make cfg modules=modules/print mode=debug PROFILE=-pg
 	make all
   - change & save the  modules list without rebuilding the whole config
dd8f5488
     (so that already compiled modules won't be re-compiled by
df0c82a0
     make all/make modules):
 	make modules-cfg include_modules="mysql postgress"
   - change only the compile/build options, without changing the modules list:
 	make cfg-defs CPU=ultrasparc PROFILE=-pg
dd8f5488
   - compile by default all the usual modules + mysql and postgres, optimized
      for pentium-m and for space (saves both the build options and the module
df0c82a0
      list)
 	make cfg include_modules="mysql postgres" CPU=pentium-m CC_EXTRA_OPTS=-Os
 	make all
    - compile all the "default" modules except textops and vm
 	make skip_modules="textops vm" modules
    - save the above option in the make config, so that all make commands
      will use it by default:
 	make cfg skip_modules="textops vm"
    - compile all default modules and include uri_radius (not compiled by default):
 	make include_modules="uri_radius" modules
    - compile all the modules from the modules subdirectory (even the one excluded
      by default):
 	make exclude_modules="" modules
    - compile all the modules from the modules subdirectory excluding vm:
 	make exclude_modules=vm modules
      or
 	make exclude_modules="" skip_modules=vm modules
    - compile with the "tm" module statically linked and with profiling
 	make static_modules=tm PROFILE=-pg all
    - compile with gcc-3.2 instead of gcc
 	make CC=gcc-3.2 all
      or
 	CC=gcc-3.2 make all
247c2b65
 
 Make targets:
df0c82a0
 =============
247c2b65
 
620ce0e2
 Make Local Build Config:
 ------------------------
7742b1d2
 
df0c82a0
   * make cfg or make config - force config and module list regeneration
7742b1d2
 
dd8f5488
   Example:
df0c82a0
 	make cfg include_modules=mysql mode=debug
220b7820
 
df0c82a0
   All future make invocations will include the mysql module and will build in debug mode
7742b1d2
 
dd8f5488
   Note: If config.mak doesn't exist (e.g. initial checkout or after a make
df0c82a0
   proper) or if Makefile.defs was changed, the config will be re-generated
   automatically by the first make command. For example:
77d7e325
   	make cfg  include_modules=db_mysql; make all
dd8f5488
   is equivalent to
77d7e325
  	rm config.mak modules.lst; make include_modules=db_mysql.
0bd6adc6
 
df0c82a0
   * make cfg-defs  (force config regeneration, but don't touch the module list)
0bd6adc6
 
df0c82a0
   Example:
 	make cfg-defs CPU=ultrasparc CC_EXTRA_OPTS=-Os PROFILE=-pg
7742b1d2
 
df0c82a0
 	make modules-cfg
   or
 	make modules-list
   saves the module list, without regenerating the build config
   Example:
 	make modules-list include_modules="tls" skip_modules="print"
7742b1d2
 
628e3a5a
 Clean:
df0c82a0
 ------
247c2b65
 
df0c82a0
   * make clean   	- clean the base and modules too
   * make proper  	- clean also the dependencies and the config, but not the module list
   * make distclean 	- the same as proper
dd8f5488
   * make maintainer-clean - clean everything, including make's config, saved
df0c82a0
   			  module list, auto generated files, tags, *.dbg a.s.o
   * make clean-all	- clean all the modules in modules/*
   * make proper-all 	- like make proper but for all the  modules in modules/*
628e3a5a
 
df0c82a0
   Config clean:
ad9c95e3
 
f0f0b444
   * make clean-cfg       - cleans the compile config
   * make clean-modules-cfg  - cleans the modules list
ad9c95e3
 
f0f0b444
   Reduced clean:
ad9c95e3
 
df0c82a0
   * make local-clean  	- cleans only the core, no libs, utils or modules
   * make clean-modules  - like make clean, but cleans only the modules
   * make clean-libs     - like make clean, but cleans only the libs
   * make clean-utils    - like make clean, but cleans only the utils
f0f0b444
 
ad9c95e3
 
550bb8c3
 Compile:
df0c82a0
 --------
   * make proper
097637b2
      optional: make cfg  <various cfg. options that should be saved>
f0f0b444
   * make proper-modules - like make proper, but only for modules
   * make proper-libs    - like make proper, but only for libs
   * make proper-utils   - like make proper, but only for utils
df0c82a0
   * make
097637b2
      or gmake on non-Linux systems
dd8f5488
   * make modules
097637b2
      or make modules exclude_modules="CVS print" etc.
550bb8c3
 
620ce0e2
 Other Make Targets:
df0c82a0
 -------------------
   Make tags:
 	make TAGS
247c2b65
 
df0c82a0
   Create a tar.gz with the sources (in ../):
 	make tar
247c2b65
 
df0c82a0
   Create a tar.gz with the binary distribution (in ../):
 	make bin
247c2b65
 
df0c82a0
   Create a gzipped solaris package (in ../):
 	make sunpkg
247c2b65
 
df0c82a0
   Create debian packages (in ../):
 	make deb
247c2b65
 
df0c82a0
   or
 	dpkg-buildpackage
5b0cb4c6
 
617ced39
 Documentation:
df0c82a0
 --------------
617ced39
 
df0c82a0
   Regenerate the README for all the "default" modules (include_modules,
   skip_modules a.s.o can be used to alter the module list).
 	make README
617ced39
 
df0c82a0
   Generates a manpage for all the modules that support it (.xml file in the
   module directory).
 	make man
617ced39
 
288c597b
   Generates README file for modules/foo.
 	make modules=modules/foo modules-readme
bcc002cb
 
bc5cc4ec
 Install:
df0c82a0
 --------
550bb8c3
 
df0c82a0
 	make prefix=/usr/local  install
550bb8c3
 
df0c82a0
   Note: If you use prefix parameter in make install then you also need
   to use this parameter in previous make commands, i.e. make, make modules,
097637b2
   or make all. If you fail to do this then Kamailio will look for the default
df0c82a0
   configuration file in a wrong directory, because the directory of the
dd8f5488
   default configuration file is hardcoded into Kamailio during compile time.
   When you use a different prefix parameter when installing then the
   directory hard coded in Kamailio and the directory in which the file will be
df0c82a0
   installed by make install will not match. (You can specify exact location
097637b2
   of the configuration file using -f parameter of Kamailio).
6de5485d
 
df0c82a0
   For example, if you do the following:
 	make all
 	make prefix=/ install
6de5485d
 
df0c82a0
   Then the installation will put the default configuration file into
097637b2
   /etc/kamailio/kamailio.cfg (because prefix is /),
   but Kamailio will look for the file in /usr/local/etc/kamailio/kamailio.cfg
   (because there was no prefix parameter make all and /usr/local is the default value of prefix).
6de5485d
 
2824e49d
   The workaround is trivial, use the same parameters in all make commands:
df0c82a0
 	make prefix=/ all
 	make prefix=/ install
   or save the desired prefix in the make config (e.g.: make cfg prefix=/).
6de5485d
 
df0c82a0
   That applies to other make parameters as well (for example parameters
   "modules" or "excluded_modules").
cb7dae9d
 
 
097637b2
 3. Quick-Start Installation Guide
b4ebc4a8
 ---------------------------------
cb7dae9d
 
620ce0e2
 A) Getting Help
b8bc4cf8
 
097637b2
   This guide gives you instructions on how to set up the Kamailio
   on your box quickly. In case the default configuration does not fly, please
   check the documentation at the Kamailio web site
   http://www.kamailio.org to learn how to configure Kamailio for your site.
b8bc4cf8
 
dd8f5488
   If the documentation does not resolve your problem you may try contacting
b2b2b981
   our user forum by E-mail at sr-users@lists.kamailio.org -- that is the
097637b2
   mailing list of the Kamailio community. To participate in the mailing list,
df0c82a0
   please subscribe at the following web address:
5d1a75a6
 
b2b2b981
   https://lists.kamailio.org/cgi-bin/mailman/listinfo
b8bc4cf8
 
 B) Disclaimers
dd8f5488
 
   Note well the default "quick-start" configuration is very simple in order
   to be easily installable. It provides minimum features. Particularly,
df0c82a0
   authentication is by default disabled, which means anyone can register using
dd8f5488
   any name with the server. (This is on purpose to avoid installation
df0c82a0
   dependencies on a database, which is needed for storing user credentials.)
cb7dae9d
 
620ce0e2
 C) Quick Start
cb7dae9d
 
dd8f5488
   The following step-by step guide gives you instructions how to install the
097637b2
   SQL-free distribution of Kamailio. If you need persistence and
df0c82a0
   authentication, then you have to install additional database support --
   proceed to section D) after you are finished with C).
5d1a75a6
 
220b7820
   1) Download an RPM or Debian package from the links on the wiki
5d1a75a6
 
f0f0b444
     https://www.kamailio.org/wiki/
5d1a75a6
 
df0c82a0
   If you don't use an rpm or debian based distribution, try our tar.gz'ed
   binaries
f0f0b444
     https://www.kamailio.org/pub/kamailio/latest/src/
5d1a75a6
 
df0c82a0
   If you use Solaris 8 you can try our solaris package.
   If you use Gentoo Linux you do not have to download a package.
 
b4ebc4a8
   2) Install the package
df0c82a0
 	RPM:
     		rpm -i <package_name>
 	debian:
     		dpkg -i <package_name>
 	Solaris:
     		gunzip <package_name>.gz ; pkgadd -d <package_name>
 	*BSD:
     		pkg_add package_name
dd8f5488
 
b4ebc4a8
   3) Start the server
df0c82a0
 
94902f67
 	RPM:
77d7e325
     		/etc/init.d/kamailio start
df0c82a0
 	debian:
097637b2
     		Kamailio is started automatically after the install
     		(in case something fails you can start it with '/etc/init.d/kamailio start')
df0c82a0
 	tar.gz:
 	Solaris:
     		the tar.gz does not include an init.d script, you'll have to create one of
77d7e325
     		your own or adapt one from the source distribution (pkg/debian/init.d,
f0f0b444
     		pkg/kamailio/rpm/kamailio.init, pkg/kamailio/deb/debian/kamailio.init, a.s.o.)
097637b2
     		You can start Kamailio directly with
77d7e325
 			/usr/local/sbin/kamailio.
dd8f5488
 
097637b2
   4) Optionally, watch server's health using the kamctl utility
df0c82a0
 
dd8f5488
     - to do so, first set the environment variable SIP_DOMAIN to your domain
5b0cb4c6
       name, e.g., in Bourne shell, call
b8bc4cf8
         export SIP_DOMAIN="myserver.foobar.com"
b11ee5d8
 	- if you are using other than 'localhost' mysql server for maintaining
 	  subscriber database, change the variable 'SQL_HOST' to the proper
f0f0b444
 	  host name in the kamctl script
097637b2
     - run the kamctl utility
77d7e325
         /usr/sbin/kamctl moni
       or
097637b2
         /usr/local/sbin/kamctl moni (if you installed Kamailio from a
77d7e325
 		tar.gz or solaris package)
fd62444c
 
b4ebc4a8
   5) Connect SIP phones
df0c82a0
 
dd8f5488
   Register with the server using your favorite SIP User Agent (phone).
cb7dae9d
 
df0c82a0
   In most cases, you need to set the following options:
cb7dae9d
 
df0c82a0
 	Proxy server:	host name of your server
 	Domain:		the sip domain your server is configured to handle
 	User name:	the account name for your device
 	Auth user:	the ID used for authentication
 	Secret/Password:	The configured authentication password
cb7dae9d
 
097637b2
 D) Kamailio With Persistent Data Storage
df0c82a0
 ------------------------------------------
ea828a39
 
dd8f5488
   The default configuration is very simple and features many simplifications.
   In particular, it does not authenticate users and loses User Location database
   on reboot. To provide persistence, keep user credentials and remember users'
   locations across reboots, Kamailio can be configured to use a database, like MySQL.
220b7820
 
df0c82a0
   Before you proceed, you need to make sure MySQL is installed on your box. Your
   MySQL server must be configured to deal with a large number of
   connection. To increase it, set the following line in [mysqld] section
   of your my.ini configuration file:
fd62444c
 
    set-variable    = max_connections=500
b8bc4cf8
 
f0f0b444
   1) Download the package containing mysql support for Kamailio from the links
dd8f5488
      you find on:
f0f0b444
         https://www.kamailio.org/wiki/
5d1a75a6
 
dd8f5488
     (rpm and deb provided, most of the binary tar.gz distributions and the
74a565c7
      solaris package include it; if it is not present you'll have to rebuild
      from the source).
df0c82a0
 
b4ebc4a8
   2) install the package
5b0cb4c6
     rpm -i <package_name>
     or
     dpkg -i <package_name>
e3b6d3cf
 	or
77d7e325
 	emerge kamailio
e3b6d3cf
 	(if do not want to put 'mysql' into your USE variable you can type:
097637b2
 	 USE="mysql" emerge kamailio)
77d7e325
 
dd8f5488
   3) create MySQL tables for Kamailio
77d7e325
 	- if you have a previously installed Kamailio on your system, use
dd8f5488
     	/usr/local/sbin/kamdbctl reinstall
77d7e325
 	  to convert your Kamailio database into new structures
1ecf596e
 	- otherwise, if this is your very first installation, use
32e73f99
     	/usr/local/sbin/kamdbctl create
77d7e325
 	  to create Kamailio database structures
f0f0b444
      (you will be prompted for password of MySql "root" user)
df0c82a0
 
097637b2
   4) configure Kamailio to use SQL
     uncomment all lines in configuration file kamailio.cfg which are related to authentication:
77d7e325
     - loadmodule "db_mysql.so"
     - loadmodule "auth.so"
     - loadmodule "auth_db.so"
cb7dae9d
     - modparam("usrloc", "db_mode", 2)
     - modparam("auth", "calculate_ha1", yes)
9ae9ab4d
     - modparam("auth_db", "password_column", "password")
f0f0b444
     - if (!www_authorize("example.com", "subscriber")) {
dd8f5488
         www_challenge("example.com", "0");
cb7dae9d
         break;
77d7e325
       }
 
dd8f5488
   5) be sure to replace realm, the first parameter in www_* actions,
      with name of your server; some broken UAC implementations don't
f0f0b444
      authenticate otherwise; the authentication command in your
      configuration script should look then like this:
         if (!www_authorize("myserver.foobar.com", "subscriber")) {
dd8f5488
             www_challenge("myserver.foobar.com", "0");
f0f0b444
             break;
         }
77d7e325
 
b4ebc4a8
   6) restart the server
097637b2
 
f0f0b444
       /etc/init.d/kamailio restart
df0c82a0
 
dd8f5488
   7) you can now start managing the server using the kamctl utility;
      you need to first set the environment variable SIP_DOMAIN to your
f0f0b444
      local SIP realm, e.g.,
        export SIP_DOMAIN="myserver.example.com"
f770a896
 
f0f0b444
    	a) watch the server status using 'kamctl moni'
    	b) try to login with your SIP client as user 'admin' with password 'heslo'
dd8f5488
    	c) try adding new users using
f0f0b444
        		'kamctl add <username> <password>'
ea828a39
 
f9882aab
 
ea828a39
 4. Troubleshooting
 ------------------
 
dd8f5488
 Q: SIP requests are replied by Kamailio with "483 Too Many Hops" or
ea828a39
    "513 Message Too Large"
 
dd8f5488
 A: In both cases, the reason is probably an error in request routing script
    which caused an infinite loop. You can easily verify whether this happens
5d1a75a6
    by watching SIP traffic on loopback interface. A typical reason for
    misrouting is a failure to match local domain correctly. If a server
    fails to recognize a request for itself, it will try to forward it to
    current URI in believe it would forward them to a foreign
    domain. Alas, it forwards the request to itself again. This continues
    to happen until value of max_forwards header field reaches zero or
    the request grows too big. Solutions is easy: make sure that domain
    matching is correctly configured. A quick way to achieve that is to
77d7e325
    introduce a config option to ser.cfg or kamailio.cfg: alias=domainname,
    where domainname shall be replaced with name of domain, which you wish to
5d1a75a6
    server and which appears in request-URIs.
620ce0e2
 
 Q: Where to report issues?
 
115e1eb1
 A: Use bug tracker at: https://github.com/kamailio/kamailio/issues
620ce0e2
 
 Q: Any F.A.Q. that could be helpful to check before reporting an issue?
 
f0f0b444
 A: See: https://www.kamailio.org/wiki/tutorials/faq/main