Differences

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

Link to this comparison view

Next revision
Previous revision
Last revision Both sides next revision
migration:kamailio-3.0-config [2009/05/12 22:36]
miconda created
migration:kamailio-3.0-config [2009/07/14 18:01]
82.113.106.158
Line 11: Line 11:
   * Presence server   * Presence server
  
-===== Install from GIT =====+[b]IMPORTANT:[/b] 
 +  * [b]check the tips page: http://sip-router.org/wiki/migration/kamailio-tips[/b] 
 +  * [b]see what is new in devel version: http://sip-router.org/wiki/features/new-in-devel[/b]
  
-<hi #6495ed>It is highly recommended that you have Kamailio 1.5.x installed already so you can use the additional tools coming with that version and not yet included in SIP Router.</hi> 
  
-TBD+===== 1. Install from GIT =====
  
-===== Config File =====+<hi #6495ed>It is highly recommended that you have Kamailio 1.5.x installed already so you can use the additional tools coming with that version and not yet included in SIP Router. See here [[http://www.kamailio.org/dokuwiki/doku.php/install:kamailio-1.5.x-from-svn|a step by step guide to install Kamailio 1.5.x from SVN]]</hi>
  
-TBDdetails+The steps here are given for Unbuntu/Debian based distributions and should be easy to adapt to other Linux distros. 
 + 
 +==== 1.1. Prerequisites ==== 
 + 
 +To be able to follow the guidelines from this document you need **root** access. 
 + 
 +The following packages are required before proceeding to the next steps. 
 + 
 +  * __git__ clientapt-get install git-core - it is recommended to have the latest version, which might not be part of the distribution yet, but you can get it from: http://git-scm.com/ 
 + 
 +  * __gcc__ compiler: apt-get install gcc 
 + 
 +  * __flex__ - apt-get install flex 
 + 
 +  * __bison__ - apt-get install bison 
 + 
 +  * __libmysqlclient15-dev__ - apt-get install libmysqlclient15-dev 
 + 
 +  * __make__ - apt-get install make 
 + 
 +==== 1.2. Getting sources from GIT ==== 
 + 
 + 
 +First of all, you have to create a directory on the file system where the sources will be stored. 
  
 <code> <code>
 +  mkdir -p /usr/local/src/sr
 +  
 +  cd /usr/local/src/sr
 +</code>
 +
 +Download the sources from GIT using the following command.
 +
 +<code>
 +git clone --depth 1 git://git.sip-router.org/sip-router
 +</code>
 +
 +
 +==== 1.3.Tuning Makefiles ====
 +
 +Next step is to edit Makefile files to include the MySQL module.
 +<code>
 +  cd sip-router
 +  
 +  vim Makefile
 +</code>
 +
 +Remove **db_mysql** from **exclude_modules** variable.
 +
 +Note: if you need PCRE-dependent modules (e.g., lcr, dialplan, regexp), instal the PCRE devel library and uncomment
 +
 +
 +==== 1.4. Compile SIP Router ====
 +
 +Once the mysql module was removed from excluded modules list, you can compile:
 +
 +<code>
 +  make all
 +</code>
 +
 +
 +==== 1.5. Install SIP Router ====
 +
 +When the compilation is ready, install with the following command:
 +
 +  make install
 +
 +==== 1.6. What and where was installed ====
 +
 +The binaries and executable scripts were installed in:
 +
 +<code>
 +  /usr/local/sbin
 +</code>
 +
 +These are:
 +
 +  * __ser__ - SIP Router binary
 +
 +
 +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:
 +
 +  PATH=$PATH:/usr/local/sbin
 +  export PATH
 +
 +SIP Router modules are installed in:
 +
 +  /usr/local/lib/ser/modules/
 +
 +The documentation and readme files are installed in:
 +
 +  /usr/local/share/doc/ser/
 +
 +The man pages are installed in:
 +
 +  /usr/local/share/man/man5/
 +  /usr/local/share/man/man8/
 +
 +The configuration file was installed in:
 +
 +  /usr/local/etc/ser/ser.cfg
 +
 +However, this configuration file is not the one used by Kamailio (OpenSER) 1.5.x. Section 2 includes it.
 +
 +
 +===== 2. Kamailio Config File =====
 +
 +  * this is the configuration file from Kamailio (OpenSER) 1.5.x adapted for the development version based on SIP-Router.org project
 +  * it has turned on most of the features that are by default commented (authentication, accounting, nat traversal, presence)
 +  * copy it and paste into **/usr/local/etc/ser/kamailio.org**
 +
 +**Remarks**:
 +  * it runs in debug mode, level 5
 +  * only udp, tcp is disabled
 +  * one child
 +
 +<code c>
 # #
 # $Id: kamailio.cfg 5679 2009-03-10 09:22:27Z ibc_sf $ # $Id: kamailio.cfg 5679 2009-03-10 09:22:27Z ibc_sf $
Line 39: Line 154:
 # sed commands that help you enable such features. # sed commands that help you enable such features.
 # #
-# *** To enamble mysql execute:+# *** To enable mysql execute:
 #     sed -i 's///g' kamailio.cfg #     sed -i 's///g' kamailio.cfg
 # #
-# *** To enamble authentication execute:+# *** To enable authentication execute:
 #     - enable mysql #     - enable mysql
 #     sed -i 's///g' kamailio.cfg #     sed -i 's///g' kamailio.cfg
 #     - add users using 'kamctl' #     - add users using 'kamctl'
 # #
-# *** To enamble persistent user location execute:+# *** To enable persistent user location execute:
 #     - enable mysql #     - enable mysql
 #     sed -i 's///g' kamailio.cfg #     sed -i 's///g' kamailio.cfg
 # #
-# *** To enamble presence server execute:+# *** To enable presence server execute:
 #     - enable mysql #     - enable mysql
 #     sed -i 's///g' kamailio.cfg #     sed -i 's///g' kamailio.cfg
 # #
-# *** To enamble nat traversal execute:+# *** To enable nat traversal execute:
 #     sed -i 's///g' kamailio.cfg #     sed -i 's///g' kamailio.cfg
 #     - install RTPProxy: http://www.rtpproxy.org #     - install RTPProxy: http://www.rtpproxy.org
Line 120: Line 235:
 #tls_ca_list     = "/usr/local/etc/kamailio/tls/user/user-calist.pem" #tls_ca_list     = "/usr/local/etc/kamailio/tls/user/user-calist.pem"
  
- 
-listen=udp:192.168.1.23:5060 
  
 /* uncomment and configure the following line if you want Kamailio to  /* uncomment and configure the following line if you want Kamailio to 
    bind on a specific interface/port/proto (default bind on all available) */    bind on a specific interface/port/proto (default bind on all available) */
-#listen=udp:192.168.1.2:5060+listen=udp:192.168.1.23:5060
  
  
Line 134: Line 247:
  
 /* uncomment next line for MySQL DB support */ /* uncomment next line for MySQL DB support */
-loadmodule "modules/db_mysql/db_mysql.so" +loadmodule "modules/db_mysql.so" 
-loadmodule "modules_k/mi_fifo/mi_fifo.so" +loadmodule "modules_k/mi_fifo.so" 
-loadmodule "modules_k/mi_datagram/mi_datagram.so" +loadmodule "modules_k/mi_datagram.so" 
-loadmodule "modules_k/kex/kex.so" +loadmodule "modules_k/kex.so" 
-loadmodule "modules_k/sl/sl.so" +loadmodule "modules_k/sl.so" 
-loadmodule "modules/tm/tm.so" +loadmodule "modules/tm.so" 
-loadmodule "modules_k/tmx/tmx.so" +loadmodule "modules_k/tmx.so" 
-loadmodule "modules_k/rr/rr.so" +loadmodule "modules_k/rr.so" 
-loadmodule "modules_k/pv/pv.so" +loadmodule "modules_k/pv.so" 
-loadmodule "modules_k/maxfwd/maxfwd.so" +loadmodule "modules_k/maxfwd.so" 
-loadmodule "modules_k/usrloc/usrloc.so" +loadmodule "modules_k/usrloc.so" 
-loadmodule "modules_k/registrar/registrar.so" +loadmodule "modules_k/registrar.so" 
-loadmodule "modules_k/textops/textops.so" +loadmodule "modules_k/textops.so" 
-loadmodule "modules_k/uri_db/uri_db.so" +loadmodule "modules_k/uri_db.so" 
-loadmodule "modules_k/siputils/siputils.so" +loadmodule "modules_k/siputils.so" 
-loadmodule "modules_k/xlog/xlog.so" +loadmodule "modules_k/xlog.so" 
-loadmodule "modules_k/acc/acc.so"+loadmodule "modules_k/acc.so"
 /* uncomment next lines for MySQL based authentication support  /* uncomment next lines for MySQL based authentication support 
    NOTE: a DB (like db_mysql) module must be also loaded */    NOTE: a DB (like db_mysql) module must be also loaded */
-loadmodule "modules_k/auth/auth.so" +loadmodule "modules_k/auth.so" 
-loadmodule "modules_k/auth_db/auth_db.so"+loadmodule "modules_k/auth_db.so"
 /* uncomment next line for aliases support /* uncomment next line for aliases support
    NOTE: a DB (like db_mysql) module must be also loaded */    NOTE: a DB (like db_mysql) module must be also loaded */
-#loadmodule "modules_k/alias_db/alias_db.so"+#loadmodule "modules_k/alias_db.so"
 /* uncomment next line for multi-domain support /* uncomment next line for multi-domain support
    NOTE: a DB (like db_mysql) module must be also loaded    NOTE: a DB (like db_mysql) module must be also loaded
    NOTE: be sure and enable multi-domain support in all used modules    NOTE: be sure and enable multi-domain support in all used modules
          (see "multi-module params" section ) */          (see "multi-module params" section ) */
-#loadmodule "modules_k/domain/domain.so"+#loadmodule "modules_k/domain.so"
 /* uncomment the next two lines for presence server support /* uncomment the next two lines for presence server support
    NOTE: a DB (like db_mysql) module must be also loaded */    NOTE: a DB (like db_mysql) module must be also loaded */
-loadmodule "modules_k/presence/presence.so" +loadmodule "modules_k/presence.so" 
-loadmodule "modules_k/presence_xml/presence_xml.so"+loadmodule "modules_k/presence_xml.so"
  
-loadmodule "modules_k/nathelper/nathelper.so"+loadmodule "modules_k/nathelper.so"
  
 # ----------------- setting module-specific parameters --------------- # ----------------- setting module-specific parameters ---------------
Line 281: Line 394:
 modparam("registrar|nathelper", "received_avp", "$avp(i:80)") modparam("registrar|nathelper", "received_avp", "$avp(i:80)")
 modparam("usrloc", "nat_bflag", 6) modparam("usrloc", "nat_bflag", 6)
- 
-#extra testing 
-modparam("pv", "avp_aliases", "test=i:11;st=s:asd") 
  
 ####### Routing Logic ######## ####### Routing Logic ########
Line 296: Line 406:
  exit;  exit;
  }  }
- 
- $avp(test) = 1; 
  
  # NAT detection  # NAT detection
- route(4);+ route(NAT);
  
  if (has_totag()) {  if (has_totag()) {
Line 310: Line 418:
  setflag(3); # ... even if the transaction fails  setflag(3); # ... even if the transaction fails
  }  }
- route(1);+ route(RELAY);
  } else {  } else {
  if (is_method("SUBSCRIBE") && uri == myself) {  if (is_method("SUBSCRIBE") && uri == myself) {
  # in-dialog subscribe requests  # in-dialog subscribe requests
- route(2);+ route(PRESENCE);
  exit;  exit;
  }  }
Line 345: Line 453:
  
  # authentication  # authentication
- route(3);+ route(AUTH);
  
  # record routing for dialog forming requests (in case they are routed)  # record routing for dialog forming requests (in case they are routed)
Line 368: Line 476:
  ## exit;  ## exit;
  ##}  ##}
- route(1);+ route(RELAY);
  }  }
  
Line 374: Line 482:
  
  if( is_method("PUBLISH|SUBSCRIBE")) {  if( is_method("PUBLISH|SUBSCRIBE")) {
- route(2);+ route(PRESENCE);
  }  }
  
  if (is_method("REGISTER"))  if (is_method("REGISTER"))
  {  {
 + if (isflagset(5))
 + setbflag(6);
  if (!save("location"))  if (!save("location"))
  sl_reply_error();  sl_reply_error();
Line 410: Line 520:
  setflag(2);  setflag(2);
  
- route(1);+ route(RELAY);
 } }
  
  
-route[1] {+route[RELAY] {
  if (check_route_param("nat=yes")) {  if (check_route_param("nat=yes")) {
  setbflag("6");  setbflag("6");
  }  }
  if (isflagset(5) || isbflagset("6")) {  if (isflagset(5) || isbflagset("6")) {
- route(5);+ route(RTPPROXY);
  }  }
  
  /* example how to enable some additional event routes */  /* example how to enable some additional event routes */
  if (is_method("INVITE")) {  if (is_method("INVITE")) {
- #t_on_branch("1"); + #t_on_branch("BRANCH_ONE"); 
- t_on_reply("1"); + t_on_reply("REPLY_ONE"); 
- t_on_failure("1");+ t_on_failure("FAIL_ONE");
  }  }
  
Line 438: Line 548:
 # Presence route # Presence route
 /* uncomment the whole following route for enabling presence server */ /* uncomment the whole following route for enabling presence server */
-route[2]+route[PRESENCE]
 { {
  if (!t_newtran())  if (!t_newtran())
Line 470: Line 580:
 # Authentication route # Authentication route
 /* uncomment the whole following route for enabling authentication */ /* uncomment the whole following route for enabling authentication */
-route[3] {+route[AUTH] {
  if (is_method("REGISTER"))  if (is_method("REGISTER"))
  {  {
Line 515: Line 625:
 # Caller NAT detection route # Caller NAT detection route
 /* uncomment the whole following route for enabling Caller NAT Detection */ /* uncomment the whole following route for enabling Caller NAT Detection */
-route[4]{+route[NAT]{
  force_rport();  force_rport();
  if (nat_uac_test("19")) {  if (nat_uac_test("19")) {
Line 530: Line 640:
 # RTPProxy control # RTPProxy control
 /* uncomment the whole following route for enabling RTPProxy Control */ /* uncomment the whole following route for enabling RTPProxy Control */
-route[5] {+route[RTPROXY] {
  if (is_method("BYE")) {  if (is_method("BYE")) {
  unforce_rtp_proxy();  unforce_rtp_proxy();
Line 540: Line 650:
 } }
  
-branch_route[1] {+branch_route[BRANCH_ONE] {
  xdbg("new branch at $ru\n");  xdbg("new branch at $ru\n");
 } }
  
  
-onreply_route[1] {+onreply_route[REPLY_ONE] {
  xdbg("incoming reply\n");  xdbg("incoming reply\n");
  
Line 557: Line 667:
  
  
-failure_route[1] {+failure_route[FAIL_ONE] {
  if (is_method("INVITE")  if (is_method("INVITE")
  && (isbflagset("6") || isflagset(5))) {  && (isbflagset("6") || isflagset(5))) {
Line 585: Line 695:
  
 </code> </code>
 +
 +
 +
 +===== 3. Run it =====
 +
 +You must have the database used by Kamailio (OpenSER) 1.5.x created. The name of the database is **openser**. If you installed Kamailio (OpenSER) 1.5.x from SVN using the Dokuwiki guidelines (http://www.kamailio.org/dokuwiki/doku.php/install:kamailio-1.5.x-from-svn), then you should do:
 +
 +<code>
 +/usr/local/sbin/kamdbctl create
 +</code>
 +
 +Start SIP Router with the config above:
 +
 +<code>
 +/usr/local/sbin/ser -f /usr/local/etc/ser/kamailio.cfg
 +</code>
 +
 +===== 4. Remarks =====
 +
 +<hi #98fb98>Please contribute here with remarks and comments.</hi>
 +
 +  * load kex module for Kamailio core specific extensions
 +  * load tmx module for Kamailio TM specific extensions
 +  * avp_aliases is now a parameter of pv module
 +
 +===== 5. FAQ =====
 +
 +  * **Q**: Why binary is named ser?
 +    * **A**: It is the default name for SIP Router binary. In the future, the packaged version will differ from what is now. However, right now, it is the short of: "**SIP E Router**" where **E** comes from any of:
 +      * Exceptional
 +      * Excellent
 +      * Exotic (as Kamailio name origins)
 +      * Express (the initial project name)
 +      * Extraordinary
 +      * ...
 +

Navigation

Wiki

Other

QR Code
QR Code migration:kamailio-3.0-config (generated for current page)