Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
install:1.5.x-to-3.0.0 [2011/05/17 19:45] – [Migrating Kamailio v1.5.x to Kamailio v3.0.0] 212.186.162.9 | install:1.5.x-to-3.0.0 [2011/09/07 14:32] (current) – deleted spam link 212.227.35.137 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Migrating Kamailio v1.5.x to Kamailio v3.0.0 ====== | ||
+ | |||
+ | Note: This is not a full list. There are much more changes than stated in this document. | ||
+ | E.g. haven' | ||
+ | ... http:// | ||
+ | |||
+ | |||
+ | ===== Changes in core ===== | ||
+ | |||
+ | * Kamailio 3.0.0 is first release that uses the core of http:// | ||
+ | |||
+ | * **IMPORTANT** put next line first in your config file | ||
+ | <code c> | ||
+ | #!KAMAILIO | ||
+ | </ | ||
+ | * run in Kamailio config compatibility mode | ||
+ | * auto-correct TM parameter timer values: in 3.0 they are in mili-seconds, | ||
+ | * accept TM avp parameters in K-style: $avp(name) | ||
+ | |||
+ | ===== Changes in modules ===== | ||
+ | |||
+ | * Kamailio 3.0.0 is first release that uses the TM module of http:// | ||
+ | * **kex** and **tmx** modules must be loaded -- they provide functionalities existing in core or tm of Kamailio 1.5.x | ||
+ | |||
+ | ===== Changes in database schema ===== | ||
+ | |||
+ | ==== LCR ==== | ||
+ | |||
+ | * table **lcr** has one new column (table version is 3): | ||
+ | * lcr_id SMALLINT UNSIGNED NOT NULL | ||
+ | |||
+ | * table **gw** has two new columns and one column removed (table version is 10): | ||
+ | * lcr_id SMALLINT UNSIGNED NOT NULL | ||
+ | * defunct INT UNSIGNED DEFAULT NULL | ||
+ | * ping column has been removed | ||
+ | |||
+ | ==== Dialog ==== | ||
+ | |||
+ | * table **dialog** has one new column (table version is 4): | ||
+ | * req_uri VARCHAR(128) NOT NULL | ||
+ | |||
+ | ==== Permissions ==== | ||
+ | |||
+ | * table **trusted** has one column definition updated (table version is 5): | ||
+ | * tag VARCHAR(64) | ||
+ | |||
+ | ====== Tips for migration to Kamailio 3.0.0 ====== | ||
+ | |||
+ | 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. | ||
+ | |||
+ | ===== TCP Connection Lifetime ===== | ||
+ | |||
+ | * **registrar** module in Kamailio 1.5.x has support to set automatically the lifetime of the TCP connection for current processed SIP REGISTER message. | ||
+ | * in **3.0.0** similar functionality can be achieved by setting **tcp_connection_lifetime** config parameters just a bit higher than max registration expire. The lifetime for a TCP connection is automatically extended when a message is going through. In case of hard/soft phones, the connection is closed by client side when they shut down. | ||
+ | |||
+ | ===== Log levels ===== | ||
+ | |||
+ | * the logging in kamailio 3.0.0 uses different values for each level. You can get the corresponding level by simple subtracting " | ||
+ | |||
+ | ===== Module loading ===== | ||
+ | |||
+ | * The mpath statement is also available in kamailio 3.0.0, being an alias to loadpath parameter. In addition, you can omit the " | ||
+ | |||
+ | http:// | ||
+ | |||
+ | ===== Branch Flags Operations ===== | ||
+ | |||
+ | * functions are implemented now by kex module. The parameters must be enclosed in double quotes and they can be pseudo-variables with integer values: | ||
+ | |||
+ | http:// | ||
+ | |||
+ | ===== Script Flags Operations ===== | ||
+ | |||
+ | * functions are implemented now by kex module. The parameters must be enclosed in double quotes and they can be pseudo-variables with integer values: | ||
+ | |||
+ | http:// | ||
+ | |||
+ | ===== Dst URI Operations ===== | ||
+ | |||
+ | * functions **setdsturi(uri), | ||
+ | |||
+ | http:// | ||
+ | |||
+ | ===== TM Extensions ===== | ||
+ | |||
+ | * several TM extensions are now part of TMX module | ||
+ | |||
+ | http:// | ||
+ | |||
+ | ===== Core parameters ===== | ||
+ | |||
+ | * [b]avp_aliases[/ | ||
+ | |||
+ | http:// | ||
+ | |||
+ | * [b]disable_dns_blacklist[/ | ||
+ | |||
+ | http:// | ||
+ | |||
+ | * [b]disable_dns_failover[/ | ||
+ | |||
+ | By default, [b]use_dns_failover[/ | ||
+ | |||
+ | ===== Core Functions ===== | ||
+ | |||
+ | * [b]append_branch()[/ | ||
+ | * http:// | ||
+ | * note: there is still a core function still called [b]append_branch()[/ | ||
+ | * [b]km_append_branch()[/ | ||
+ | |||
+ | ===== Script syntax ===== | ||
+ | |||
+ | ==== Test operator [...] ==== | ||
+ | |||
+ | * [b]test operator [...][/b] is does not exist. Same operation is supported directly in conditional expressions. | ||
+ | |||
+ | Bit tests must be written in conditions without brackets [ and ], for example, | ||
+ | |||
+ | <code c> | ||
+ | if ($var(a) & 4) | ||
+ | log(" | ||
+ | </ | ||
+ | |||
+ | ==== Operator := ==== | ||
+ | |||
+ | * [b]:=[/b] used in Kamailio 1.5.x for AVPs - delete all then add - is not available in Kamailio 3.0.0. Same functionality is given by assignment when providing index ' | ||
+ | |||
+ | <code c> | ||
+ | # Kamailio 1.5.x: $avp(abc) := ' | ||
+ | | ||
+ | |||
+ | # Kamailio 1.5.x: $avp(abc) := null; | ||
+ | | ||
+ | </ | ||
+ | |||
+ | ==== Modulo % ==== | ||
+ | |||
+ | * [b]%[/b] must be replaced wit [b]mod[/b] ([b]%[/b] conflicted with [b]selects[/ | ||
+ | |||
+ | |||
+ | <code c> | ||
+ | $var(x) = $var(y) mod 5; | ||
+ | </ | ||
+ | ===== Module parameters ===== | ||
+ | |||
+ | * [b]tm onreply_avp_mode[/ | ||
+ | |||
+ | 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, | ||
+ | |||
+ | |||
+ | |||
+ | * [b]tm fr_timer, fr_inv_timer, | ||
+ | |||
+ | In Kamailio 3.0.0, time value of the above parameters is given in milliseconds, | ||
+ | |||
+ | * [b]sl_send_reply[/ | ||
+ | |||
+ | 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 | ||
+ | <code c> | ||
+ | $avp(s: | ||
+ | sl_send_reply(" | ||
+ | </ | ||
+ | But after 3.x Kamailio will tell you "Could not convert PV to int" in this case. Some possible workarounds are: | ||
+ | <code c> | ||
+ | $avp(s: | ||
+ | </ | ||
+ | or: | ||
+ | <code c> | ||
+ | $avp(s: | ||
+ | </ | ||
+ | |||
+ | ===== Module functions ===== | ||
+ | |||
+ | ==== t_relay ==== | ||
+ | |||
+ | * [b]t_relay()[/ | ||
+ | |||
+ | 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, | ||
+ | |||
+ | Examples: | ||
+ | |||
+ | ^ 1.5.x ^ 3.0.0 ^ | ||
+ | | t_relay() | t_relay() | | ||
+ | | t_relay(" | ||
+ | | t_relay(" | ||
+ | | t_relay(" | ||
+ | |||
+ | |||
+ | |||
+ | * [b]t_relay()[/ | ||
+ | |||
+ | Module parameter " | ||
+ | |||
+ | Core parameter " | ||
+ | |||
+ | * [b]t_relay()[/ | ||
+ | |||
+ | ==== t_was_cancelled ==== | ||
+ | |||
+ | * [b]t_was_cancelled()[/ | ||
+ | |||
+ | ==== t_check_trans ==== | ||
+ | |||
+ | * [b]t_check_trans()[/ | ||
+ | |||
+ | See http:// | ||
+ | |||
+ | ---- | ||
+ | |||
+ | 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). | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Route blocks ===== | ||
+ | |||
+ | * [b]error_route[/ | ||
+ | |||
+ | Check request sanity at the beginning of script (see sanity module). | ||
+ | |||
+ | ===== null keyword ===== | ||
+ | |||
+ | **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. | ||
+ | |||
+ | <code c> | ||
+ | if( ! defined $avp(x) ) { | ||
+ | # the avp is null | ||
+ | ... | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ===== not operator in if() ===== | ||
+ | |||
+ | if (!$fd=~" | ||
+ | |||
+ | |||
+ | Notice: the operator [b]!~[/b] seems not to be working for some reason as well. | ||
+ | e.g.: ($fd !~ 'not this') must be replaced with !($fd =~ 'not this') | ||
+ | |||
+ | ===== empty tree ===== | ||
+ | |||
+ | Some empty { } section are not possible anymore. E.g. | ||
+ | < | ||
+ | if (expr) { | ||
+ | | ||
+ | } else if (expr) { | ||
+ | # do nothing in this case | ||
+ | } else if (expr) { | ||
+ | | ||
+ | } else { | ||
+ | | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | gives a syntax error in the line behind the comment for whatever reason. | ||
+ | |||
+ | |||