Differences
This shows you the differences between two versions of the page.
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]check the tips page: http:// | ||
+ | * [b]see what is new in devel version: http:// | ||
- | <hi # | ||
- | TBD | + | ===== 1. Install from GIT ===== |
- | ===== Config File ===== | + | <hi # |
- | TBD: details | + | The steps here are given for Unbuntu/ |
+ | |||
+ | ==== 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__ client: apt-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:// | ||
+ | |||
+ | * __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. | ||
< | < | ||
+ | mkdir -p / | ||
+ | | ||
+ | cd / | ||
+ | </ | ||
+ | |||
+ | Download the sources from GIT using the following command. | ||
+ | |||
+ | < | ||
+ | git clone --depth 1 git:// | ||
+ | </ | ||
+ | |||
+ | |||
+ | ==== 1.3.Tuning Makefiles ==== | ||
+ | |||
+ | Next step is to edit Makefile files to include the MySQL module. | ||
+ | < | ||
+ | cd sip-router | ||
+ | | ||
+ | vim Makefile | ||
+ | </ | ||
+ | |||
+ | 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: | ||
+ | |||
+ | < | ||
+ | make all | ||
+ | </ | ||
+ | |||
+ | |||
+ | ==== 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: | ||
+ | |||
+ | < | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | These are: | ||
+ | |||
+ | * __ser__ - SIP Router binary | ||
+ | |||
+ | |||
+ | To be able to use the binaries from command line, make sure that '/ | ||
+ | |||
+ | PATH=$PATH:/ | ||
+ | export PATH | ||
+ | |||
+ | SIP Router modules are installed in: | ||
+ | |||
+ | / | ||
+ | |||
+ | The documentation and readme files are installed in: | ||
+ | |||
+ | / | ||
+ | |||
+ | The man pages are installed in: | ||
+ | |||
+ | / | ||
+ | / | ||
+ | |||
+ | The configuration file was installed in: | ||
+ | |||
+ | / | ||
+ | |||
+ | 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, | ||
+ | * copy it and paste into **/ | ||
+ | |||
+ | **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 | + | # *** To enable |
# sed -i ' | # sed -i ' | ||
# | # | ||
- | # *** To enamble | + | # *** To enable |
# - enable mysql | # - enable mysql | ||
# sed -i ' | # sed -i ' | ||
# - add users using ' | # - add users using ' | ||
# | # | ||
- | # *** To enamble | + | # *** To enable |
# - enable mysql | # - enable mysql | ||
# sed -i ' | # sed -i ' | ||
# | # | ||
- | # *** To enamble | + | # *** To enable |
# - enable mysql | # - enable mysql | ||
# sed -i ' | # sed -i ' | ||
# | # | ||
- | # *** To enamble | + | # *** To enable |
# sed -i ' | # sed -i ' | ||
# - install RTPProxy: http:// | # - install RTPProxy: http:// | ||
Line 120: | Line 235: | ||
# | # | ||
- | |||
- | listen=udp: | ||
/* 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/ | bind on a specific interface/ | ||
- | #listen=udp: | + | listen=udp: |
Line 134: | Line 247: | ||
/* uncomment next line for MySQL DB support */ | /* uncomment next line for MySQL DB support */ | ||
- | loadmodule " | + | loadmodule " |
- | loadmodule " | + | loadmodule " |
- | loadmodule " | + | loadmodule " |
- | loadmodule " | + | loadmodule " |
- | loadmodule " | + | loadmodule " |
- | loadmodule " | + | loadmodule " |
- | loadmodule " | + | loadmodule " |
- | loadmodule " | + | loadmodule " |
- | loadmodule " | + | loadmodule " |
- | loadmodule " | + | loadmodule " |
- | loadmodule " | + | loadmodule " |
- | loadmodule " | + | loadmodule " |
- | loadmodule " | + | loadmodule " |
- | loadmodule " | + | loadmodule " |
- | loadmodule " | + | loadmodule " |
- | loadmodule " | + | loadmodule " |
- | loadmodule " | + | loadmodule " |
/* 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 " | + | loadmodule " |
- | loadmodule " | + | loadmodule " |
/* 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 " | + | #loadmodule " |
/* 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 " | (see " | ||
- | #loadmodule " | + | #loadmodule " |
/* 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 " | + | loadmodule " |
- | loadmodule " | + | loadmodule " |
- | loadmodule " | + | loadmodule " |
# ----------------- setting module-specific parameters --------------- | # ----------------- setting module-specific parameters --------------- | ||
Line 281: | Line 394: | ||
modparam(" | modparam(" | ||
modparam(" | modparam(" | ||
- | |||
- | #extra testing | ||
- | modparam(" | ||
####### 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); | setflag(3); | ||
} | } | ||
- | route(1); | + | route(RELAY); |
} else { | } else { | ||
if (is_method(" | if (is_method(" | ||
# 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(" | if( is_method(" | ||
- | route(2); | + | route(PRESENCE); |
} | } | ||
if (is_method(" | if (is_method(" | ||
{ | { | ||
+ | if (isflagset(5)) | ||
+ | setbflag(6); | ||
if (!save(" | if (!save(" | ||
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(" | if (check_route_param(" | ||
setbflag(" | setbflag(" | ||
} | } | ||
if (isflagset(5) || isbflagset(" | if (isflagset(5) || isbflagset(" | ||
- | route(5); | + | route(RTPPROXY); |
} | } | ||
/* example how to enable some additional event routes */ | /* example how to enable some additional event routes */ | ||
if (is_method(" | if (is_method(" | ||
- | # | + | # |
- | t_on_reply(" | + | t_on_reply(" |
- | t_on_failure(" | + | t_on_failure(" |
} | } | ||
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(" | if (is_method(" | ||
{ | { | ||
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(" | if (nat_uac_test(" | ||
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(" | if (is_method(" | ||
unforce_rtp_proxy(); | unforce_rtp_proxy(); | ||
Line 540: | Line 650: | ||
} | } | ||
- | branch_route[1] { | + | branch_route[BRANCH_ONE] { |
xdbg(" | xdbg(" | ||
} | } | ||
- | onreply_route[1] { | + | onreply_route[REPLY_ONE] { |
xdbg(" | xdbg(" | ||
Line 557: | Line 667: | ||
- | failure_route[1] { | + | failure_route[FAIL_ONE] { |
if (is_method(" | if (is_method(" | ||
&& | && | ||
Line 585: | Line 695: | ||
</ | </ | ||
+ | |||
+ | |||
+ | |||
+ | ===== 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:// | ||
+ | |||
+ | < | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | Start SIP Router with the config above: | ||
+ | |||
+ | < | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | ===== 4. Remarks ===== | ||
+ | |||
+ | <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**" | ||
+ | * Exceptional | ||
+ | * Excellent | ||
+ | * Exotic (as Kamailio name origins) | ||
+ | * Express (the initial project name) | ||
+ | * Extraordinary | ||
+ | * ... | ||
+ |