Kamailio SIP Server - New Features in v5.6.x (pre)

📘 Previous version was 5.5.x (released on May 2021), see what was new in that release at:

📘 This is a draft of new features added in this version, manually updated, thus not always synchronized with what is new in source code repository.

New Modules








New In Existing Modules


  • added duk_module_node for JS module resolution
  • added parameter mode to control initialization of js module api
  • duktape interpreter upgraded to v2.7.0


  • support for lua 5.4.x


  • support for lua 5.4.x


  • updated squirrel interpreter to latest git version (3.2+)


  • added async_task_group_route(routename, groupname) function
  • added functions to execute async tasks only with custom data
  • variants which do not suspend transaction
  • added variable $async(key) - get async task group name and async task data
  • exported functions to kemi to get async group name and data
  • module parameter to set return code on success


  • added virtual flag to output of rpc corex.list_sockets
  • rpc shm stats values printed as unsigned long
  • support adding dns srv records via dns_cache param
  • added shm.report rpc command
  • added variable $lsock(expr) - get listen socket attributes
  • n/s1/listen - match the socket with the name s1 and return the listen address
  • added transformation {sock.attr} - get attributes of a socket address proto:host:port
  • added forward_reply() function


  • manage case where TZ environment variable is not set


  • implement long and long long types of values
  • float/double values are stored over a long long int instead of int
  • cope with larger values than MAX_INT/1000, supporting now up to MAX_LLONG/1000


  • RPC commands to control database connections
  • commands to list, enable or disable database connections of a cluster


  • added support for async queries


  • support to use Redis cluster api


  • added cfgtrace_format parameter
  • control what is printed in the cfgtrace log message (e.g., do not print config file path)


  • added local_only parameter to RPC dlg.stats_active
  • added duration field in dialog rpc output
  • added filter based on start timestamp to rpc dlg.list_match
  • added dlg_filter_mode parameter
  • do nothing on timeout if dialog is not local
  • do not send ka if dialog is not local


  • options to control better when the dns query should be done
  • added ds_dns_mode parameter
  • option to do srv dns query for target addresses
  • added ds_is_active(group [, uri])
  • check if any or a specific uri in a group is active
  • option to get shorter result for rpc list command
  • option for rpc list command to print more attributes
  • support for dns resolving of destination addresses done on timer
  • added ds_dns_mode and ds_dns_interval parameters
  • rpc command to add a record updated to set priority
  • track time of last dns timer update
  • added ds_dns_ttl parameter - option to set ttl for dns queries done by dispatcher


  • execute event route on data received on a custom udp socket
  • new sockaddr attribute
  • exposed src ip and port via variable


  • added reload RCP command functionality


  • added iterator function sht_iterator_rm(iname) to remove current item
  • added iterator functions sht_iterator_sets() and sht_iterator_seti() to set the value of current item
  • added iterator function sht_iterator_setex() to set expire of current item
  • added rpc command htable.setex to set expire for an item
  • added config functions to set item value and expire at once
  • added rpc commands to set value and expire at the same time


  • more algorithms, SA improvements
  • added virtual flag to output of rpc sockets list


  • added new parameters for AAR, AVP517
  • af_signaling_ip6, component_media_type, flow_protocol, omit_flow_ports, rs_default_bandwidth, rr_default_bandwidth


  • extended save() with optional flag DO_NOT_USE_REALM_FOR_PRIVATE_IDENTITY
  • added a new contact state for notifications


  • added capability to skip a specific realm


  • added function dns_set_local_ttl() to set local ttl for dns queries


  • support for long/long values in rpc messages
  • l and j for long and unsigned long
  • L and J for long long and unsigned long long


  • possibility to add headers when generating jwt
  • exported jwt_generate_hdrs() function to kemi


  • allow optional AMQP-headers in kazoo_query() and kazoo_publish()


  • added functions KSR.kx.ifdef() and KSR.kx.ifndef()
  • added function kx.get_srcaddr_sock() - return source address in socket format similar to $sas
  • added function KSR.kx.get_rcvaddr_sock() - return local received address in socket


  • use unsigned long for rpc stats.fetchn values


  • source port check for from_any_gw() and from_gw()
  • updated kemi exports with new functions having port parameter
  • improve binary search to support a match including src port


  • several functions exported to kemi framework


  • added gt option for optimization port resource allocation
  • added custom_sdp_ip_avp option for handling NAT client


  • added parameters mqueue_name and mqueue_size to define queues
  • added mqueue_mode parameter


  • optional parameter mode for handle_ruri_alias()
  • new nat test (512) based on target address
  • added alias_name parameter
  • allows to set the name of the parameter used for alias


  • added flow_token_secret parameter


  • added parameter trusted_cleanup_interval
  • cleanup old data of trusted hash_table by timer function


  • added option to return 200 instead of 202 on subscriptions


  • added parameter default_expires (3600s)


  • added parameter default_expires (3600s)


  • added parameter default_expires (3600s)


  • added parameter default_expires (3600s)


  • added parameter default_expires (3600s)


  • added parameter default_expires (3600s)


  • exported KSR.pua_json.publish()


  • generate uuid instead of using call-id value to support parallel forking


  • added $rpl(key) variable - manage reply
  • added $ccp(gname.vname) variable - access core custom parameters
  • added $hfl(name) variable - header field list
  • added {param.in,name[,sep]} transformation
  • added $hflc(hname) variable - header field list couting
  • extended $nh(k) to work for replies using 2nd via
  • added WS and WSS to $K(key) variable
  • support INET/6 as alternative IPv4/6 for $K(key)
  • $nh(i) returns ip address family version
  • added {s.rafter,x} and {s.rbefore,x} transformations - get content of a string after or before a character with reverse searching
  • added {s.fmtlines,n,m} and {s.fmtlinet,n,m} - format string in multi-lines with indentation
  • added $via0(attr) variable - get the attributes of first via header
  • added $via1(attr) variable - get the attributes of 2nd via
  • added $viaZ(attr) variable - get the attributes of last via header
  • added $msgbuf(index) variable - get content of SIP message buffer by index
  • added functions for $xavu(...) params explode/implode
  • added $rsi variable - return status code for replies and 0 for requests
  • added transformation class {val}
  • {val.n0} - return int 0 instead of $null value, or existing value
  • {val.json} - if value is $null, return empty string; if value is string, then it is escaped for use as json value (without surrounding quotes)
  • {val.ne} - return empty string if the variable value is $null
  • {val.jsonqe} - quoted json value
  • extended $cnt(...) to work with $xavp(...)
  • added $msg(lpart) variable - return last part of the message - headers and body (skips first line)
  • added $Ras - return local received address in socket format
  • added set function for variable $rcv(buf)


  • added support to remove a specific value from a header
  • pvh_remove_header_param() remove the value from the given header or the entire header if no other value is present
  • pvh_header_param_exists() check if the value is present to a given header


  • added UTC_timestamps parameter


  • implemented lookup filter mode 2
  • use only contacts that have associated TCP/TLS/WSS connection active
  • save() new flag to prepare the headers for reply


  • all record_route_...() functions consider custom user AVP


  • added default_interval parameter to set the fire interval


  • added mode 2 for rtpengine_allow_op to return only manually disabled nodes
  • added un/silence_media() methods
  • ignore mos 0 when selecting min-mos
  • aliased $rtpestat to $rtpstat
  • added rtpengine_query_v() function
  • do a query cmd and store the response in a variable as a json
  • rpc reload is limited to 10secs frequency


  • aliased $rtppstat to $rtpstat


  • added function secsipid_build_identity(...) to build identity value and store in pv
  • added function secsipid_check(sidentity, keypath)
  • added function secsipid_sign(headers, payload, keypath)
  • added kemi function to get $secsipid(val)
  • added function secsipid_build_identity_prvkey() to build Identity by providing private key data


  • new parameter fage to set sip traffic dump file age after which is deleted


  • added function sipt_has_isup_body
  • added variables:
  • $sipt(redirection_information.reason)
  • $sipt(redirection_information.original_reason)
  • $sipt(redirecting_number.nai)
  • $sipt(redirecting_number)
  • $sipt(original_called_number.nai)
  • $sipt(original_called_number)
  • $sipt(generic_number.nai)
  • $sipt(generic_number)


  • added $siptrace(...) variable
  • added directionattribute to module variable


  • added optional mode parameter to is_first_hop() to control the matching
  • added hdr_date_check(tdiff) function
  • added cmp_hdr_name(hname1, hname2) function
  • functions to compare uri and aor exported to kemi


  • support for 7bit special chars
  • extended rpdata params manipulation
  • capability to set RPData originator and destination addresses flags


  • added parameter snmpVersion to specify SNMP version


  • support for histogram


  • added PVs to allow access to x509 subject and ppt grants


  • function KSR.sworker.active() exported to kemi
  • added parameter xdata to be able to pass extra data to worker


  • added function tcp_close_connection([conid])


  • added function remove_hf_idx(hname, idx)
  • added function remove_hf_match(hname, op, expr)


  • added functions and variables to iterate headers list
  • iterate through headers, access values via $hfitname(iname) and $hfitname(ibody)
  • headers iterator functions exported to kemi
  • added body lines iterator functions
  • iterate through lines of message body, get the value via $blitval(iname)
  • body lines iterator functions exported to kemi
  • exported msg_set_buffer(data) function


  • new config variable $tls(key) - key:
  • m_subject_line - return local (my) certificate subject line
  • p_subject_line - return remote (peer) certificate subject line
  • m_issuer_line
  • p_issuer_line


  • added callid_cseq_matching parameter
  • transaction matching using callid and cseq values
  • added enable_uac_fr parameter


  • added support for lookup and branch creating by contact
  • added function ts_append_by_contact(table, ruri [, contact])


  • new parameter reg_hash_size to control better scalability
  • new parameter reg_use_domain
  • added uac_reg_lookup_uri() - do lookup for user in the uri
  • exposed internal flags for $uac_req(key) variable
  • if set to 1, the password is considered to be HA1 value
  • trigger event route for failure and timeout when $uac_req(evroute) = 2


  • added RPC commands that used to be MI commands


  • added db_clean_tcp parameter
  • if set, tcp contacts are deleted before loading location table at start time


  • set sruid hooks for uuid generation on mod register


  • added prefix_mode parameter
  • allows pv-format specifier in prefix parameter


  • implemented specifiers for long and long long types of values

New in Core

  • support for time64 libcs - using the lld format for time_t
  • added #!defenvs preprocessor directive
  • similar to #!defenv, but the value is enclosed in double quotes to make it covenient to be used as a string token
  • added #!trydefenv - The same as #!defenv, except if the variable is undefined, the def value will be undefined as well
  • added #!trydefenvs - The same as #!defenvs, except if the variable is undefined, the def value will be undefined as well
  • tcp - added core parameter tcp_wait_data
  • specify how long to wait (in milliseconds) to wait for data on tcp connections in certain cases - default is 5000ms (5secs)
  • added virtual flag to output of rpc core.sockets_list
  • sruid - functions to get sruid with suffix from hasing a string
  • sruid - api hooks for setting uuid generation callbacks
  • added support of ICE media options to SDP parser
  • enable updating received data via $rcv(buf) on event_route[core:msg-received]
  • dns cache - option to set local ttl to overwrite the global value

Command Line Arguments

  • logging: JSON - add CEE schema support
  • new option j for json logging to print message in json format
  • if the log message starts with { and ends with }, then it is expected to be a json document, printed as it is in the message value, otherwise it is printed as field text
  • new option p for json logging
  • prefix is printed as it is in the root json, expected to be a list of json field starting with comma
  • added rpc command core.runinfo
  • return runtime info: running version, uptime, ...


  • accept IPv4/6 as alternative keywords for INET/6


  • added sip_parser_log_oneline - log SIP headers with . instead of \r\n
  • listen can have a virtual flag to check for nonlocal floating IPs
  • mem_summary set to 12 by default
  • added tcp_script_mode global parameter
  • control if the tcp connection should be closed if received message processing resulted in error return code



  • added KSR.pv.geti("pv")
  • added KSR.is_WSX() - return true of proto is WS or WSS
  • added to_UDP/TCP/TLS/SCTP/WS/WSS/WSX() - return true if target is over UDP/TCP/TLS/SCTP/WS/WSS/WSX
  • added KSR.to_IPv4() and KSR.to_IPv6()

Memory Managers

  • added api function for getting usage report for qm manager
  • store file, line, module and functions in memory reports


  • mechanism to execute child_init() for special ranks on demand
  • new special rank PROC_POSTCHILDINIT, to execute child_init() for main process only when ksr_module_set_flag(KSRMOD_FLAG_POSTCHILDINIT) is executed in mod_init()


  • added return to root blocks - make it more explicit for returned code



  • subcommand tls gen-certs
  • generate self signed certificate in current directory
  • subcommand srv modules
  • list the loaded modules


  • double/float values printed without decimals when they are 0
  • cope better with long (long) values stored in double fields


  • database schema updates


  • added subcommand tls to generate self-signed certificates
  • added subcommand apiban for APIBan records management
  • auto-complete options for subcommand srv rpchelp
  • embedded shell
  • connect on starting to running Kamailio and display its version
  • display sip server uptime on start
  • config section for shell command