From openSIPS

Documentation: Migration-2-4-0-to-3-0-0

Documentation -> Migration -> Migration from 2.4.x to 3.0.0

This page has been visited 14157 times.

Table of Contents (hide)

  1. 1. DB migration
  2. 2. Script migration
    1. 2.1 Global Parameters
    2. 2.2 Module functions
    3. 2.3 AUTH_AAA module
    4. 2.4 AVPOPS module
    5. 2.5 DB_MYSQL module
    6. 2.6 CLUSTERER module
    7. 2.7 DIALOG module
    8. 2.8 DIALPLAN module
    9. 2.9 DISPATCHER module
    10. 2.10 DROUTING module
    11. 2.11 ENUM module
    12. 2.12 EVENT_ROUTE module
    13. 2.13 LOAD_BALANCER module
    14. 2.14 MI_HTTP module
    15. 2.15 MI_JSON module
    16. 2.16 PERMISSIONS module
    17. 2.17 PRESENCE module
    18. 2.18 REST_CLIENT module
    19. 2.19 SIPMSGOPS module
    20. 2.20 SIPCAPTURE module
    21. 2.21 SIPTRACE module
    22. 2.22 TLS_MGM module
    23. 2.23 UAC module
    24. 2.24 UAC_REDIRECT module
    25. 2.25 URI module (dropped)

This section is meant to provide useful help in migrating your OpenSIPS installations from the 2.4.0 version to 3.0.0.

You can find the all the new additions in the 3.0.0 release compiled under this page. The ChangeLog may help your understanding of the migration / update process.

Make sure you don't have any Makefile.conf files in your sources' root before starting the migration. The configuration file generated by 'menuconfig is not compatible with the one in older version!


1.  DB migration

You can migrate your 2.4.x MySQL DB to the 3.0.x format by using the opensips-cli tool :

   # opensips-cli -x database migrate 2.4_to_3.0 opensips_2_4 opensips_3_0

where :

See the opensips-cli documentation for more details.

NOTE:

NOTE that the migration tool is available only for MYSQL databases!

NOTE that the default MySQL DB engine is now InnoDB!


2.  Script migration

The following is the full list of backwards-incompatible syntax or functional changes in the OpenSIPS configuration script (some of them are fixes):

2.1  Global Parameters

2.2  Module functions

Remove quotes

As a result of the enhancement of the interface for module functions (for generic support of script variables in the parameters), some parameters will have be passed without quotes (like if they are numerical values or returning variables).

For example:

send_reply( "200", "OK");

is now

send_reply( 200, "OK");

as the first parameter requires a numerical value.

Also :

check_source_address( "4", "$avp(ctx)");

is now

check_source_address( 4, $avp(ctx));

as the first parameter requires a numerical value and the second one requires a returning variable.

Escape "$" characters in plain-text strings

Since all OpenSIPS strings which get passed to functions have become format strings in 3.0, each singular "$" sign must be escaped using its "$$" form, otherwise the parser will expect a variable over there!

For example:

avp_subst("$avp(sdp_ip)", "/^c=IN IP[46] (.*)$/\1/"); 

becomes:

avp_subst("$avp(sdp_ip)", "/^c=IN IP[46] (.*)$$/\1/"); 
Other function-related issues

There are many changes as the ones listed above. IF during the startup, while the config file is parsed to get an error like:

 ERROR:core:fix_cmd: Param [n] expected to be an integer or variable
 ERROR:core:fix_actions: Failed to fix command <name_of_function>

it means the n-th parameter of the module function name_of_function changed from string type to integer or variable type.

To do the translation to the right type of parameter, check the documentation of faulty function - there you can find the required type for each parameter. If you have doubts how to pass the certain parameters (depending on their type), please check this documentation.

2.3  AUTH_AAA module

2.4  AVPOPS module

2.5  DB_MYSQL module

2.6  CLUSTERER module

2.7  DIALOG module

2.8  DIALPLAN module

2.9  DISPATCHER module

2.10  DROUTING module

2.11  ENUM module

2.12  EVENT_ROUTE module

# route used in OpenSIPS 2.4
event_route[E_PIKE_BLOCKED] {
	fetch_event_params("ip=$avp(pike-ip)");
	xlog("IP $avp(pike-ip) has been blocked\n");
}

# route used in OpenSIPS 3.0
event_route[E_PIKE_BLOCKED] {
	xlog("IP $param(ip) has been blocked\n");
}

2.13  LOAD_BALANCER module

2.14  MI_HTTP module

2.15  MI_JSON module

2.16  PERMISSIONS module

2.17  PRESENCE module

2.18  REST_CLIENT module

2.19  SIPMSGOPS module

2.20  SIPCAPTURE module

2.21  SIPTRACE module

2.22  TLS_MGM module

2.23  UAC module

2.24  UAC_REDIRECT module

2.25  URI module (dropped)

Retrieved from https://www.opensips.org/Documentation/Migration-2-4-0-to-3-0-0
Page last modified on May 04, 2021, at 11:48 AM