Table of Contents
SIP Router - New features in development version
The page collects the summary of the new features in SIP Router development version.
This source tree branch will result in release 3.1.0 - scheduled for September 2010.
Current stable branches are 3.0
- sr_3.0
- kamailio_3.0 - Kamailio (OpenSER) 3.0.0 was released Jan 11, 2010. Last minor release in this series is 3.0.2, May 27, 2010
New SIP Router modules
acc_radius
- send accounting records to a Radius server (same functionality provided by acc re-compiled with radius support)
app_lua
- execute embedded lua scripts
- you get access to SIP message processed at that time
- several internal SIP router functions are exported to Lua as well
app_python
- execute embedded python scripts
- you get access to SIP message processed at that time
counters
- exports counters manipulating script functions and RPCs (new statistics API)
debugger
- config file debugger
- print the trace of executed actions in config for SIP messages
- step-by-step execution of each action in config (similar to gdb)
- can be done from remote system via RPC interface (e.g., XMLRPC)
- evaluate pseudo-variables at runtime
- print line and action type for each step
geoip
- perform lookups based on IP against a local geoip database
- resulted attributes are available in pseudo-variables
- support to perform many lookups and store the results at the same time
matrix
- can do arbitrary lookup operations over an array
mqueue
- message queue for inter-process communication
- first message added is first consumed
- messages are pairs of strings (key, value)
mtree
- load db tables in shared memory indexed on tree based on prefix key
- fast lookup for keys like DIDs
- can manage many trees at the same time
pipelimit
- limit traffic based on different algorithms
- spawned by reusing parts of ratelimit module
- available in branch tmp/pipelimit
rtpproxy
- new module to deal with rtpproxy servers
- rtpproxy functionality was removed from nathelper and moved to this new module
xcap_server
- xcap server implementation
- fully integrated with internal Presence server
- XCAP docs can be send via SIP (UDP, TCP, TLS, SCTP), HTTP and HTTPS
xhttp
- basic HTTP server re-using core transport layers for TCP and TLS
xmlops
- xml operations in configuration file with XPATH
New in Old SIP Router modules
blst
- functions for ignoring blacklist events per message:
- blst_set_ignore(mask): set the events in mask in the per per message blacklist ignore mask for a request (see dst_blacklist_udp_imask for possible values). The basic operation is: msg_blst_ignore_mask|=mask.
- blst_clear_ignore(mask): like blst_set_ignore(mask), but instead of setting some events, it clears them (msg_blst_ignore_mask&=~mask).
- blst_rpl_set_ignore(mask): like blst_set_ignore(mask), but sets the mask for possible local replies to the current message.
- blst_rpl_clear_ignore(mask): like blst_rpl_ignore(mask), but clears instead of setting.
dispatcher
- weight based load balancing
msilo
- new parameter: add_contact
- control addition of contact header in local generated messages (default off, as per rfc3428)
nathelper
- rtpproxy functionality was moved from nathelper to rtpproxy
pv
- new pv class to get access to timeval attributes (seconds and microseconds)
- $PV(u) - microseconds (cached)
- $PV(s) - seconds (cached)
- $PV(un) - microseconds (not cached)
- $PV(sn) - seconds (not cached)
- $PV(Sn) - string with sec.usec
- new pv class to get access to next hop address attributes
- $nh(u) - uri
- $nh(U) - username
- $nh(d) - domain
- $nh(p) - port
- $nh(P) - protocol
- new transformations
- s.strip - strip characters from beginning of a string pseudo-variable
- s.striptail - strip characters from ending of a string pseudo-variable
- $branch(name) PV is writable, you can update uri, dst uri, etc. for each branch
- $(branch(dst_uri)[2]) = "sip:10.10.10.10";
- assigning $null to uri attribute will drop the branch: $(branch(uri)[0]) = $null;
- adding a new branch can be done via old ways with km_append_branch(uri) or append_branch()
registrar
- new parameter for randomization of Expire header
tls
- new parameters for advanced openssl options
- asynchronous TLS processing support has been added
tm
- t_reply() can be used in tm onreply_route to change reply status code and reason
- support for Reason header (according to RFC3326) in e2e and local generated CANCELs
- Function next_contacts() is not anymore setting any timers. Check if contact_avp has any values left and call t_set_fr() accordingly before calling t_relay().
- Removed unused fr_timer_next module parameter.
tmx
- new functions for remote control of INVITE transaction
- transaction can be canceled by call id. One useful scenario: cancel the transaction in order to redirect it to a new destination by failure_route
- transaction can be replied by call id
uac
- can perform registrations to remote SIP servers
- user profiles are loaded from database at startup
- the registrations are automatically refreshed before expiration
- cfg function to lookup local user based on contact address
xlog
- new function xlog([level], text) - print cfg line before log message
- new function xdbg(text) - print cfg line before log message
Integration of ser's config framework
- various parameters from kamailio's modules are integrated with ser config framework and can be modified at runtime with sercmd
- the list of modules includes : carrierroute, registrar, siputils, ratelimit (and growing)
- a complete list of changeable parameters are in modules documentation pages
New in Core
- global, per protocol blacklist ignore masks (via extended send_flags). See dst_blacklist_udp_imask a.s.o (dst_blacklist_*_imask).
- per message blacklist ignore masks
Asynchronous TLS
- hooks for asynchronous TLS
- integration of TCP and TLS layers for asynchronous communication
- tcp_async=yes enables async communication on both
Statistics API
- new more write-performant statistics framework
- accessible in config via counters module
- old statistics were migrated transparently to the new framework
Module functions prototypes
- a new module exports version allow the modules functions to take expressions as parameters
UDP Raw Sockets
- support to communicate via UDP raw sockets
- boost in UDP communication performances
Extended config pre-processor directives
- you can define values for IDs
#!define MYINT 123 #!define MYSTR "xyz"
- defined IDs are replaced at startup, during config parsing, e.g.,:
$var(x) = 100 + MYINT;
- is interpreted as:
$var(x) = 100 + 123;
- you can have multi-line defined IDs
#!define IDLOOP $var(i) = 0; \
while($var(i)<5) { \
xlog("++++ $var(i)\n"); \
$var(i) = $var(i) + 1; \
}
- then in routing block
route {
...
IDLOOP
...
}
- new preprocessor directive
#!subst "/regexp/subst/"
- perform substitutions inside the strings of config (note that define is replacing only IDs - alphanumeric tokens not enclosed in quotes)
- #!subst offers an easy way to search and replace inside strings before cfg parsing. E.g.,:
#!subst "/DBPASSWD/xyz/"
modparam("acc", "db_url", "mysql://user:DBPASSWD@localhost/db")
- will do the substitution of db password in db_url parameter value
- number of allowed defines is now set to 256
- notes:
- multilines defines are reduced to single line, so line counter should be fine
- column counter goes inside the define value, but you have to omit the '\' and CR for the accurate inside-define position
New Core Parameters
- dst_blacklist_udp_imask - global blacklist events ignore mask for udp (a blacklist event/reason set in this variable will be ignored when deciding whether or not to blacklist an udp destination). Can be set at runtime. Default: 0 (no blacklist reason is ignored).
Possible values: 0 -disabled, 2 - send error; 4 - connect error, 8 - icmp (reserverd), 16 - transaction timeout, 32 - 503 received, 64 - administratively prohibited (manually set).
- dst_blacklist_tcp_imask - like dst_blacklist_udp_imask, but for tcp.
- dst_blacklist_tls_imask - like dst_blacklist_tls_imask, but for tcp.
- dst_blacklist_sctp_imask -like dst_blacklist_sctp_imask, but for tcp.
- tcp_accept_no_cl - accept messages on TCP without Content-Lenght header (assume is 0 - no body)