This page has been visited 9032 times.
1. Migration from 1.11.x to 2.1.0
A manual for how to migrate/update from 1.11.x to 2.1.x is now available on site.
2. What is new in 2.1.0
2.1 SIP transport protocols rework
Allows new protocols to be added in a much easier way. OpenSIPS 2.1 now comes with pluggable core transport modules, TCP and UDP, and three abstracted protocol-modules: WebSocket, TLS and SCTP. The binary no longer needs to be recompiled every time you choose to support a new protocol.
In order to use one of those protocols (in a SIP listener), you need to load the corresponding module (as any other OpenSIPS module).
2.2 Asynchronous I/O operations
OpenSIPS 2.1 has the ability to perform, from script level, various operations in an asynchronous mode. Now you can run DB queries, REST queries or external scripts without the blocking penalty!
The OpenSIPS config file allows you to use certain functions in async way (via the dedicated "async" statement). Both suspending and resuming are done at script level. A detailed description of how the async support works in 2.1 is available here: http://www.opensips.org/Documentation/Script-Async-2-1 .
The async scripting support is just the tip of the iceberg (when comes to the work which has been done). To make this possible, radical changes were implemented in OpenSIPS 2.1 (most of them imported from OpenSIPS experimental branch):
- per-process I/O reactors
- timer jobs dispatched across all SIP workers (versus dedicated timer procs)
- updatable transactions in TM (to be able to use the transactions as contexts for the async jump)
- transaction based async support in TM module
- processing context (to make it easier to suspend and resume the script execution)
The first modules providing async functions are:
- avpops for DB mysql queries
- exec for script execution
- rest_client for remote REST queries
- Debugging levels: complete rework. They can now be set globally or individually (per process) using the debug MI command. More information here ...
- New shm_check MI function - To be used when running with memory debugging (DBG_QM_MALLOC memory allocator). Does a complete scan of the shared memory pool and aborts OpenSIPS on any encountered sign of memory corruption.
- Support for RFC 5031 urn:service URIs
- New TCP parameter: tcp_crlf_drop - set to 1 in order to drop "\r\n" pinging messages
- New core parameter: db_max_async_connections - maximum number of connections to a single DB backend from a single worker
- New MI command: list_statistics - prints a list of all available statistics in the current configuration of OpenSIPS
- Memory profiling with HP_MALLOC - send SIGUSR1 to OpenSIPS processes in order to print a detailed status of optimized shared memory buckets and fragment distribution
2.4 Config Script
- New async() script statement: Dramatically improves the scalability of OpenSIPS config scripts which must perform blocking I/O (MySQL queries, exec scripts, HTTP requests). Halts script execution and runs a resume route once the async operation is complete. More info in the OpenSIPS 2.1 async tutorial ...
- loadmodule statement ordering: eliminated! Modules can now be loaded in any order within the config script. Also added an easy-to-use module dependency specification logic for module developers! More information here ...
- New assert(statement, message) function - If statement does not hold, OpenSIPS can just print the message or even abort (if abort_on_assert is enabled). More information here ...
- New $rT pseudo variable - Holds the current route type as a string. Useful for determining the original route type when inside another route in script - Allows for more generic and reusable routes. More information here ...
- New string transformations: s.fill.left, s.fill.right - Fill a string with a char/string until a given final length is reached. Refer to the transformations manual for usage examples
- New uri transformation: uri.schema - Extract the given URI's schema. More information here
- sync/async support for event_route - Provides the possibility to run an event route asynchronously. More information here
- Support for multi-part bodies - $cT (Content-Type) and $rb (Request Body) are now indexed - e.g. $(rb)
2.5 NEW PROTO_WS module
Module to provide the websocket transport protocol for SIP (server side). You need to load this module if you want to define SIP listeners over WS transport. See the websocket usage tutorial and the module documentation for parameters.
2.6 NEW PROTO_TLS module
Module to provide the TLS transport protocol for SIP. You need to load this module if you want to define SIP listeners over TLS. See the TLS usage tutorial and the module documentation for parameters.
2.7 NEW PROTO_SCTP module
Module to provide the SCTP transport protocol for SIP. You need to load this module if you want to define SIP listeners over SCTP. See the module documentation for parameters.
2.8 NEW COMPRESSION module
A new module which performs both SIP message compression and SIP header compaction. The compression module gives you the means to reduce the size of the message, by using the following features:
- message body and the header compression
- unnecessary headers removal
- header name reduction to RFC compact form (such as 'v' for 'Via'); we support a limited set of compact headers from RFC 3261 and RFC 4028 (complete list at )
- unnecessary attribute lines removal from the sdp body which represent default values
A comprehensive tutorial is available beside the module documentation.
2.9 NEW EMERGENCY module
The emergency module provides emergency call treatment, following the IETF specs (RFC 6881, RFC6442) and the i2 specification of the American entity NENA(National Emergency Number Association). Module documentation is available here. Also, a comprehensive tutorial is available for describing the usage cases and how to use this module.
2.10 NEW FRAUD_DETECTION module
A new module that helps you prevent fraud by detecting (in a per user fashion) fraudulent calls based on dialing patterns (using patterns on total number of calls, on average duration, number of parallel calls, maximum cps value and more).
See the complete usage tutorial and the module documentation for parameters and functions provided by this module.
2.11 NEW RTPENGINE module
A new module that enables media streams to be proxied via RTPENGINE
2.12 NEW TOPOLOGY_HIDING module
A new module that offers topology hiding capabilities. The module strips and restores the headers that contain topology information (Via, Record-Route, Route and Contact
headers) , and optionally it can also change the Call-ID of the requests. The module can work on top of the dialog module, or in stand-alone mode, thus allowing to do topology hiding for all types of dialogs ( eg. Presence dialogs ) and also for standalone initial requests ( eg. SIP MESSAGE ).
See the usage tutorial and the module documentation for parameters and functions provided by this module.
2.13 AVPOPS module
- avp_db_query() may now be used asynchronously (with MySQL backend). A usage example can be found in the module documentation.
2.14 CACHEDB_MONGODB module
- Added support for DATE fields when doing raw queries. Date fields are returned as UNIX timestamps at script level.
2.15 CACHEDB_SQL module
- Full rework of the module, including a better usage of the CACHEDB interface, and also allowing for multiple DB connections to be used from script.
2.16 DOMAIN module
- You can now specify attributes from the domain names that can be used later on from the script. More information here ...
2.17 DB_MYSQL module
- The db_mysql module is now capable of doing asynchronous raw queries. It implements its own pool of connections (per process), so multiple queries can be done in parallel from the same process.
2.18 DB_UNIXODBC module
- Slight performance improvement for all SELECT queries
2.19 DIALOG module
- Added the E_DLG_STATE_CHANGED event, that will be triggered when the dialog state changes (eg. from early to established, from established to ended, etc ).
2.20 DIALPLAN module
- Routing is now partition based: you may specify which string translation rules want to use to route certain messages. Thus you can re-use the routing rules for various purposes, while keeping the provisioning and reloading part fully separate. More information here...
- New column: timerec. Allows time recurrence based enabling of dialplan rules (accepted strings are RFC 2445 compatible). Backwards-compatible with the previous DB schema. More information here...
- dp_translate(): the "id" parameter may now also be given as a plain int
2.21 DISPATCHER module
- Routing is now partition based: you may specify by which partition's rules you want to route certain messages. Thus you can re-use the routing rules for various purposes, while keeping the provisioning and reloading part fully separate. More information here...
- ds_reload MI command updated to support partition-only reloading
- ds_is_in_list(): ip and port must no longer be strictly given as pvars
- Added the destination priority column
- New modparam: persistent_state - prevent OpenSIPS from making any runtime UPDATE queries on the dispatcher table
2.22 DROUTING module
- Routing is now partition based: you may specify by which partition's rules you want to route certain messages. Thus you can re-use the routing rules for various purposes ( eg: separate routing, prefix matching, etc ), while keeping the provisioning and reloading part fully separate. More information here...
- Using the new MI function dr_reload_status you can get the time of the last "dr_reload" (update) for any partition. The feature is available even if you don't use partitions. More information here...
- A new MI function dr_number_routing was added which allows to simulate a do_routing() call, by fetching the list of the gateways / carriers to which a number would be routed. More information here...
- Added a new event to be triggered when the state of a gateway is changed (either from MI or via probing triggered from script). More information here...
- New modparam: persistent_state - prevent OpenSIPS from making any runtime UPDATE queries on the dr_gateways and dr_carriers tables
2.23 EVENT_RABBITMQ module
- The rabbitmq module can now send messages to different exchanges . You can simply specify the exchange you want to use in the socket url. More information here ...
2.24 EVENT_ROUTE module
- Added async event handling - Allows for running the events in an asynchronous mode (in a dedicated process). More information here ...
2.25 EXEC module
- Asynchronous exec() - the exec() function may now also be used in the asynchronous mode, via the async() statement.
- New generic exec() function - All "exec"-like functions merged into a single generic function - more information here
2.26 LDAP module
- StartTLS support introduced. For example configurations, please refer to the new parameter documentation
2.27 LOAD_BALANCER module
- Added a new event to be triggered when the state of a gateway is changed (either from MI or via probing triggered from script). More information here ...
- Rework of how the LB session is controlled (start, resume, stop) from script:
- new lb_start(), strictly used to start LB session. if sessions already started, old session will be lost and re-started again.
- new lb_next(), continues an existing LB session (working as load_balance() from failure route - to do failover)
- lb_start_and_next() - is simply a shorthand for 'lb_is_started()?lb_next():lb_start()' to simplify scripting. This function logically almost the same as old load_balance() function.
- new lb_reset() to stop a current LB session
- new lb_is_started() to check if there is any ongoing LB session
- the LB process (when started) takes one more flag to enable usage of destination with negative availability (exceeded capacity); do not ignore resources with negative availability, and thus able to select for load balancing destinations with exceeded capacity. This might be needed in scenarios where we want to limit generic calls volume and always pass important/high-priority calls.
- lb_count_call() - can take negative values, to revert a previous lb_count_call() action
2.28 MI_FIFO module
- Reworked the FIFO handling - added support for detecting if the FIFO file gets deleted (for re-creating it), and also added SIGHUP signal handling for re-creating and re-opening of the FIFO file.
2.29 MI_JSON module
- Rework of how the Json string is build in order to properly accommodate arrays - in many MI answers, OpenSIPS returns arrays - and these arrays need to be properly translated from internal MI structure to the json format.
2.30 MSILO module
- Added support for external body - the MESSAGE has no actual body, but the Content-Type hdr refers to an external body by an HTTP link.
- Added support for limiting the number of SIP MESSAGES that will be dumped in one shot ( in order to not overload the client )
2.31 NATHELPER module
- Ambiguous "oldmediaip" SDP attributes replaced with "oldcip" and "oldoip" (a5900b5)
2.32 PRESENCE module
- New end_sub_on_timeout module parameter - If a presence subscription should be automatically terminated (destroyed) when receiving a SIP timeout (408) for a sent NOTIFY requests.
- A new E_PRESENCE_PUBLISH event has been added that is triggered every time OpenSIPS receives a PUBLISH message. Read more here ...
2.33 SIPMSGOPS module
- The sipmsg_validate function can now be used to check the From, To and Contact headers. More information here...
- All the Codec related functions accepting regexps can now also accept pseudovariables containing the regex - allowing for fetching the REGEXPs from various sources ( eg. Database ). Read more here ...
2.34 SIPTRACE module
- Split the fromip and toip DB columns ( which previously contained IP & port ) into two separate columns containing IP and port - thus allowing for faster database searches based on IPs.
2.35 REST_CLIENT module
- rest_get() and rest_post() may now be used asynchronously. A usage example can be found in the module documentation.
- when using rest_post(), you may omit the "send_content_type" parameter. It will default to "application/x-www-form-urlencoded"
2.36 RTPPROXY module
- rtpproxy_enable MI command : optional set_id param added (28a974b)
2.37 UAC module
- When using the uac_auth() for having OpenSIPS do SIP authentication, the CSEQ number will be increased for subsequent authentication requests - thus fixing various downstream issues (e.g. Asterisk treating the AUTH request as a retransmission due to the same CSEQ number).
2.38 USRLOC module
- Added per contact events - raised when a new contact is inserted / updated / deleted. Read more here ...
- Added User-Agent filtering capabilities for lookup() - so you can now send calls just to particular UAs, if you need to