Differences

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

Link to this comparison view

features:new-in-3.0.x [2009/10/30 23:18]
miconda
features:new-in-3.0.x [2012/03/22 13:26] (current)
80.250.1.245 removed spam
Line 1: Line 1:
 ====== New in v3.0.0 ====== ====== New in v3.0.0 ======
  
-Testing periodSeptember - October2009 +//**Release of 3.0.0January 112010**// 
-Release due to: October 2009+
  
 **IMPORTANT:** Source code for Kamailio 3.0 is hosted on GIT repository at http://sip-router.org  **IMPORTANT:** Source code for Kamailio 3.0 is hosted on GIT repository at http://sip-router.org 
Line 8: Line 8:
 **IMPORTANT:** SVN trunk on SourceForge.net is updated only for branches 1.5 or lower. **IMPORTANT:** SVN trunk on SourceForge.net is updated only for branches 1.5 or lower.
  
-===== List of new features =====+//Being far from a complete listing of the new features, this page tries to give a fair overview of astonishing number of new functionalities and improvements available in Kamailio (OpenSER) 3.0.0.// 
 + 
 +//This is first release based on http://sip-router.org project, meaning that you can have all Kamailio (OpenSER) and SIP Express Router (SER) extensions and functionalities mixed in same configuration file.// 
 + 
 +===== !!! New in core ===== 
 + 
 +==== Transport layer ==== 
 + 
 +== UDP == 
 + 
 +  * mili-second base retransmission 
 +  * integration with internal DNS cache system and auto black-listing 
 +  * fallback to TCP, TLS or SCTP if the UDP packet is too big 
 +  * management of UDP cfg parameters at runtime via RPC control interface 
 + 
 +Example config to fallback to TCP is size of SIP request is bigger than 1024 bytes: 
 + 
 +<code c> 
 +udp_mtu = 1024 
 +udp_mtu_try_proto = TCP 
 +</code>
  
-==== !!! New in core ====+== TCP ==
  
-  * updates to transport layers: UDP, TCP/TLS and SCTP 
   * asynchronous TCP sending   * asynchronous TCP sending
-  * asynchronous message processing support +  * many new parameters to tune TCP connection behaviour 
-  access to new features in parts likememory managers, locking and synchronization, timers, DNS +    http://www.kamailio.org/dokuwiki/doku.php/core-cookbook:3.0.x#tcp_parameters 
-  * build framework that allow creation of libraries from code, thus ability to make core more lightweight and remove duplications in an efficient way +  * TCP keepalive support 
-  * send route - route called just before sending the message, meaning it will show the final content (headers and body updated) and makes available the destination IP address - more flexibility in handling DNS blacklists and filters +  * TCP CRLF ping support 
-  * reload of some config variablesroutes with namesflags with names +  * support many pooling methods: none, pollepoll_ltepoll_et, sigio_rt, select, kqueue, /dev/poll 
-  * support to include files in config via __include_file("filename")__ +  * TCP file descriptions cache - speed improvement in TCP sending 
-  * support for defines (#!define, #!ifdef, #!ifndef, #!else, #!endif)+  * management of TCP cfg parameters at runtime via RPC control interface
  
-=== switch statement ===+<code c> 
 +$sercmd> core.tcp_options 
 +
 + connect_timeout: 10 
 + send_timeout: 10 
 + connection_lifetime: 120 
 + max_connections(soft): 2048 
 + no_connect: 0 
 + fd_cache: 1 
 + async: 1 
 + connect_wait: 1 
 + conn_wq_max: 32768 
 + wq_max: 10485760 
 + defer_accept: 0 
 + delayed_ack: 1 
 + syncnt: 0 
 + linger2: 0 
 + keepalive: 1 
 + keepidle: 0 
 + keepintvl: 0 
 + keepcnt: 0 
 + crlf_ping: 1 
 + accept_aliases: 0 
 + alias_flags: 1 
 + new_conn_alias_flags: 2 
 +
 +</code>
  
-  support for regular expression matching for string +== TLS == 
-  * optimization for integer matching+ 
 +  completely new TLS architecture 
 +  * TLS hooks in core and functionality provided by TLS module 
 +  * no more re-compilation of all sources to enable TLS, just load [b]tls[/b] module 
 +  * dedicated config file to deal easily within multi-homed environment 
 +  * management of TLS cfg parameters at runtime via RPC control interface 
 + 
 +Sample config file for TLS: 
 +<code c> 
 +[server:default] 
 +method = TLSv1 
 +verify_certificate = no 
 +require_certificate = no 
 +private_key = kamailio_key.pem 
 +certificate = kamailio_cert.pem 
 +ca_list = kamailio_ca.pem 
 + 
 +[client:default] 
 +verify_certificate = yes 
 +require_certificate = yes 
 + 
 +[server:10.0.0.10:5061] 
 +method = SSLv23 
 +verify_certificate = yes 
 +require_certificate = no 
 +private_key = privatenet_key.pem 
 +certificate = privatenet_cert.pem 
 +verify_depth = 3 
 +ca_list = privatenet_ca.pem 
 + 
 +[client:10.0.0.11:5061] 
 +verify_certificate = no 
 +certificate = peer_11_client.pem 
 +private_key = peer_11_key.pem 
 +ca_list = peer_11_ca.pem 
 +</code>
  
-=== sctp ===+== SCTP ==
  
-  * support for sctp variants+  * completely new SCTP architecture 
 +  * advancced SCTP implementation 
 +  * multi-homing and multi-streaming (connections association)
   * macros for sctp statistics   * macros for sctp statistics
   * blacklist support at the sctp level. If sctp_send_retries are used, the blacklist will work only for send (using SCTP_SEND_FAILED notifications). If sctp_send_retries is not used (default), there are 2 possible blacklist reasons: SEND or CONNECT (assoc. failed to be opened).   * blacklist support at the sctp level. If sctp_send_retries are used, the blacklist will work only for send (using SCTP_SEND_FAILED notifications). If sctp_send_retries is not used (default), there are 2 possible blacklist reasons: SEND or CONNECT (assoc. failed to be opened).
   * connection reuse & connection tracking   * connection reuse & connection tracking
 +  * management of SCTP cfg parameters at runtime via RPC control interface
  
-=== config file interpreter ===+<code c> 
 +$sercmd core.sctp_info 
 +
 +     opened_connections: 4 
 +     tracked_connections: 0 
 +     total_connections: 40010 
 +}
  
-  * type casts operators: (int), (str)+$ sercmd core.sctp_options 
-  * new operators eq, ne for string compares and ieq, ine for integer compares. The names are not yet final (use them at your own risk). Future version might use ==/!= only for ints (ieq/ine) and eq/ne for strings (under debate).+
 +     sctp_socket_rcvbuf: 54784 
 +     sctp_socket_sndbuf: 54784 
 +     sctp_autoclose: 180 
 +     sctp_send_ttl: 32000 
 +     sctp_send_retries: 0 
 +     sctp_srto_initial: 3000 
 +     sctp_srto_max: 60000 
 +     sctp_srto_min: 1000 
 +     sctp_asocmaxrxt: 10 
 +     sctp_init_max_attempts: 8 
 +     sctp_init_max_timeo: 60000 
 +     sctp_hbinterval: 30000 
 +     sctp_pathmaxrxt: 5 
 +     sctp_sack_delay: 200 
 +     sctp_sack_freq: 0 
 +     sctp_max_burst: 4 
 +
 +</code>
  
-They are almost equivalent to = = or !=, but they force the conversion of their operands (eq to string and ieq to int), allowing among other things better type checking on startup and more optimisations. Non equiv. examples: 0 = = "" (true) is not equivalent to 0 eq "" (false: it evaluates to "0" eq ""). "a" ieq "b" (true: (int)"a" is 0 and (int)"b" is 0) is not equivalent to "a" = = "b" (false).+==== Memory manager ====
  
-Note: internally = = and != are converted on startup to eq/ne/ieq/ine whenever possible (both operand types can be safely determined at start time and they are the same).+  * new Doug Lea (DL) malloc manager 
 +  * new lockless malloc (LL) manager 
 +  * print memory status summary in debug mode 
 + 
 +==== Locking and synchronisation ==== 
 + 
 +  * arch specific optimisations via likely and unlikely defines 
 +  * support for non-blocking lock attempt via lock_try() 
 +  * membar system 
 + 
 +==== Timers ==== 
 + 
 +  * 3 level hierarchical timing wheel 
 +    * G. Varghese, T. Lauck,  Hashed and Hierarchical Timing Wheels: Efficient Data Structures for Implementing a Timer Facility, 1996 
 +  * support for dynamic adding timers 
 +  * one shot and periodic timers 
 +  * "fast" and "slow" timers 
 + 
 +==== DNS ==== 
 + 
 +  * lots of new parameters to tune DNS behaviour 
 +    * http://www.kamailio.org/dokuwiki/doku.php/core-cookbook:3.0.x#dns_parameters 
 +  * internal DNS caching with failover system 
 +  * TXT, EBL and PTR support (both cache and non-cached resolver) 
 + 
 +==== Select framework ==== 
 + 
 +  * new system of config variables 
 +  * over one hundred classes of selects 
 +  * fine access to attributes of header by header index and attributes name (e.g., Via, Auth headers) 
 +  * access to SIP message parts and environment attributes 
 +    * http://www.kamailio.org/dokuwiki/doku.php/selects:3.0.x 
 +  * supported by Pseudo-Variables framework via PV module 
 + 
 +<code c> 
 +if(@cseg.method == "INVITE") 
 +
 +  ... 
 +
 +  
 +if($sel(cseg.method) == "INVITE") 
 +
 +  ... 
 +
 +</code> 
 + 
 +==== Library framework ==== 
 + 
 +  * internal library support -- better modularity and less code duplication -- shared code among several module can be organised now as a library 
 +    * DB interface became **libsrdb1** library 
 +    * new (alternative) DB interface via **libsrdb2** library with support for **prepared statements** 
 +    * Management Interface (MI) became **libmi** library 
 +    * several Kamailio 1.5 core extensions are now in **libkcore** library - slimmer core 
 +  * libraries are located in "lib/" 
 +  * ensure smaller footprint to core - the core is less exposed to bugs and no longer under the threat of becoming fat 
 + 
 +==== RPC Interface ==== 
 +  * scanner-like command interface to Kamailio 
 +  * alternative to exiting Management Interface (MI) 
 + 
 +==== CFG framework ==== 
 + 
 +  * ability to get and set global or module parameters values at runtime 
 +  * get and set internal variables on-the-fly 
 +  * can be controlled via RPC interface 
 +  * eliminate Kamailio restarts whenever possible 
 + 
 +==== CFG Include support ==== 
 + 
 +  * config language supports include file 
 +<code c> 
 +include_file "name_of_file" 
 +</code> 
 +  * can be used in any part of config file, for example: 
 +    * you can include a file defining global parameters 
 +    * you can include a file defining module loading and its parameter 
 +    * you can include a file defining routing rules 
 +  * error reporting prints name of file and line number 
 +  * included file may include another file 
 + 
 +Example: 
 + 
 +- file kamailio-sanity.cfg: 
 + 
 +<code c> 
 +if (!mf_process_maxfwd_header("10")) { 
 +  sl_send_reply("483","Too Many Hops"); 
 +  exit; 
 +
 +if ( msg:len >= 8192 ) { 
 +  sl_send_reply("513", "Message too big"); 
 +  exit; 
 +
 +if ( is_method("NOTIFY") && uri==myself 
 +  && $hdr(Event) =~ "keep-alive" ) 
 +
 +  sl_send_reply("200", "OK - keepalive"); 
 +  exit; 
 +
 +</code> 
 + 
 +Now, at the top of main route block in each config, I include the 'kamailio-sanity.cfg' file: 
 + 
 +- file kamailio.cfg: 
 + 
 +<code c> 
 +... 
 +route { 
 + include_file "kamailio-sanity.cfg" 
 + ... 
 +
 +... 
 +</code> 
 + 
 +==== CFG Define support ==== 
 + 
 +Control in C-style what parts of the config file are executed. The parts in non-defined zones are not loaded, ensuring lower memory usage and faster execution. 
 + 
 +Available directives: 
 +  * #!define NAME - define a keyword 
 +  * #!ifdef NAME - check if a keyword is defined 
 +  * #!ifndef - check if a keyword is not defined 
 +  * #!else - swtich to false branch of ifdef/ifndef region 
 +  * #!endif - end ifdef/ifndef region 
 + 
 +Among benefits: 
 +  * easy way to enable/disable features (e.g., see default cfg for 3.0.0 -- controlling support of nat traversal, presence, etc...) 
 +  * switch control for parts where conditional statements were not possible (e.g., global parameters, module settings) 
 +  * faster by not using conditional statements inside routing blocks when switching between running environments 
 + 
 +Example: how to make config to be used in two environments, say testbed and production, controlled just by one define to switch between the two modes: 
 + 
 +<code c> 
 +... 
 + 
 +#!define TESTBED_MODE 
 + 
 +#!ifdef TESTBED_MODE 
 +  debug=5 
 +  log_stderror=yes 
 +  listen=192.168.1.1 
 +#!else 
 +  debug=2 
 +  log_stderror=no 
 +  listen=10.0.0.1 
 +#!endif 
 + 
 +... 
 + 
 +#!ifdef TESTBED_MODE 
 +modparam("acc|auth_db|usrloc", "db_url", 
 + "mysql://openser:openserrw@localhost/openser_testbed") 
 +#!else 
 +modparam("acc|auth_db|usrloc", "db_url", 
 + "mysql://openser:openserrw@10.0.0.2/openser_production") 
 +#!endif 
 + 
 +... 
 + 
 +#!ifdef TESTBED_MODE 
 +route[DEBUG] { 
 +  xlog("SCRIPT: SIP $rm from: $fu to: $ru - srcip: $si"\n); 
 +
 +#!endif 
 + 
 +... 
 + 
 +route { 
 +#!ifdef TESTBED_MODE 
 +  route(DEBUG); 
 +#!endif 
 + 
 +  ... 
 +
 + 
 +... 
 +</code> 
 + 
 +==== onsend_route ==== 
 + 
 +  * executed just before sending the SIP message to the network 
 +  * shows the final content (headers and body updated) 
 +  * more flexibility in handling DNS blacklists and filters 
 +  * you can drop requestss just to be sent using own logic in onsend_route 
 +  * details of destination are available and can be used in route via 
 +    * cfg keywords 
 +      * snd_ip 
 +      * snd_port 
 +      * snd_proto 
 +      * snd_af 
 +    * pseudo-variables 
 +      * $snd(ip) 
 +      * $snd(port) 
 +      * $snd(proto) 
 +      * $snd(af) 
 +  * you can access the content of the buffer to be sent to network via: 
 +    * $snd(buf) 
 +    * $snd(len) 
 + 
 + 
 +<code c> 
 +onsend_route { 
 +  if(isflagset(2) && $snd(ip)=="10.10.10.10") { 
 +    drop; 
 +  } 
 +
 +</code> 
 + 
 +==== event_route ==== 
 + 
 +  * framework exported by core to execute a set of actions when a specific event happens 
 +  * no longer needed to extend cfg file grammar for each new type of event that needs to execute a route block in cfg 
 +  * an event route can be triggered by core or any of the modules 
 +  * implemented event routes 
 +    * **event_route[htable:mod-init]** - executed by htable module after module has been initialised 
 +    * **event_route[tm:local-request]** - executed by tm modules when a local SIP request is generated (former local_route in 1.5.x) 
 + 
 +<code c> 
 +event_route[htable:mod-init] { 
 +  $shv(start_time) = $Tf; 
 +  sql_query("insert into restarts (start_time) values ('$Tf')"); 
 +
 +</code> 
 + 
 +==== Names for route blocks and flags ==== 
 + 
 +  * route blocks can have string name 
 +    * you can still use integer IDs (backward compatible) in cfg file 
 +    * no more limitation of number of routing blocks 
 +    * easier to write and maintain routing logic by having meaningful names 
 +  * SIP message (transaction) flags can have string name 
 +    * easy to spot and understand the meaning of the flag 
 +    * note: name for flags cannot be used for branch or script flags 
 + 
 +<code c> 
 +... 
 +flags 
 +  FLAG_ONE   : 1, 
 +  FLAG_TWO   : 2; 
 + 
 +... 
 + 
 +route { 
 +  ... 
 +  if($rU=~"^\+[1-9][0-9]+$") 
 +  { 
 +     # route to gateway 
 +     $du = "sip:10.0.0.11"; 
 +     route(RELAY); 
 +  } 
 +  ... 
 +  if(isflagset(FLAG_ONE)) 
 +  { 
 +     ... 
 +  } 
 +  ... 
 +
 + 
 +route[RELAY] { 
 +   t_relay(); 
 +   exit; 
 +
 +</code> 
 + 
 +==== switch statement ==== 
 + 
 +  * support for regular expression matching for string 
 +  * optimisation for integer matching 
 +  * **break** can be used inside actions of a **case** block (previously was allowed only at the end of block) 
 + 
 +<code c> 
 +switch($rU) { 
 +  case /"^123": 
 +    if($fU=="345") { 
 +      break; 
 +    } else { 
 +      ... 
 +    } 
 +  break; 
 +  case /"^456": 
 +    ... 
 +  break; 
 +
 +</code> 
 + 
 +==== while statement ==== 
 + 
 +  * you can use **break** to jump out of **while** loop (not possible in previous versions) 
 + 
 +<code c> 
 +$var(i) = 0; 
 +while($var(i)<10) { 
 +  if($var(i)==5 && $rU=="123") 
 +     break; 
 +  $var(i) = $var(i) + 1; 
 +
 +</code> 
 +</code> 
 + 
 +==== Config file interpreter ==== 
 + 
 +=== type casts operators === 
 + 
 +  * (int) - cast to integer 
 +  * (str) - cast to string 
 + 
 +<code c> 
 +$var(expires) = (int)$hdr(expires); 
 +</code> 
 + 
 +=== new comparison operators === 
 + 
 +  * eq, ne for string comparisons 
 +  * ieq, ine for integer comparisons 
 + 
 +<code c> 
 +if($ua eq "Snom") { 
 +   ... 
 +
 +</code> 
 + 
 +  * they are almost equivalent to = = or !=, but they force the conversion of their operands (eq to string and ieq to int), allowing among other things better type checking on startup and more optimisations.  
 +  * non equiv. examples: 0 = = "" (true) is not equivalent to 0 eq "" (false: it evaluates to "0" eq ""). "a" ieq "b" (true: (int)"a" is 0 and (int)"b" is 0) is not equivalent to "a" = = "b" (false). 
 + 
 +  * note: internally = = and != are converted on startup to eq/ne/ieq/ine whenever possible (both operand types can be safely determined at start time and they are the same).
  
   * try to guess what the user wanted when operators that support multiple types are used on different typed operands. In general convert the right operand to the type of the left operand and then perform the operation. Exception: the left operand is undef. This applies to the following operators: +, == and !=.   * try to guess what the user wanted when operators that support multiple types are used on different typed operands. In general convert the right operand to the type of the left operand and then perform the operation. Exception: the left operand is undef. This applies to the following operators: +, == and !=.
            
-Special case: undef as left operand: 
-For +: undef + expr -> undef is converted to string => "" + expr. 
-For = = and !=:   undef = = expr -> undef is converted to type_of expr. 
-If expr is undef, then undef = = undef is true (internally is converted to string). 
- 
   * expression evaluation changes: auto-convert to interger or string in function of the operators:   * expression evaluation changes: auto-convert to interger or string in function of the operators:
-<code>+<code c>
        int(undef)==0,  int("")==0, int("123")==123, int("abc")==0        int(undef)==0,  int("")==0, int("123")==123, int("abc")==0
        str(undef)=="", str(123)=="123".        str(undef)=="", str(123)=="123".
 </code> </code>
  
-  * new script operators: defined, strlen, strempty+== new script operators ==
     * defined expr - returns true if expr is defined, and false if not. Note: only a standalone avp or pvar can be undefined, everything else is defined.     * defined expr - returns true if expr is defined, and false if not. Note: only a standalone avp or pvar can be undefined, everything else is defined.
-    * strlen(expr) - returns the lenght of expr evaluated as string. +    * strlen(expr) - returns the length of expr evaluated as string. 
-    * strempty(expr) - returns true if expr evaluates to the empty string (equivalent to expr==""). e.g.: if (defined $v && !strempty($v)) $len=strlen($v);+    * strempty(expr) - returns true if expr evaluates to the empty string (equivalent to expr=="")
  
-  * msg:len max_len comparison obsoleted and removed (it did not make any sense, msg:len max_len was always false, use something like 4096 or 16384 in its place).+<code c> 
 +if (defined $v && !strempty($v)) 
 +   $len=strlen($v); 
 +</code>
  
-  * module search path support: loadpath takes now a list of directories separated by ':'. The list is searched in-order. For each directory d     $d/${module_name}.so and $d/${module_name}/${module_name}.so are tried.+==== Module search path ====
  
-  * dns TXT, EBL and PTR support (both cache and non-cached resolver)+  * **loadpath** (alias to **mpath**can take now a list of directories separated by ':' 
 +  * modules can be located in many directories 
 +  * you can omit the extension ".so" in module name for **loadmodule** 
 +  * the list is searched in-order 
 +    * more at: http://www.kamailio.org/dokuwiki/doku.php/core-cookbook:3.0.x#loadpath
  
-  * support for dual module interfaces: ser and kamailio+<code c> 
 +    loadpath "/usr/local/lib/kamailio/modules:/usr/local/lib/kamailio/modules_k" 
 +  
 +    loadmodule "db_mysql.so" 
 +    loadmodule "uri" 
 +</code> 
 + 
 +==== Dual module interfaces ==== 
 + 
 +  * modules can implement any of the interfaces specific so far to: 
 +    * kamailio 
 +    * ser 
 +  * core can deal at the same time with modules implementing different interfaces 
 +  * straightforward migration and run on the same Kamailio instance of modules developed so far for: 
 +    * Kamailio (OpenSER) 
 +    * SIP Express Router (SER) 
 +    * OpenIMSCore 
 + 
 +==== Script compatibility mode ==== 
 + 
 +  * option to offer best compatibility with expected behaviour had by older versions 
 +  * as now we integrate functionalities from Kamailio and SER all together, this directive offer the possibility to choose between. For example: 
 +    * in Kamailio, processing of failure route uses selected reply code from branches of the last step of serial forking 
 +    * in SER,  processing of failure route uses selected reply code from all branches, offering the option to drop replies for branches of the last step of serial forking via a module function 
 +  * you can choose between ser compatible, kamailio compatible and max compatibility (compatible with both as much as possible), using:
  
-  * script mode can be switched between ser compatible, kamailio compatible and max compatibility (compatible with both as much as possible), using +<code c>
-<code>+
       #!SER       #!SER
       #!KAMAILIO       #!KAMAILIO
Line 80: Line 536:
 where #!KAMAILIO is equivalent with #!OPENSER and #!ALL with #!MAXCOMPAT where #!KAMAILIO is equivalent with #!OPENSER and #!ALL with #!MAXCOMPAT
  
-=== event_route ===+**IMPORTANT** - set #!KAMAILIO as first line in your config file if you update from 1.5.x or older version of Kamailio (OpenSER), otherwise you may experience new behaviour for some old functions.
  
-  * route executed by core or modules when a specific event happens +<code c> 
-    * **event_route[htable:mod-init]** - executed by htable module after module has been initialized+#!KAMAILIO 
 +... 
 +</code>
  
-=== extended avps ===+==== extended avps ====
  
-  * XAVP new class of variables http://sip-router.org/wiki/devel/xavp+  * XAVP 
 +    * new class of variables 
 +      * http://sip-router.org/wiki/devel/xavp 
 +    * structure-like access to variables bind to SIP transactions 
 +    * ability to store more value types, not only integer and string 
 +    * simplify addressing by using only string name for attributes 
 +    * possibility to optimise the search by creating lists of xavp lists 
 +    * availability in config file for xavp with string or integer value (expression interpreter supports only these values) via PV module 
 +    * availability in stateful processing, during the lifetime of transaction
  
-=== new config variables ===+  * Kamailio must be compiled with define WITH_XAVP set
  
-  * [b]max_while_loops[/b] - maximum iterations allowed for a while  (can be changed at runtime). Default 100.+<code c> 
 +$xavp(sf=>uri)="sip:10.10.10.10"; 
 +$xavp(sf[0]=>fr_timer)=10; 
 +$xavp(sf[0]=>fr_inv_timer)=15; 
 +$xavp(sf[0]=>headers)="X-CustomerID: 1234\r\n"; 
 +  
 +$xavp(sf=>uri)="sip:10.10.10.11"; 
 +$xavp(sf[0]=>fr_timer)=20; 
 +$xavp(sf[0]=>fr_inv_timer)=35; 
 +  
 +$xavp(sf=>uri)="sip:10.10.10.12"; 
 +$xavp(sf[0]=>fr_timer)=10; 
 +$xavp(sf[0]=>fr_inv_timer)=15; 
 +$xavp(sf[0]=>headers)="X-CustomerID: pw45\r\n";
  
-==== New modules ====+xlog("uri attribute in first sf xavp: $xavp(sf=>uri)\n"); 
 +</code>
  
-  [b]auth identity[/b] +==== New cfg file elements ==== 
-  * [b]call_control[/b+ 
-    * connector to call control application +  lot of new parameters, functions and keywords 
-  * [b]drouting[/b] +  * allow fine tuning of transport layers, real-time timers, dns, a.s.o. 
-    * prefix/time based routing module +  * visit: 
-  * [b]cfg_db[/b] +    * http://www.kamailio.org/dokuwiki/doku.php/core-cookbook:3.0.x 
-  * [b]cfg_rpc[/b] +    * http://www.kamailio.org/dokuwiki/doku.php/pseudovariables:3.0.x 
-  * [b]ctl[/b] +    * http://www.kamailio.org/dokuwiki/doku.php/transformations:3.0.x 
-  * [b]memcached[/b] + 
-    * hash table access for the popular memcached server +==== Custom cfg file parameters ==== 
-    also support atomic operations (incrementdecrement) on integers + 
-  * [b]kex[/b] +  * along with predefined global parameters, you can define your own in global parameters section and use later in routing blocks 
-    * some of the features and updates of Kamailio core + 
-  * [b]pdb[/b] +<code c> 
-    * number portability specific featured module+Format: group.id = value 'desc' description 
 +</code> 
 + 
 +  * you can get access to them via 
 +    * pseudo-variables: $sel(cfg_get.group.id) 
 +    * selects: @cfg_get.group.id 
 + 
 +<code c> 
 +... 
 +pstn.gw_ip = "10.0.0.101" desc "My PSTN GW Address" 
 +... 
 +route[PSTN
 + # check if PSTN GW IP is defined 
 + if (strempty($sel(cfg_get.pstn.gw_ip))) { 
 + xlog("SCRIPT: PSTN routing enabled but pstn.gw_ip not defined\n"); 
 + return; 
 +
 + 
 + # route to PSTN dialed numbers starting with '+' or '00' 
 + if(!($rU=~"^(\+|00)[1-9][0-9]{3,20}$")) 
 + return; 
 + 
 + # only local users allowed to call 
 + if(from_uri!=myself) { 
 + sl_send_reply("403", "Not Allowed"); 
 + exit; 
 +
 + 
 + $ru = "sip:" + $rU + "@" + $sel(cfg_get.pstn.gw_ip); 
 + 
 + route(RELAY); 
 + exit; 
 +
 +</code> 
 + 
 +===== !!! New modules ===== 
 + 
 +==== auth identity ==== 
 +  * identity authentication module 
 +  * implementation of SIP Identity (RFC 4474) 
 +  * http://kamailio.org/docs/modules/3.0.x/modules/auth_identity.html 
 + 
 +==== call_control ==== 
 +  * connector to call control application 
 +  * http://kamailio.org/docs/modules/3.0.x/modules_k/call_control.html 
 + 
 +==== cfg_db ==== 
 +  * Load core and module parameters from database 
 +  * automate the configuration by having the values in database, even for global parameters 
 +  * http://kamailio.org/docs/modules/3.0.x/modules/cfg_db.html 
 + 
 +==== cfg_rpc ==== 
 +  * Update core and module parameters at runtime via RPC interface 
 +  * http://kamailio.org/docs/modules/3.0.x/modules/cfg_rpc.html 
 + 
 +==== ctl ==== 
 +  * Control connector for RPC interface 
 +    * support for fifo, unixsock, tcp, udp communication channels 
 +    * can handle many connections at the same even over different transport layers 
 +  * you have to load it to use **sercmd** command line interface 
 +  * http://kamailio.org/docs/modules/3.0.x/modules/ctl.html 
 + 
 +==== drouting ==== 
 +  * prefix/time based routing module 
 +  * http://kamailio.org/docs/modules/3.0.x/modules_k/drouting.html 
 + 
 +==== iptrtpproxy ==== 
 +  * nat traversal using kernel space for media relaying 
 +  * direct communication with a kernel module to control the media streams 
 +  * http://kamailio.org/docs/modules/3.0.x/modules/iptrtpproxy.html 
 + 
 +==== kex ==== 
 +  * some of the features implemented previously in Kamailio core 
 +    * functions to manage script and branch flags, add branch or manage destination uri 
 +    * several MI commands 
 +  * do not forget to load it if you upgrade from 1.5.x or older versions 
 +  * http://kamailio.org/docs/modules/3.0.x/modules_k/kex.html 
 + 
 +==== memcached ==== 
 +  * hash table access for the popular memcached server 
 +  * get/set integer or string values from/to memcached server 
 +  * atomic increment or decrement integer values from memcached server 
 +  * key can be static string or dynamic value build from other config variables 
 +  * set expire time for memcached values 
 +  * operations are done via pseudo-variables, therefore memcached values can be used by other modules, can be printed via xlog, a.s.o. 
 + 
 +  * http://kamailio.org/docs/modules/3.0.x/modules_k/memcached.html 
 + 
 +==== mi_rpc ==== 
 +  * RPC support for Management Interface 
 +    * execute all available MI commands via the new RPC control interface 
 +  * http://kamailio.org/docs/modules/3.0.x/modules/mi_rpc.html 
 + 
 +==== pdb ==== 
 +  * number portabilitymodule
     * query portability database daemon     * query portability database daemon
-  [b]tmx[/b] +    parallel interrogation of several PDB servers 
-    * TM module extensions +    * millisecond timeouts 
-    * $T_inv(pv- access to pseudo-variables and attributes of INVITE while processing the CANCEL +    * management at runtime via control interface (fifo, xmlrpc, udp, tcp ...
-  * [b]topoh[/b] +  * source of portability daemon available in **utils/pdbt/** 
-    topology hiding module +  * http://kamailio.org/docs/modules/3.0.x/modules/pdb.html
-    transparent for config file writer +
-    * independent of statless/stateful mode +
-    * temporary branch: tmp/core_events +
-  [b]iptrtpproxy[/b] +
-    nat traversal using kernel space for media relaying +
-  * [b]mi_rpc[/b] +
-  * [b]xmlrpc[/b]+
  
-==== New in old modules ====+==== tmx ==== 
 +  * TM module extensions 
 +  * new pseudo-variable 
 +    * $T_inv(pv) 
 +    * access to pseudo-variables and attributes of INVITE while processing the CANCEL 
 +  * implements several Kamailio 1.5.x specific extensions to TM 
 +    * MI commands 
 +    * statistics 
 +  * do not forget to load it if you upgrade from 1.5.x or older versions of Kamailio 
 +  * http://kamailio.org/docs/modules/3.0.x/modules_k/tmx.html
  
-  [b]seas[/b] not ported yet to sip router core framework +==== topoh ==== 
-  * [b]carrierroute[/b] +  topology hiding module 
-    * new function cr_nofallback_route route like existing cr_prime_route function, but uses CRC32 hash +    * mask callid, via, route, record-route and contact headers 
-    * new hash function random for random routing distribution +    * protect your infrastructure topology 
-  * [b]htable[/b] +    * hide the addresses of one party in the call from the other 
-    * ability to count items matching name by a regular expression $shtcn(ht=>regexp) +  * transparent for config file writer 
-    * ability to count items matching value by a regular expression $shtcv(ht=>regexp) +    * config always access the message in clear, so nothing special has to be done when using the module 
-    * execute event_route[htable:mod-init] if it is defined, after module has been initialized +    * no need to execute special functions in the config, topoh does his job in pre and post config hooks 
-  * [b]imc[/b]+  * independent of statless/stateful mode 
 +    * very lightweight as it does not do any state machine and storage 
 +  * packets can be routed via different servers configured in the same way 
 +    * therefore native handling of failover cases (standby can encode/decode what active did previously) 
 +  * restarting the server does not affect ongoing calls (e.g., BYE are encoded/decoded properly) 
 +  * http://kamailio.org/docs/modules/3.0.x/modules/topoh.html 
 + 
 +==== xmlrpc ==== 
 +  * XMLRPC connector for RPC interface 
 +  * offers high-scalability XMLRPC communication with SIP server 
 +    * reuses the transport layer from the core 
 +    * communication can be done therefore via TCP or TLS 
 +    * all TCP/TLS SIP processing workers can handle XMLRPC, therefore the server can process lot of XMLRPC traffic at same time 
 +  * access to XMLRPC packets in a dedicated route of the config file 
 +    * you can authenticate by IP 
 +    * send XMLRPC reply 
 +    * check the content of the message 
 +  * http://kamailio.org/docs/modules/3.0.x/modules/xmlrpc.html 
 + 
 +<code c> 
 +#... 
 +modparam("xmlrpc", "route", "XMLRPC"); 
 +#... 
 +route[XMLRPC]
 + # allow XMLRPC requests only on TLS and only if the client 
 + # certificate is valid 
 + if (proto!=TLS){ 
 + xmlrpc_reply("400", "xmlrpc allowed only over TLS"); 
 + return; 
 +
 + if (@tls.peer.verified!=""){ 
 + xmlrpc_reply("400", "Unauthorized"); 
 + return; 
 +
 + if (search("^User-Agent:.*xmlrpclib")) 
 + set_reply_close(); 
 + set_reply_no_connect(); # optional 
 + dispatch_rpc(); 
 +
 +</code> 
 + 
 +===== !!! New in old modules ===== 
 + 
 +==== carrierroute ==== 
 +    * new function cr_nofallback_route 
 +      * route like existing cr_prime_route function, but uses CRC32 hash 
 +    * new hash function random 
 +      * for random routing distribution 
 + 
 +==== htable ==== 
 + 
 +  * ability to count items matching name by a regular expression 
 +    * via PV $shtcn(ht= >regexp) 
 +  * ability to count items matching value by a regular expression 
 +    * via PV $shtcv(ht= >regexp) 
 +  * execute event_route[htable:mod-init] if it is defined, after module has been initialised 
 +  * dump content of a hash table via MI control interface 
 +  * dump content of a hash table via RPC control interface 
 + 
 +<code c> 
 +  /* print number of items in htable 'a' */ 
 +  xlog("htable a has $shtcn(a= >.*) items\n"); 
 +</code> 
 + 
 +==== imc ====
     * support to specify extra headers to be added to local generated messages     * support to specify extra headers to be added to local generated messages
-  * [b]lcr[/b] + 
-    * added support for independent LCR instances, which improve virtualization of sip-router.  for example, different domains can now manage their own least cost routes to their own gateways. +<code c> 
-    * replaced gateway aliveness checking with new defunct_gw() function, which script writer can use to defunct an unresponsive or busy gateway for a desired period of time. +... 
-    * for simplicity, removed gateway group related functions load_gws_from_grp() and from_gw_grp() and group parameter from to_gw() function.  use LCR instances as replacement. +modparam("imc", "extra_hdrs", "P-Hint: imc\r\n") 
-  * [b]msilo[/b]+... 
 +</code> 
 + 
 +==== lcr ==== 
 +    * added support for independent LCR instances 
 +      * improve virtualization of sip-router 
 +      * for example, different domains can now manage their own least cost routes to their own gateways. 
 +    * replaced gateway aliveness checking with new defunct_gw() function 
 +      * script writer can use to defunct an unresponsive or busy gateway for a desired period of time. 
 +    * for simplicity, removed
 +      * gateway group related functions load_gws_from_grp() and from_gw_grp() 
 +      * group parameter from to_gw() function 
 +      * you can use LCR instances as replacement. 
 + 
 +==== msilo ====
     * check expiration time of REGISTER for m_dump() using contact parameters     * check expiration time of REGISTER for m_dump() using contact parameters
-  [b]presence_xml[/b]+ 
 +==== nathelper ==== 
 +    new functions: 
 +      * add_contact_alias() 
 +      * handle_ruri_alias() 
 +      * they provide an alternative to fix_nated_contact() function that also supports re-use of TCP connections. 
 +    * new pseudo variable $rr_count 
 +      * tells the number of Record Routes in received SIP request or reply. 
 +    * new pseudo variable $rr_top_count 
 +      * tells if topmost Record Route in received SIP request or reply is a single or double Record Route. 
 + 
 +==== presence_xml ====
     * new PV class: $xml(...)     * new PV class: $xml(...)
-    * handling of xml documents using XPath (evaluate expressions, update content) +      * handling of xml documents using XPath (evaluate expressions, update content) 
-  [b]pv[/b] +    get input from static string or variables (e.g., body of SIP message) 
-    * $sel(name) new PV class providing access to SER's select variables +    * can handle many XML documents at the same time 
-    * http://sip-router.org/wiki/cookbooks/selects/devel +    * easier routing decisions based on XML content 
-  [b]registrar[/b] + 
-    * save(...) returns different code in case of insert, update or delete +<code c> 
-  [b]textops[/b] +$xml(x=>doc) = '<?xml version="1.0" encoding="UTF-8"?><proxy><name>Kamailio</name></proxy>'; 
-    * msg_apply_changes() - new function to apply changes done to SIP message (e.g., via subst(), append_hf(), remove_hf(), etc...)+xlog("content of node b: $xml(x=>xpath:/proxy/name/text())\n"); 
 +$xml(x=>xpath:/proxy/name) = "Kamailio 3.0.0"; 
 +</code> 
 + 
 +==== pv ==== 
 +    * $sel(name) 
 +      * new PV class providing access to SER's select variables 
 +      * http://www.kamailio.org/dokuwiki/doku.php/selects:3.0.x 
 +    $snd(name) 
 +      * new PV class to get access to destination address and sent request attributes 
 +        * ip - IP address 
 +        * port - port 
 +        * proto - transport protocol 
 +        * af - address family 
 +        * buf - sent request content 
 +        * len - length of sent request content 
 + 
 +==== registrar ==== 
 +  * save(...) returns different code in case of insert, update or delete 
 +    learn in cfg file what kind of operation save performed 
 +    * for example, dump stored offline messages only when was a new contact inserted, avoiding useless processing when is an update or un-registration 
 + 
 +==== seas ==== 
 +    * not ported yet to sip router core framework 
 + 
 +==== textops ==== 
 +    * new function msg_apply_changes() 
 +      * apply changes done to SIP message so far(e.g., via subst(), append_hf(), remove_hf(), etc...)
       * the original content of SIP message is lost and the new content is processed further (e.g., if a header was removed, after using this function the check for existence of that header will return false; if a new header is added, after using the function, the check for existence of that header will return true)       * the original content of SIP message is lost and the new content is processed further (e.g., if a header was removed, after using this function the check for existence of that header will return false; if a new header is added, after using the function, the check for existence of that header will return true)
-  [b]utils[/b]+ 
 +==== tm ==== 
 +    module was overhauled 
 +      * faster and more lightweight timer implementations for retransmissions 
 +      * removed lot of locking by a better design 
 +      * more internal hooks to develop applications on top of module 
 +    * asynchronous message processing support 
 +      * you can park the transaction and resume the processing later 
 +      * meanwhile the SIP worker process can handle new SIP traffic 
 +    * option to decide what replies to drop in serial forking steps 
 +    * load of new functions to access transactions 
 +    * new parameters to tune transaction management 
 +    * check: http://kamailio.org/docs/modules/3.0.x/modules/tm.html 
 + 
 +==== usrloc ==== 
 +    * dump content of user location tables via RPC control interface 
 +      * ul.dump - get full content of location tables 
 +      * ul.dump brief - get the list of online users  
 + 
 +==== utils ====
     * ability to interpret xcap documents     * ability to interpret xcap documents
     * function: xcap_auth_status(watcher_uri, presentity_uri)     * function: xcap_auth_status(watcher_uri, presentity_uri)
-  * [b]userblacklist[/b] 
-    * new function check_user_whitelist - check if the user is whitelisted in the userblacklist table 
  
-==== New tools ====+==== userblacklist ==== 
 +    * new function check_user_whitelist 
 +      * check if the user is whitelisted in the userblacklist table
  
-  * [b]sercmd[/b] +===== !!! New tools =====
-    * command line application (similar to Asterisk cli)+
  
-===== External Links =====+==== sercmd ==== 
 +  * command line application (similar to Asterisk cli) 
 +  * connection or one-command mode 
 +  * tab completion 
 +  * execute RPC commands 
 +  * execute MI commands 
 +  * connect to Kamailio via FIFO, unix file sockets, UDP or TCP - you have to load the new **ctl** module
  
 +==== siremis ====
 +  * web2.0 admin interface (mysql, php, apache)
 +  * added support for XMLRPC communication with Kamailio server
 +  * http://siremis.asipto.com
 +
 +===== External Links =====
  
-http://sip-router.org/wiki/migration/new-features-for-k-users+Project resources: 
 +  * http://www.kamailio.org/mos/view/Kamailio-OpenSER-v3.0.0-Release-Notes 
 +  * http://www.kamailio.org/dokuwiki/doku.php/install:kamailio-3.0.x-from-git 
 +  * http://www.kamailio.org/dokuwiki/doku.php/install:1.5.x-to-3.0.0 
 +  * http://www.kamailio.org/ 
 +  * http://sip-router.org/
  
-http://sip-router.org/wiki/features/inherited-features+A series of blog posts highlighting the best of new in Kamailio (OpenSER) 3.0.0: 
 +  * http://by-miconda.blogspot.com/2010/01/best-of-new-in-kamailio-300-toc.html 
  
-http://sip-router.org/wiki/features/new-in-devel 
  

Personal Tools