User Tools

Site Tools


install:upgrade:4.0.x-to-4.1.0

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
install:upgrade:4.0.x-to-4.1.0 [2013/11/04 12:15]
miconda [MySQL - Updates to old database tables]
install:upgrade:4.0.x-to-4.1.0 [2013/12/06 11:25] (current)
miconda [Behaviour]
Line 65: Line 65:
 ) ENGINE=InnoDB DEFAULT CHARSET=latin1; ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
 +INSERT INTO version (table_name, table_version) values ('rtpproxy','1');
 +CREATE TABLE rtpproxy (
 +    id INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
 +    setid VARCHAR(32) DEFAULT 00 NOT NULL,
 +    url VARCHAR(64) DEFAULT '' NOT NULL,
 +    flags INT DEFAULT 0 NOT NULL,
 +    weight INT DEFAULT 1 NOT NULL,
 +    description VARCHAR(64) DEFAULT '' NOT NULL
 +);
 </code> </code>
  
Line 134: Line 143:
  
   * **syn_branch** has been removed - core acts now always as syn_branch=0 - the Via header branch value is computed based on transaction attributes   * **syn_branch** has been removed - core acts now always as syn_branch=0 - the Via header branch value is computed based on transaction attributes
 +  * **dns_naptr_ignore_rfc** has been added. Specifies if the Order field in a NAPTR record should be respected. Old code, and still default, is to ignore.
 +
 +==== Behaviour ====
 +
 +=== Comparison with $null ===
 +
 +In short
 +  * now: if($var(a)==$null) is always false
 +  * previous: if($var(a)==$null) was true if $var(a) had the value 0
 +
 +**//Details//**
 +
 +**$null** is a special variable that was meant to test if a variable is defined or not (exists or not). It was introduced during Kamailio 1.x series (OpenSER at that time).
 +
 +For example:
 +
 +<code c>
 +if($avp(x)==$null)
 +</code>
 +
 +Should return true if there was no value assigned to $avp(x).
 +
 +However, some variables are defined always (eventually initialized to 0), such as $var(a) or $shv(b).
 +
 +Starting with v3.0.0 when the core from Kamailio point of view was refactored, as part of integration with SER, the comparison with $null mistakenly became the same as comparison with integer 0 (zero).
 +
 +Some of the comparisons kept working, but some gave wrong result:
 +
 +<code c>
 +$avp(x)=0;
 +if($avp(x)==$null)
 +</code>
 +
 +was true, but actually $avp(x) was defined, having value 0.
 +
 +Issue was reported on:
 +  * https://sip-router.org/tracker/index.php?do=details&task_id=358&project=1
 +
 +
 +**//Solution//**
 +
 +Don't compare $var(...) and $shv(...) with $null, they are always defined and initialized to 0. You can eventually compare them with 0 (instead of $null).
 +
 +
install/upgrade/4.0.x-to-4.1.0.1383563731.txt.gz ยท Last modified: 2013/11/04 12:15 by miconda