Migration from 3.0.x to 3.1.0
This section is meant to provide useful help in migrating your OpenSIPS installations from the 3.0.0 version to 3.1.0.
You can find the all the new additions in the 3.1.0 release compiled under this page. The ChangeLog may help your understanding of the migration / update process.
DB migration
Section titled “DB migration”You can migrate your 3.0.x MySQL DB to the 3.1.x format using the opensips-cli tool :
$ opensips-cli -x database migrate 3.0_to_3.1 opensips_3_0 opensips_3_1where :
- opensips_3_0 is the existing DB name corresponding to version 3.0.x format
- opensips_3_1 is the DB name to be created for 3.1.x format
See the opensips-cli documentation for more details.
Script migration
Section titled “Script migration”The following is the full list of backwards-incompatible syntax or functional changes in the OpenSIPS configuration script:
- the listen parameter was renamed as socket parameter, with the same definition and behavior.
- the tcp_listen_backlog parameter was renamed as tcp_socket_backlog parameter, with the same definition and behavior.
- script variable
$fsto be replaced with$socket_out - script variable
$Rito be replaced with$socket_in(ip) - script variable
$Rpto be replaced with$socket_in(port) - script variable
$afto be replaced with$socket_in(af) - script variables
$proto/$prto be replaced with$socket_in(proto)
Global Parameters
Section titled “Global Parameters”- the auto_aliases is now by default off, so if you had no setting of it in the old script you should set it explicitly to “on” to keep the same behavior.
Core functions
Section titled “Core functions”- The following alias names were dropped:
- rewritehost() for sethost()
- rewritehostport() for sethostport()
- rewriteuser() for setuser()
- rewriteuserpass() for setuserpass()
- rewriteport() for setport()
- rewriteuri() for seturi()
- cache_raw_query()‘s last parameter is now an unquoted variable
- construct_uri()‘s user, port and extra are now optional parameters
- isflagset()‘s, resetflag()‘s and setflag()‘s parameter is now a quoted string
- isbflagset()‘s, resetbflagset()‘s and setbflagset()‘s flag parameter is now a quoted string
- the order of isbflagset()‘s, resetbflagset()‘s and setbflagset()‘s flag and branch_idx parameters has been inverted
- raise_event()‘s third parameter should now be always provided if you want the raised event to include attributes (eg.
raise_event("E_MY_EVENT", $avp(attr-val))calls should be replaced withraise_event("E_MY_EVENT", , $avp(attr-val))calls) - the migration requirements caused by the the changes in the core functions parameter interface have been described above; nevertheless you can also check the 2-4 to 3-0 module functions migration guidelines described here as the changes are similar.
Module migration
Section titled “Module migration”AUTH module
Section titled “AUTH module”- the “qop” parameter of the www_challenge() and proxy_challenge() functions is now optional and accepts the values:
auth,auth-intor both (separated by ’,’).
B2B_ENTITIES module
Section titled “B2B_ENTITIES module”- dropped the replication_mode module parameter.
DIALOG module
Section titled “DIALOG module”- the
$DLG_didformat has been changed from printing theentry:idof the dialog tohex(entry).hex(id), just as the Record-Route parameter is added - the dlg_list MI command no longer outputs the DB id as the ID of the dialog, but a
hex(entry).hex(id)representation of its id. The DB id field has been moved in the db_id node. - the dlg_end_dlg MI command no longer receives the DB id as an identifier for finding the dialog to terminate, but the same
hex(entry).hex(id)printed by the$DLG_didvariable and by the dlg_list command.
DROUTING module
Section titled “DROUTING module”- the carrier flags have shifted as seen below. This breaks the code of any provisioning UIs written for OpenSIPS 3.0 which are using the old flags (e.g. OpenSIPS Control Panel 8.3.0).
- WEIGHT_ROUTING (removed, replaced by the new sort_alg column)
- USE_FIRST_GW (2 -> 1)
- DISABLED (4 -> 2)
- DIRTY (8 -> 4)
- the “W” flag of do_routing() has been removed in favour of specifying it via the database (specifically, the dr_rules.sort_alg column). If you were using weight-based routing before, you need to update all of your dr_rules to use the “W” sorting algorithm instead of “N” (“None”, the current default).
EVENT_DATAGRAM module
Section titled “EVENT_DATAGRAM module”- The event payload is now formated as a JSON-RPC notification instead of the custom OpenSIPS line oriented formatting, so you have to change the parsing of the event in your external applications.
EVENT_JSONRPC module
Section titled “EVENT_JSONRPC module”- the event_jsonrpc module has been renamed to event_stream. you have to replace your
modparam("event_jsonrpc"...lines withmodparam("event_stream"...lines - the transport protocol token from the event socket has been changed from
jsonrpctotcp(for example, you have to usetcp:127.0.0.1:8080/block_ipinstead ofjsonrpc:127.0.0.1:8080/block_ip).
EVENT_RABBITMQ module
Section titled “EVENT_RABBITMQ module”- The event payload is now formated as a JSON-RPC notification instead of the custom OpenSIPS line oriented formatting, so you have to change the parsing of the event in your external applications.
PRESENCE module
Section titled “PRESENCE module”- switch to string values instead of integers for the cluster_federation_mode module parameter (
disabledinstead of0andon-demand-sharinginstead of1) - the server_address module parameter has been dropped - its functionality was replaced by the new contact_user parameter.
PROTO_TLS module
Section titled “PROTO_TLS module”- the tls_handshake_timeout and tls_send_timeout parameters have been moved from the tls_mgm module to the proto_tls module. Check out the new documentation here]. To migrate your script, you should replace any of your lines as it follows:
# Before 3.1 was modparam("tls_mgm", "tls_handshake_timeout", 200) modparam("proto_tls", "tls_handshake_timeout", 200) # Before 3.1 was modparam("tls_mgm", "tls_send_timeout", 200) modparam("proto_tls", "tls_send_timeout", 200)PROTO_WSS module
Section titled “PROTO_WSS module”- the
tls_handshake_timeoutandtls_send_timeoutfrom the tls_mgm module have been removed, thus they can no longer be used to tune the proto_wss module. Instead of those parameters, we’ve added thewss_tls_handshake_timeoutandwss_send_timeout, that are now part of the proto_wss module. To migrate your script, you should replace any of your lines as it follows:
# Before 3.1 was modparam("tls_mgm", "tls_handshake_timeout", 200) modparam("proto_wss", "wss_tls_handshake_timeout", 200) # Before 3.1 was modparam("tls_mgm", "tls_send_timeout", 200) modparam("proto_wss", "wss_send_timeout", 200)RLS module
Section titled “RLS module”- the server_address module parameter has been dropped - its functionality was replaced by the new contact_user parameter.
TLS_MGM module
Section titled “TLS_MGM module”- the default
tls_methodhas been changed fromSSLv23toTLSv1_2. Therefore if you were not setting thetls_methodparameter in your script, you will now have to explicitly set it:modparam("tls_mgm", "tls_method", "[default]SSLv23")
TM module
Section titled “TM module”- fr_timer and fr_inv_timer are now completely removed (not just deprecated). Use fr_timeout and fr_inv_timeout instead!