Note: This is not a full list. There are much more changes than stated in this document. E.g. haven't found the change for memlog=0 yet … … http://www.kamailio.org/dokuwiki/doku.php/core-cookbook:3.1.x?s[]=memlog#memlog
* Kamailio 3.0.0 is first release that uses the core of http://sip-router.org project
* IMPORTANT put next line first in your config file
#!KAMAILIO
* Kamailio 3.0.0 is first release that uses the TM module of http://sip-router.org project * kex and tmx modules must be loaded – they provide functionalities existing in core or tm of Kamailio 1.5.x
The section collects tips to migrate Kamailio 1.5.x to 3.0.0 in order to get as much compatibility and functionality as possible. There are Kamailio 1.5.x functions that do not exist in Kamailio 3.0.0, but alternatives are available to get more or less same behaviour.
http://www.kamailio.org/dokuwiki/doku.php/core-cookbook:3.0.x#loadpath
http://kamailio.org/docs/modules/3.0.x/modules_k/pv.html
http://www.kamailio.org/dokuwiki/doku.php/core-cookbook:3.0.x#dns_cache_negative_ttl
By default, use_dns_failover is currently “off”.
Bit tests must be written in conditions without brackets [ and ], for example,
if ($var(a) & 4) log("var a has third bit set\n");
# Kamailio 1.5.x: $avp(abc) := 'xyz'; $(avp(abc)[*]) = 'xyz'; # Kamailio 1.5.x: $avp(abc) := null; $(avp(abc)[*]) = $null;
$var(x) = $var(y) mod 5;
In Kamailio 3.0.0, AVPs that are set in request route are always visible in branch, TM-reply and failure routes. If you set AVPS in an onreply_route, they are also visible after execution of this onreply_route.
In Kamailio 3.0.0, time value of the above parameters is given in milliseconds, whereas in Kamailio 1.5.x they are given in seconds (see tm timers for more details).
In Kamailio 3.x, if you use an AVP for the code parameter (first one), make sure to assign it an integer value. Example: old versions would accept these statements
$avp(s:example) = "404"; sl_send_reply("$avp(s:example)", "Some Reason");
But after 3.x Kamailio will tell you “Could not convert PV to int” in this case. Some possible workarounds are:
$avp(s:example) = 404;
or:
$avp(s:example) = (int) $avp(s:example);
Translations:
1.5.x | 3.0.0 |
---|---|
t_relay() | t_relay() |
t_relay(proxy) | t_relay_to(proxy) |
t_relay(flags) | t_relay_to(flags) |
t_relay(proxy, flags) | t_relay_to(proxy, flags) |
Examples:
1.5.x | 3.0.0 |
---|---|
t_relay() | t_relay() |
t_relay(“udp:1.2.3.4”) | t_relay_to(“udp:1.2.3.4”) |
t_relay(“0x01”) | t_relay_to(“0x01”) |
t_relay(“udp:1.2.3.4”, “0x01”) | t_relay_to(“udp:1.2.3.4”, “0x01”) |
Module parameter “auto_inv_100” can be used to globally turn off generation of provisional replies (default is 1 “on”). It is also possible to dynamically control generation of provisional replies using function t_set_auto_inv_100().
Core parameter “use_dns_failover” can be used to globally turn off DNS failover (default is “off”).
See http://sip-router.org/docbook/sip-router/branch/3.1/modules/tm/tm.html#t_check_trans
Note that the e2e ACK matching is more of a hint then a certainty. A delayed e2e ACK might arrive after the transaction wait time elapses, when the INVITE transaction no longer exists and thus would not match anything. There are also cases when tm would not keep all the information needed for e2e ACK matching (since this is not needed for a statefull proxy and it requires additional memory, tm will not keep this information unless needed by some other module or callbacks).
Check request sanity at the beginning of script (see sanity module).
null keyword is not present in Kamailio 3.0.0. Use pseudo-variable $null instead.
In addition, the operator defined can be used to check if a value is null or not.
if( ! defined $avp(x) ) { # the avp is null ... }
if (!$fd=~“regexp”) must now be written as if (!($fd=~“regexp”)) for what reason ever.
Notice: the operator !~ seems not to be working for some reason as well. e.g.: ($fd !~ 'not this') must be replaced with !($fd =~ 'not this')
Some empty { } section are not possible anymore. E.g.
if (expr) { setflag(1); } else if (expr) { # do nothing in this case } else if (expr) { setflag(2); } else { setflag(3); }
gives a syntax error in the line behind the comment for whatever reason.