This page has been visited 7505 times.
2. What is new in 2.4.0
2.1 OpenSIPS script
- "-f -" was introduced for reading the config file via stdin instead from a file.
- new core function is_myself that tests if a host is a local address that OpenSIPS listens on
- new core variable $af that returns the address family (IPv6 or IPv4) of the received SIP message
- any script variable now supports comparison via the '==' and '!=' logical operators with IP addresses and netmasks (eg. $var(ip) == 10.10.0.0/24). This tests whether the IP address in the variable matches the subnet given in the expression.
- old keywords were dropped (src_ip, dst_ip, src_port, dst_port, uri, from_uri, to_uri, method, status, myself, proto and msg:len)
- OpenSIPS can now be configured to listen for a specific protocol on any interface, including IPv6, using the * token (i.e.
listen = udp:*:5060
will bind all available IPs on port 5060)
- you can now mark an interface as an anycast interface using the
anycast
keyword - doing so, the tm module will automatically detect replies that are not destined to the current OpenSIPS instance and will handle them accordingly.
- script transformations now accept NULL as input and also return NULL instead of empty string for unsuccessful operation or errors. This allows a more cleaner way of chaining transformations and checking the final result.
- extended multi-line strings, allowing for more readable code such as in this example
2.2 OpenSIPS core
"Load" statistics
OpenSIPS 2.4 comes with a complete re-design of the statistics that gives information about the OpenSIPS internal load. The load is defined as percentage of time spent in doing processing versus total time. Following the model of "top", there are three load values, calculated over different periods of time:
- realtime load - calculated over the last 1 second
- last minute load - calculated over the last 1 minute
- last 10 minutes load - calculated over the last 10 minutes
The new load class overs a more granular access to the load information:
- load per process
- load per OpenSIPS core (covering only core/SIP processes)
- load per entire OpenSIPS (covering all processes, core and modules)
Find the full list of available load statistics (and their description) here.
DB interface
- added the escaping/encoding of unsupported characters inside a DB URL. Using %xy hexa encoding, you can push any sort of characters in key fields of the URL as username and password.
InterProcess Communication (IPC) support
- added the job dispatching capability - to send an internal job to be executed/handled by any available process (kind of a pseudo load-balancing of the internal jobs among the processes). The FreeSWITCH module is using this in order to execute the incoming FS events in any idle process.
- added Remote Procedure Call (RPC) support via IPC - a process can trigger the execution of a function in a different process. This is used by the TCP core to "externalize" the execution of its functions responsible for generating statistics.
- shutdown sequence is now implemented via RPC - the attendant/main process executes in all IPC aware processes a terminate function. This leads to a controlled process termination versus the old brutal approach based on simply killing the processes. Such killing may result in an inconsistent state of the shared resources and even more in a failed shutdown process with lost data. For the future, a per-process cleanup handler may be exported by each module.
SIP Parser
- the "To" like headers (like PPI or PAI) are now properly parsed as multi-value (comma separated) name-addr/addr-spec headers
Memory manager
- auto-recovery from "double pointer free" errors in production environments
- improved error reporting in "out of memory" situations
- if DBG_MALLOC is enabled and you forgot to set the memdump and/or memlog levels, you may still extract a memory dump without restarting OpenSIPS by temporarily dropping OpenSIPS to "log_level = 14" and "log_level = 15" respectively, perform the dump, then restore the logging back to its original state.
2.3 NEW SIPREC module
The new SIPREC module in OpenSIPS 2.4 provides the means to do call recording to an external recorder using the SIPREC standard.
2.4 NEW FREESWITCH_SCRIPTING module
FREESWITCH_SCRIPTING is a new module that provides the ability to subscribe to arbitrary FreeSWITCH ESL events and receive/manipulate them inside the OpenSIPS script. It also allows the script writer to run arbitrary FreeSWITCH ESL commands. Read this blog post for detailed explanations.
2.5 NEW EVENT_JSONRPC module
The new EVENT_JSONRPC module in OpenSIPS 2.4 implements a transport protocol for the OpenSIPS Event Interface. Using this module, you can notify applications about OpenSIPS internal events using the JSON-RPC protocol.
2.6 NEW JSONRPC module
JSONRPC is a new module in OpenSIPS 2.4 that provides functions to run JSON-RPC commands on a remote JSON-RPC server, and retrieve the call's response back.
2.7 CACHEDB_REDIS module
- OpenSIPS will now start even if Redis is unreachable. A new modparam, shutdown_on_error, can be enabled in order to revert to the old behavior.
2.8 CLUSTERER module
- The topology establishing mechanism no longer requires any fields in the DB for persistency(removed ls_seq_no and top_seq_no).
- new parameters: db_mode, current_info and neighbor_info that add the possibility of dynamically learning the topology of the cluster without needing to provision any node information in a database. Describing at least one neighbor along with its own information is enough for a node to join a cluster.
- The internal topology, in terms of the state of the links between nodes, was enhanced by advertising and keeping a bidirectional representation. This improves the topology consistency and convergence.
- Added a node capabilities layer that is used to keep track of the status of the higher-level clustering services (eg. dialog replication) along with the MI command clusterer_list_cap to list them.
- Added a mechanism that allows modules that use the clustering API to perform data synchronization from an eligible node based on the capabilities layer.
- Added a new column to the clusterer table, flags that can be set to the value "seed" in order to bootstrap the data sync'ing in the cluster.
- Introduced a generic way of cluster communication directly at script level. This can be achieved using:
- new script function cluster_check_addr() that checks if an IP address belongs to one of the nodes in the cluster.
- Added the ability to dispatch the execution of any MI command to all nodes or a single node in in the cluster with the cluster_send_mi and cluster_broadcast_mi MI commands.
2.9 CGRateS module
- Adapt to the newly added SessionV1 interface, which provides mechanisms to access enhanced CGRateS submodules (such as AttributeS or SuppplierS modules). One can activate each of these new features by setting the $cgr_opt(name) variable.
- Provide a simple mechanism to access the values returned by CGRateS using the $cgr_ret(name) variable. The old
$cgrret
variable has been deprecated and replaced by the newly added $cgr_ret(name)
, although when used without a name (i.e. $cgr_ret
) it has the same behavior as the old $cgrret
).
2.10 DIALOG module
- accept script variables for the profile parameter of the is_in_profile(), get_profile_size(), set_dlg_profile() and unset_dlg_profile() functions.
- add callid, from_tag and to_tag to the E_DLG_STATE_CHANGED event parameters.
- Added support for proper dialog distribution required in scenarios like Active-Backup, Active-Active or Anycast setups. This roughly consists of the following features: data synchronization at OpenSIPS startup(or runtime if required) and dialog "ownership" and coordination of nodes in terms of taking actions on dialogs. More details can be found in this article.
2.11 DNS_CACHE module
- proper handling of TTL 0 in DNS answers. RFC1035 states that "zero TTL values are interpreted to mean that the RR can only be used for the transaction in progress, and should not be cached".
2.12 FRAUD_DETECTION module
- the module now uses local time instead of UTC time. The former behavior can be restored by enabling use_utc_time.
2.13 FREESWITCH module
2.14 JSON module
- Two new variables that control the way the JSON object is printed as string have been added:
- $json_pretty(id) - dumps the JSON in a nice, readable form, by adding spaces and tabs to the output.
- $json_compact(id) - outputs the JSON in a compact manner, avoiding any extra spaces in the output.
2.15 MANGLER module
- the public_ip parameter of the encode_contact() function now also accepts script variables.
2.16 MID_REGISTRAR module
- significant rework of the module in order to fit with even more scenarios. The Path-based insertion support was dropped -- the insertion is now exclusively performed by rewriting Contact URIs, with the option of replacing the Contact username as well, or simply append a ";ctid=" URI parameter. More details in the updated mid_registrar docs.
- added restart persistency support. Currently only works with single-instance user location setups.
2.17 NATHELPER module
- new modparam, sipping_latency_flag - Enables pinging latency computation (and event raising) for the current Contacts of a received REGISTER.
- new modparam, sipping_ignore_rpl_codes - CSV string containing a series of SIP reply codes which are to be discarded. Useful for usrloc full-sharing topologies, where the location nodes are front-ended by a SIP entity of our own, hence it may reply to contact pings with status codes such as 408 (Request Timeout), which should be ignored.
2.18 PRESENCE module
Added clustering capabilities in terms of full data sharing or/and federated clusters. The clustering support allows the presence node to share data between them (full sharing versus data partitioning with replication) and to synchronize/coordinate the nodes in terms of taking actions over data (broadcast & querying over the cluster, tag sharing).
The clustering support enabled several scenarios:
- active - backup High Availability
- multi-active Load Balancing
- multi-active Federation (partitioning)
- mix between HA and Federation scenarios
For a detailed description of those scenarios, please refer to the this blog post.
The subs_phtable_list MI command now includes in its output the Contact and the first proxy from Record-Route as next_hop; also listed subscriptions can be filtered by "From" and "To" URIs.
2.19 RATELIMIT module
- new module parameter limit_per_interval that selects if the limit parameter of the rl_check() function is specified per-timer_interval or per-second.
2.20 REGISTRAR module
- new lookup() flag, l (Local-only). Only valid within a federated user location cluster. Forces the lookup to result in local contacts only (no additional global branches are added).
- new lookup() flag, yXXXX (Pinging latency filtering). Maximally accepted contact pinging latency (microseconds). Contacts of an AoR with a higher latency will be discarded during the lookup.
- new lookup() flag, Y (Pinging latency sorting). The branches will be created in ascending order of their target contact's last successful ping latency (fastest ping -> slowest ping). This flag may work together with the "y" flag.
2.21 REST_CLIENT module
- new function rest_init_client_tls() - forces a specific TLS client domain (cert / private key pair) for the next request.
2.22 RTPENGINE module
- The rtpengine has support for two new parameters: in-iface and out-iface that can be used to specify which listening interface rtpengine should advertise when running in bridge mode.
- Adapt with the latest transcoding features added in rtpengine.
- Provide access to the entire information of a RTPEngine session using the
$rtpquery
variable
- Provide an easy way to get statistics from a RTP call such as MOS (Mean Opinion Score) value using the $rtpstat(name) variable.
- Make the RTPEngine provisioning more flexible by adding database support for specifying rtpengine sockets.
2.23 RTPPROXY module
- The rtpproxy module can now instruct the RTPProxy server to duplicate the stream RTP to a remote destination.
- The new default_set parameter can be used to specify a custom default set, instead of the hardocoded 0.
- The rtpproxy_offer() function can now return the IP and port used by rtpproxy to receive the media.
2.24 SIP_I module
- added the ability to push custom headers in body parts via the default_part_headers module parameter or as an optional extra parameter to add_isup_part([isup_msg_type][,extra_headers]) function - this is very useful for managing the "Content-Disposition" header per body part.
- provided a way to parse and access ISUP parameters and subfields from an ISUP message contained in a script variable. This can be done via the script transformation {isup.param,param_name,[subfield_name]} directly exported by the module.
2.25 SIPTRACE module
The tracing capabilities were extended in order to capture the following SIP messages which were not traced so far:
- 100 trying generated by OpenSIPS
- incoming ACK for negative replies
- outgoing ACK to negative replies
- incoming replies to CANCEL requests
- incoming request retransmissions
- outgoing request retransmissions
- outgoing reply retransmissions
2.26 SIPMSGOPS module
- added the ability to push custom headers in body parts as an option extra parameter to add_body_part(body,mime[,headers])' function - this is very useful for managing the "Content-Disposition" header per body part.
2.27 SIPREC module
- added the media_ip parameter to the siprec_start_recording() function in order to include the "c=" line in the sdp body.
- added the "t=0 0" line in the SDP body.
- allow custom XML values for the caller and callee parameters of siprec_start_recording() function.
2.28 SQL_CACHER module
- the sql_cacher_reload MI function can now invalidate all keys when issued in the "on demand" mode when no specific key is passed as parameter.
2.29 TM module
- Added support for Content-Disposition: no-cancel by forcing the "0x10" flag in t_relay() - as per RFC3841, section 9.1, the TM module may be instructed not to cancel all ongoing branches when a 2xx reply is received. It will keep the pending branches ongoing until (1) all branches will receive a final reply or (2) the transaction hits the timeout. This is work sponsored by Harris Corporation (https://www.harris.com).
- Added support for handling transactions in a distributed environment, with multiple active-active servers, such as ANYCAST setups. Read more about the Full Anycast support on our blog.
2.30 USRLOC module
- major clustering additions to the module, featuring a "federated data" topology and two "full mesh" topology variants (OpenSIPS-oriented or NoSQL-oriented). Read this blog post for more details.
- migrate the "expires" column from DATETIME to INT. Instead of keeping the expires value as DATETIME, better keep it as UNIX timestamp in order to avoid any impact due TZ and DST changes.
- a new extra field attr provided by the E_UL_CONTACT_INSERT event
- new event: E_UL_LATENCY_UPDATE. Raised
- new modparam: latency_event_min_us. Denotes a minimal pinging latency threshold (microseconds) beyond which the E_UL_LATENCY_UPDATE will start getting raised.
- new modparam: latency_event_min_us_delta. Denotes a minimal pinging latency difference (microseconds, positive or negative) beyond which the E_UL_LATENCY_UPDATE will start getting raised.