User Tools

Site Tools


install:devel:git

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
install:devel:git [2011/10/02 22:08]
miconda [4. Compile Kamailio (OpenSER)]
install:devel:git [2019/01/11 17:20]
pepelux
Line 3: Line 3:
 <code> <code>
 Main author: Main author:
-   Daniel-Constantin Mierla <miconda (at) gmail.com>+   Daniel-Constantin Mierla 
 + 
 +Support: <sr-users@lists.sip-router.org>
 </code> </code>
  
 This is a step by step tutorial about how to install and maintain Kamailio SIP server development version using the sources downloaded from GIT repository - the choice for those willing to write code for Kamailio or to try the new features to be released in the future with the next major stable version. This is a step by step tutorial about how to install and maintain Kamailio SIP server development version using the sources downloaded from GIT repository - the choice for those willing to write code for Kamailio or to try the new features to be released in the future with the next major stable version.
  
-//This document focuses on Kamailio devel (at this time it is the upcoming v3.2.0) with MySQL support, using a Debian unstable system.//+//This document focuses on Kamailio devel (at this time it is the upcoming v4.0.0) with MySQL support, using a Debian unstable system.//
  
  
 ==== Notes on Kamailio vs SER ==== ==== Notes on Kamailio vs SER ====
  
-Since version 3.0.0, Kamailio and SER are built from same source codemeaning that they are more or less same application+Since version 4.0.0, Kamailio and SER are completely mergedno duplicated modules anymore. Default application name is **kamailio**.
- +
-The difference is in few compile time options that are enabled in Kamailio. These are: +
-  enable Kamailio-style statistics framework - if you don't know what they are, then you don't need them anyhow +
-  enable application server extensions in TM module needed only by seas module - unless you use seas module, these extensions make no difference to you+
  
-You can build as well SER with these extensions by editing the Makefiles. Alsoall modules work with Kamailio-style statistics framework disabled.+The 3.x.x series offered the possibility to build Kamailio and SER from same source codemeaning that they were more or less same application, but there were some overlapping modules using different database table structures.
  
 ===== 1. Prerequisites ===== ===== 1. Prerequisites =====
Line 28: Line 26:
  
   * __git__ client: apt-get install git-core - it is recommended to have a recent version, if your Linux distro has an old version, you can download newer one from: http://git-scm.com/   * __git__ client: apt-get install git-core - it is recommended to have a recent version, if your Linux distro has an old version, you can download newer one from: http://git-scm.com/
-  * __gcc__ compiler: apt-get install gcc+  * __gcc__ and __g++__ compilers: apt-get install gcc g++
   * __flex__ - apt-get install flex   * __flex__ - apt-get install flex
   * __bison__ - apt-get install bison   * __bison__ - apt-get install bison
Line 38: Line 36:
     * __libxml2__ - apt-get install libxml2-dev     * __libxml2__ - apt-get install libxml2-dev
     * __libpcre3__ - apt-get install libpcre3-dev     * __libpcre3__ - apt-get install libpcre3-dev
 +
 +**Important Note**: starting with version 4.3.0, Kamailio uses the directory **/var/run/kamailio/** for creating FIFO and UnixSocket control files. You have to complete the section related to installation of init.d script for creating /var/run/kamailio even if you plan to start Kamailio manually from command line. The alternative is to set different paths via parameters of **mi_fifo** and **ctl** modules.
  
 ===== 2. Getting sources from GIT ===== ===== 2. Getting sources from GIT =====
Line 51: Line 51:
  
 <code> <code>
-  git clone --depth 1 git://git.sip-router.org/sip-router kamailio+  git clone --depth 1 --no-single-branch https://github.com/kamailio/kamailio kamailio
   cd kamailio   cd kamailio
 </code> </code>
  
 +//Note: if your git client version does not support **--no-single-branch** command line parameter, then just remove it.// 
 ===== 3.Tuning Makefiles ===== ===== 3.Tuning Makefiles =====
  
-The **most important and first step** is to set build flavour to **kamailio**.+The first step is to generate build config files.
  
 <code> <code>
-  make FLAVOUR=kamailio cfg+  make cfg
 </code> </code>
- 
-If you forget to set the flavour to kamailio, the default build is SER (note that SER flavour does not enable by default Kamailio's statistics support and application server extensions in tm module needed only by **seas** module, otherwise is the same application, just using a different name). 
  
 Next step is to enable the MySQL module. Edit **modules.lst** file: Next step is to enable the MySQL module. Edit **modules.lst** file:
  
 <code> <code>
-  nano -w modules.lst+  nano -w src/modules.lst
 </code> </code>
  
Line 80: Line 78:
 Save the **modules.lst** and exit. Save the **modules.lst** and exit.
  
-NOTE: this is one mechanism to enable modules which are not compiled by default, such as lcr, dialplan, presence -- add the modules to **include_modules** variable inside the **modules.lst** file.+**NOTE**: this is one mechanism to enable modules which are not compiled by default, such as lcr, dialplan, presence -- add the modules to **include_modules** variable inside the **modules.lst** file.
  
 Alternative is to set 'include_modules' variable to specify what extra modules to be included for compilation when building Makefile cfg: Alternative is to set 'include_modules' variable to specify what extra modules to be included for compilation when building Makefile cfg:
  
 <code> <code>
-make FLAVOUR=kamailio include_modules="db_mysql dialplan" cfg+make include_modules="db_mysql dialplan" cfg
 </code> </code>
  
-If you want to install everything in one directory (so you can delete all installed files at once), say /usr/local/kamailio-devel, then set PREFIX variable to the install path in 'make cfg ...' command:+**NOTE**: If you want to install everything in one directory (so you can delete all installed files at once), say /usr/local/kamailio-devel, then set PREFIX variable to the install path in 'make cfg ...' command:
  
 <code> <code>
-make PREFIX="/usr/local/kamailio-devel" FLAVOUR=kamailio  include_modules="db_mysql dialplan" cfg+make PREFIX="/usr/local/kamailio-devel" include_modules="db_mysql dialplan" cfg
 </code> </code>
  
Line 98: Line 96:
   * http://sip-router.org/wiki/tutorials/makefile-system   * http://sip-router.org/wiki/tutorials/makefile-system
  
 +**NOTE**: Previous release series 3.x.x used FLAVOUR mechanism to set the name of the application to **kamailio**. Starting with 4.0.0, the default is **kamailio**. From that version, if you want to build **ser** flavour, use **FLAVOUR=ser** in the make command to generate the build configs.
 ===== 4. Compile Kamailio ===== ===== 4. Compile Kamailio =====
  
Line 112: Line 111:
 </code> </code>
  
-===== 5. Install Kamailio (OpenSER) =====+===== 5. Install Kamailio =====
  
-When the compilation is ready, install Kamailio (OpenSER) with the following command:+When the compilation is ready, install Kamailio with the following command:
  
 <code> <code>
Line 131: Line 130:
 These are: These are:
  
-  * __kamailio__ - Kamailio (OpenSER) server+  * __kamailio__ - Kamailio SIP server
   * __kamdbctl__ - script to create and manage the Databases   * __kamdbctl__ - script to create and manage the Databases
-  * __kamctl__ - script to manage and control Kamailio (OpenSER) server +  * __kamctl__ - script to manage and control Kamailio SIP server 
-  * __sercmd__ - CLI - command line tool to interface with Kamailio (OpenSER) server+  * __kamcmd__ - CLI - command line tool to interface with Kamailio SIP server
  
 To be able to use the binaries from command line, make sure that '/usr/local/sbin' is set in PATH environment variable. You can check that with 'echo $PATH'. If not and you are using 'bash', open '/root/.bash_profile' and at the end add: To be able to use the binaries from command line, make sure that '/usr/local/sbin' is set in PATH environment variable. You can check that with 'echo $PATH'. If not and you are using 'bash', open '/root/.bash_profile' and at the end add:
Line 147: Line 146:
 <code> <code>
   /usr/local/lib/kamailio/modules/   /usr/local/lib/kamailio/modules/
-  /usr/local/lib/kamailio/modules_k/ 
 </code> </code>
 +Note: On 64 bit systems, /usr/local/lib64 may be used.
  
 The documentation and readme files are installed in: The documentation and readme files are installed in:
Line 169: Line 168:
 </code> </code>
  
 +**NOTE:**: In case you set the PREFIX variable in 'make cfg ...' command, then replace **/usr/local** in all paths above with the value of PREFIX in order to locate the files installed.
 ===== 7. Create MySQL database ===== ===== 7. Create MySQL database =====
  
-To create the MySQL database, you have to use the database setup script:+To create the MySQL database, you have to use the database setup script. First edit **kamctlrc** file to set the database server type:
  
 <code> <code>
-  /usr/local/sbin/kamdbctl create+  nano -w /usr/local/etc/kamailio/kamctlrc
 </code> </code>
  
-In order to create the database you need to specify the wanted db type (DBENGINE=MYSQL) in the +Locate DBENGINE variable and set it to MYSQL:
  
 <code> <code>
-  /usr/local/etc/kamailio/kamctlrc+DBENGINE=MYSQL 
 +</code> 
 + 
 +You can change other values in **kamctlrc** file, at least it is recommended to change the default passwords for the users to be created to connect to database. 
 + 
 +Once you are done updating **kamctlrc** file, run the script to create the database used by Kamailio: 
 + 
 +<code> 
 +  /usr/local/sbin/kamdbctl create
 </code> </code>
  
-file. Call this script without any parameter to get some help for the usage. You will be asked for the domain name Kamailio (OpenSER) is going to serve (e.g., mysipserver.com) and the password of the 'root' MySQL user. The script will create a database named 'openser' containing the tables required by Kamailio (OpenSER). You can change the default settings in the kamctlrc file mentioned above.+You can call this script without any parameter to get some help for the usage. You will be asked for the domain name Kamailio is going to serve (e.g., mysipserver.com) and the password of the 'root' MySQL user. The script will create a database named 'kamailio' containing the tables required by Kamailio. You can change the default settings in the kamctlrc file mentioned above.
  
 The script will add two users in MySQL: The script will add two users in MySQL:
  
-- **openser** - having the password 'openserrw'user which has full access rights to 'openser' database+- **kamailio** - (with default password 'kamailiorw') - user which has full access rights to 'kamailio' database
  
-- **openserro** - having the password 'openserro'user which has read-only access rights to 'openser' database+- **kamailioro** - (with default password 'kamailioro') - user which has read-only access rights to 'kamailio' database
  
-**__Do change the passwords for these two users immediately after the database is created.__**+**__Do change the passwords for these two users to something different that the default values that come with sources.__**
  
 ===== 8. Edit configuration file ===== ===== 8. Edit configuration file =====
Line 209: Line 217:
 </code> </code>
  
-If you changed the password for the 'openser' user of MySQL, you have to update the value for 'db_url' parameters.+If you changed the password for the 'kamailio' user of MySQL, you have to update the value for 'db_url' parameters.
  
 You can browse [[http://git.sip-router.org/cgi-bin/gitweb.cgi?p=sip-router;a=blob;f=etc/kamailio.cfg|kamailio.cfg]] online on GIT repository. You can browse [[http://git.sip-router.org/cgi-bin/gitweb.cgi?p=sip-router;a=blob;f=etc/kamailio.cfg|kamailio.cfg]] online on GIT repository.
Line 215: Line 223:
 ===== 9. The init.d script ===== ===== 9. The init.d script =====
  
-The init.d script can be used to start/stop the Kamailio (OpenSER) server in a nicer way. A sample of init.d script for Kamailio (OpenSER) is provided at: +The init.d script can be used to start/stop the Kamailio server in a nicer way. A sample of init.d script for Kamailio is provided at:
- +
-<code> +
-  /usr/local/src/kamailio-devel/pkg/kamailio/debian/kamailio.init +
-</code>+
  
 <code> <code>
Line 231: Line 235:
 </code> </code>
  
-then edit the file updating the $DAEMON value:+then edit the file updating the $DAEMON and $CFGFILE values: 
 <code> <code>
   DAEMON=/usr/local/sbin/kamailio   DAEMON=/usr/local/sbin/kamailio
 +  CFGFILE=/usr/local/etc/kamailio/kamailio.cfg
 </code> </code>
  
Line 261: Line 267:
 </code> </code>
  
-Then you can start/stop Kamailio (OpenSER) using the following commands:+Then you can start/stop Kamailio using the following commands:
  
 <code> <code>
Line 299: Line 305:
 </code> </code>
  
-Now you have the latest Kamailio (OpenSER) devel running on your system.+Now you have the latest Kamailio devel running on your system.
  
  
Line 311: Line 317:
 </code> </code>
  
-then an update has been made to Kamailio (OpenSER) devel version and it will be available to the public GIT in no time.+then an update has been made to Kamailio devel version and it will be available to the public GIT in no time.
  
install/devel/git.txt · Last modified: 2019/01/11 17:20 by pepelux