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
Last revision Both sides next revision
migration:kamailio-3.0-config [2009/05/13 12:57]
miconda
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] 
 + 
 + 
 +===== 1. Install from GIT =====
  
 <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> <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>
Line 17: Line 22:
 The steps here are given for Unbuntu/Debian based distributions and should be easy to adapt to other Linux distros. The steps here are given for Unbuntu/Debian based distributions and should be easy to adapt to other Linux distros.
  
-==== 1. Prerequisites ====+==== 1.1. Prerequisites ====
  
 To be able to follow the guidelines from this document you need **root** access. To be able to follow the guidelines from this document you need **root** access.
Line 35: Line 40:
   * __make__ - apt-get install make   * __make__ - apt-get install make
  
-==== 2. Getting sources from GIT ====+==== 1.2. Getting sources from GIT ====
  
  
Line 53: Line 58:
  
  
-====3.Tuning Makefiles =====+==== 1.3.Tuning Makefiles ====
  
 Next step is to edit Makefile files to include the MySQL module. Next step is to edit Makefile files to include the MySQL module.
Line 67: Line 72:
  
  
-====4. Compile SIP Router =====+==== 1.4. Compile SIP Router ====
  
 Once the mysql module was removed from excluded modules list, you can compile: Once the mysql module was removed from excluded modules list, you can compile:
Line 76: Line 81:
  
  
-====5. Install SIP Router =====+==== 1.5. Install SIP Router ====
  
 When the compilation is ready, install with the following command: When the compilation is ready, install with the following command:
Line 82: Line 87:
   make install   make install
  
-====6. What and where was installed =====+==== 1.6. What and where was installed ====
  
 The binaries and executable scripts were installed in: The binaries and executable scripts were installed in:
Line 117: Line 122:
   /usr/local/etc/ser/ser.cfg   /usr/local/etc/ser/ser.cfg
  
-However, this configuration file is not the one used by Kamailio (OpenSER) 1.5.x. Next section includes it.+However, this configuration file is not the one used by Kamailio (OpenSER) 1.5.x. Section 2 includes it.
  
  
-===== 7. Kamailio Config File =====+===== 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   * this is the configuration file from Kamailio (OpenSER) 1.5.x adapted for the development version based on SIP-Router.org project
Line 126: Line 131:
   * copy it and paste into **/usr/local/etc/ser/kamailio.org**   * copy it and paste into **/usr/local/etc/ser/kamailio.org**
  
-<code>+**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 144: 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 225: 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 239: 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 386: 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 401: Line 406:
  exit;  exit;
  }  }
- 
- $avp(test) = 1; 
  
  # NAT detection  # NAT detection
- route(4);+ route(NAT);
  
  if (has_totag()) {  if (has_totag()) {
Line 415: 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 450: 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 473: Line 476:
  ## exit;  ## exit;
  ##}  ##}
- route(1);+ route(RELAY);
  }  }
  
Line 479: 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 515: 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 543: 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 575: 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 620: 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 635: 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 645: 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 662: 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 691: Line 696:
 </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)