User Tools

Site Tools


features:new-in-3.2.x

This is an old revision of the document!


Kamailio SIP Server - New features in version 3.2.0

The page collects the summary (draft notes) of the new features in Kamailio (OpenSER) version 3.2.x.

The release date for version 3.2.0: October 18, 2011.

NOTE: this page is not yet up-to-date with all new features in v3.2.0. Check back soon, it is updated right now, it should take just a bit. This message will be removed when the update is finished.

Configuration File

The default configuration file shipped with Kamailio v3.2.0 has several enhancements comparing to v3.1.0. You can read more about all features provided by default configuration file in the comments located at the top of it. Shortly about the enhancements in 3.2.0:

  • refactored NAT traversal logic
    • use of rtpproxy_manage() to handle properly cases when 200ok and ACK have the SDP
    • enable RTP relaying in branch_route to optimize handling of parallel forking to natted and non-natted branches for the same call
  • speed dial support - enabled when adding #!define WITH_SPEEDDIAL after the first line
  • routing to voicemail in case of not available - enabled when adding #!define WITH_VOICEMAIL after the first line and setting the voicemail server address in voicemail.srv_ip variable
  • blocking of redirect replies (3xx replies) - enabled when adding #!define WITH_BLOCK3XX after the first line
  • acc module shows how to store source IP for each accounted record
  • TCP connection lifetime is set over one hour to cope better with devices behind NAT connected over TCP or TLS
  • main request routing block name switched to request_route in order to be easy to refer to it. Note that route is still valid name for main request routing block.
  • load debugger module for WITH_DEBUG - set cfgtrace parameter to 1 in this case

New Modules

async

db_sqlite

dmq

ipops

json

jsonrpc-c

ndb_redis

presence_reginfo

pua_reginfo

p_usrloc

  • partitioned user location service
  • similar to usrloc module, but provides partitioned user location. This provides 3 benefits:
    • Redundancy - if a location db is down, there is a spare running
    • Load Balancing - the module balances the entries by hashing the username(or username@domain)
    • Failover- in case of error and recovery, it ensures that no stale contacts are returned

sdpops

  • module to control the content of the SDP payload from configuration file
    • spd_remove_codecs_by_id(list) - remove the codecs by their numeric IDs given in a comma separated list as parameter
    • spd_remove_codecs_by_name(list) - remove the codecs by their names given in a comma separated list as parameter
    • spd_keep_codecs_by_id(list) - keep the codecs by their numeric IDs given in a comma separated list as parameter
    • spd_keep_codecs_by_name(list) - keep the codecs by their names given in a comma separated list as parameter
    • sdp_print(level) - print the parsed sdp structure to the debug 'level' (integer representation of log levels). Good for debug purposes
    • sdp_with_media(type) - return true if the sdp has 'media=type' (e.g., media=video)

sipcapture

IMS Extensions

IMS: CDP / CDP-AVP

  • The CDP (C-Diameter-Peer) modules provide an Diameter-interface, which are used by several components of the OpenIMS-core: They are used as Cx-Interface for the I-/S-CSCF and for the Rx-Interface for the P-CSCF. The modules may be used in other ways, too (e.g. for an Sh-Interface for an Kamailio-based aplication server)

IMS: P-CSCF

  • The Proxy-CSCF in the IMS Architecture acts as an entry point to the network. The pcscf module of the original OpenIMS-core aggregates many functions required at this component: Header manipulation/verification, RTP-Relay and presence-support for the “reginfo”-event. Optional, the Rx-Interface for Billing may be enabled.

IMS: I-CSCF

  • The Interrogating-CSCF is a kind of “Loadbalancer” or a entry Proxy for the “home-network” of an IMS setup. The I-CSCF will retrieve the location for a user from the HSS, it will check, where a user is registered or where it should register (based on user-settings, required capabilities later maybe even load). The icscf-module implements the according interfaces towards the HSS (Cx) and according header manipulation/verification methods.

IMS: S-CSCF

  • The Serving-CSCF is acting as a registrar and as decision engine regarding the routing of the Request. It retrieves the user-data and routing rules from the HSS and applies them to the processed requests. The scscf-module implements the according interfaces towards the HSS (Cx), the interfaces towards application-servers (Isc) and according header manipulation/verification methods.

IMS: MGCF

  • The MGCF-Module of the OpenIMS core implements header and content manipulation for interconnections towards Class 4 networks.

IMS: E-CSCF & LRF

  • The Emergency-CSCF and the Location Ressource Function (LRF) implements IMS compliant emergency call routing. The modules provide required content aggregation methods.

New in Old SIP Router modules

acc

  • you can include variables in table name and will be evaluated at runtime. For example:
  modparam("acc", "db_table_acc", "acc_$time(year)_$time(mon)")
  • above example will write now to table acc_2011_10
  • same can be done for missed_calls table name
  • second parameter of acc_db_request() supports as well config variables
acc_log_request("200 OK", "acc_$time(year)_$time(mon)");
  • by using dialog module, acc can generate user-customizable CDRs at once
  • added 'failed_filter' module parameter: a string of failure response codes from 300 to 999 separated by commas. Failed transaction will not be accounted if its response code is in the list even when failed_transaction_flag is set. For example:
modparam("acc", "failed_filter", "401,407")

app_lua

  • more modules available in Lua
    • auth
    • auth_db
    • dispatcher
    • maxfwd
    • presence
    • presence_xml
    • registrar
    • rr
    • sdpops
    • sqlops
    • tm
    • xhttp

auth

  • New flag 16 to add stale=true to challenge response.

auth_db

  • export of inter-module API (available through Lua)

auth_radius

  • Added optional uri_user param to radius_www_authorize().

cfg_rpc

  • two RPC commands added for deleting a configuration value from a cfg framework group instance:
    • cfg.del group[id] var
    • cfg.del_delayed group[id] var

cfgutils

  • added pkg_summary() and shm_summary() - ability to print summary of pkg and shm from config

db_postgres

  • reconnect in case of broken connection

dialog

  • read and set per-dialog variables from script
  • provide callbacks to fire on OK and ACK messages following INVITE, respectively
  • enable to terminate call programmatically

dialplan

  • dp_translate() returns -2 (instead of -1) if dp with given id does not exist.
  • added rpc commands
    • dialplan.reload - to reload the records from database
    • dialplan.translate - to translate a string using a specific dialplan id

dispatcher

  • export of inter-module API (available through Lua)
  • new event routes that are called when destinations go on/off-line
  • added RPC commands - new RPC commands to replace the MI ones

domain

  • added rpc commands to reload and dump domains

htable

  • option to save content of htable to db at shutdown - new 'dbmode' attribute for hash table definition
    • if dbmode=1, the content of hash table will be saved back to database table when the sip server is stopped
    • default value is 0 - no sync back to database table
      • example:
  modparam("htable", "htable", "a=>size=8;dbtable=htable;dbmode=1;")
  • new attribute 'initval' to hash table definition
    • initval can set init integer value for hash table keys, meaning that if the key is not set, the init value is returned by $sht(htable⇒key)
    • useful for hash tables holding counters - the value can default to 0, avoiding extra check for $null value
  • added two new PVs
    • $shtinc(htable⇒key) - add atomically 1 to the value of the item
    • $shtdec(htable⇒key) - decrement atomically 1 to the value of the item
    • both return the new value of the item
    • they work only with items having integer values

kex

  • added new function is_myself(uri) to return true if parameters matches 'myself' condition
  • print private memory usage per process via rpc
    • new rpc command pkg.stats that prints used, free and real_used metrics per process for private memory (pkg)
    • you can see how much pkg each process is eating and how much is still available
    • should be useful to track pkg memory leaks and/or trigger alerts when there is no more pkg available
  • added setdebug(level) - can change the debug level per process
  • added resetdebug() - set back the debug level to the global parameter 'debug'
  • added mi command clear_statistics - return the values and reset the counters for statistics

lcr

  • Added optional tag_avp module parameter and made lcr_flags module parameter optional.
  • Renamed dont_strip_or_tag_flag module parameter to dont_strip_or_prefix_flag.
  • load_gws() can take uri_user param, value of which is used instead of Request URI user part by load_gws() function.
  • [from|to][any]_gw functions now check also transport protocol.
  • Renamed lcr_gw table's tag field to prefix field.
  • Parameters of load_gw() function must be given without quotes.
  • Added tag field to lcr_gw table whose value is assigned to possible tag_avp by next_gw() and from_gw() functions.
  • Increased lcr_gw tables version number to 2.
  • Script that upgrades lcr_gw table from version 3.1 is available as http://box.openxg.com/tmp/lcr_upgrade_from_3.1.sh.

ldap

  • connect to server for negative ranks - there are some processes with negative rank that need connection to ldap server, like timers

mtree

  • Added new mode 2 to mt_match() that instead of setting value of longest matching prefix to a pv, sets values of all matching prefixes to an avp so that value of longest matching prefix is in avp index 0.

nathelper

  • new function: is_rfc1918(ip_addr). Checks if the address <ip_addr> is a private range address.

maxfwd

  • export of inter-module API (available through Lua)

presence

  • the module can work in three modes
    • caching
    • caching with fallback to database
    • database only

presence_xml

  • new exported functions to enable the online/offline presentity of a subscriber to be checked from the configuration file.

pv

  • new pseudovariables:
    • $timef(format) - string representation of time formatted according to format
    • $Tb - epoch of the startup (boottime) of the current process
    • $sndto(id) points to next hop address
    • $sndfrom(id) points to local socket to be used for sending
    • $rmid - request method id
    • $mt - return sip message type
      • the value is 1 if the sip message is request
      • the value is 2 if the sip message is reply
    • $Tb - startup time available in a pseudo-variable (boottime)
  • new transformations:
    • {s.ftime,<format>} - format the epoch in the pvar according to <format>
    • {s.sql} - output the pvar as valid SQL value. <null> as NULL, integer as bare number, string as quoted and escaped string
    • {s.replace,<search>,<replace>} - replace every occurrence of <search> in the pvar with <replace>
    • {s.prefixes[,<max>]}, {s.prefixes.quoted[,<max>]} - create a list of (quoted) prefixes of the pvar, with optional maximum prefix length:
  "1234"{s.prefixes,0} => 1,12,123,1234
  "123456"{s.prefixes,4} => 1,12,123,1234
  "123456"{s.prefixes.quot,4} => '1','12','123','1234'
  • new functions:
    • is_int() checks if pvar argument contains integer value.

regex

  • pcre_match_group() allows pseudo-variable in group parameter
    • example:
  pcre_match_group("$rU", "$var(num)");

registrar

  • export of inter-module API (available through Lua)

rls

  • added outbound_proxy parameter - set SIP uri where to send subscriptions
  • use server_address parameter as contact in replies
  • support for resource-list indices that reference other resource-list XML documents (including XPath within documents)
  • new exported function to allow re-subscription to a list to be initiated from the configuration file

rr

  • export of inter-module API (available through Lua)
  • record_route_preset takes a second parameter allowing the setting of a second Record-Route header
  • new rr param 'enable_socket_mismatch_warning': enables or disables a warning log

rtpproxy

  • force_rtp_proxy function was removed

sanity

  • new parameter autodrop to control automatic dropping of broken messages
  • setting it to 0 is good for logging purposes in config file and exiting from there

siputils

  • Added set_uri_user(uri, user) and set_uri_host(uri, host) functions.
  • Function tel2sip() replaced by tel2sip(uri, hostpart, result).
  • Added is_request() returns true if the SIP message is a request
  • Added is_reply() returns true if the SIP message is a reply
    • useful to check in sub-routes that can be executed from both request and reply routes

sqlops

  • xavp support. New function sql_xquery() stores the query result in an xavp.
  • BIGINT support. Native support when sql_xquery is used, transformed to string for sql_query().

textops

  • new exported function to add “Date:” headers to requests.
  • new function is_audio_on_hold() - return true if media stream in SDP is put on hold
  • added remove_body() function - remove the body of the sip request/reply

topoh

  • new parameter 'sanity_checks' - option to bind to sanity for parsing checks
  • the module can bind to sanity to perform parsing checks before proceeding to encoding/decoding of received requests

tmx

  • asynchronous SIP request processing functions for configuration file
    • t_suspend() - suspend the processing of SIP request transaction
    • t_continue() - resume the processing of SIP request transaction
  • $T(name) - new class of pseudo-variables for accessing transaction attributes:
    • internal index, label, the branch index, reply code

uac

  • new function: uac_reg_request_to. Lookup a local user from the registration table and prepares message variables so the request can be sent to the remote user, using the same credentials as with which the registration has been done.
  • updates to internal mechanism of registering as SIP user agents to remote SIP servers

usrloc

  • new parameter 'preload' can be used to specify list of location table to be initiated at startup, even they are not used by registrar module functions. Good for using the usrloc module from inside other modules.

xavp

  • xavp's are enabled by default now.

xcap_server

  • added oma user-profile and pres-content (avatar) support
  • support for extra auids:
    • org.openmobilealliance.user-profile
    • org.openmobilealliance.pres-content
    • org.openmobilealliance.search
  • Support for HTTP 1.1 pre-conditions to enable clients to avoid having to re-download unchanged documents and to check whether documents have changed or not on upload

xhttp

  • export of inter-module API (available through Lua)

New in Core

Config Structure

  • request_route { … } can be used instead of main route { … }

Preprocessor directives

  • #!substdef - add a substitution rule and a define at the same time
  • #!substdefs - add a substitution rule and a define with string value at the same time
  • #!trydef - add a define if not defined already
  • #!redefine - force redefinition even if defined already

#! and !! can be used as start of preprocessor directives

import_file

Attempt to include a file, but if it is not found, do not throw error like include_file.

Parameters

  • corelog - control the log level for non-critical core error messages

Config Reload Framework

  • support for multiple cfg group instances
  • add/del_group_inst() updates the local configuration to make sure that cfg_set_*() sees the change when it immediately follows the group instance modification
  • @cfg_selected.group added - @cfg_selected.<group_name> returns the selected instance id of the specified group. If no group instance is selected, i.e. the default is used, then empty string is returned.
  • @cfg_get supports nested calls - @cfg_get.<group>.<variable> makes use of the already implemented nested select functions to parse the returned value. The following nested calls are supported:
    • @cfg.get.<group>.<variable>.nameaddr…
    • @cfg.get.<group>.<variable>.uri…
    • @cfg.get.<group>.<variable>.params…

libsrdb1

  • keep PID per DB connection to detect automatically if many processes share same DB connection

SIP Parser

  • sdp parser detection of on hold media during sdp parsing

Memory Manager

  • core events when pkg usage changes
  • pkg mem size configurable form the cmd line
    • The pkg mem size used can be configured by using the “-M” parameter on the command line. The default remains 4Mb.
  kamailio -M 8  -f test.cfg # start with 8mb of pkg memory

STUN

  • ser_stun update to RFC 5389
    • Removing checking/adding of FINGERPRINT attribute
    • Update some attribute values according to new spec

RPC Commands

  • added rpc command core.psx
    • similar to core.ps but prints the details in RPC structure along with process index, like:
    sercmd> core.psx
    {
    	IDX: 0
    	PID: 73408
    	DSC: attendant
    }
    {
    	IDX: 1
    	PID: 73409
    	DSC: udp receiver child=0 sock=127.0.0.1:5060
    }

New in Documentation

Developer visible changes

  • Many bug-fixes to existing doxygen code documentation in modules and core
  • Several extensions to doxygen documentation in modules and core
features/new-in-3.2.x.1318971156.txt.gz · Last modified: 2011/10/18 22:52 by miconda