User Tools

Site Tools


install:upgrade:4.0.x-to-4.1.0

Upgrade Kamailio from v4.0.x to v4.1.0

The page contains the details about the changes that were made to old components during the development of v4.1.0 compared with what existed in v4.0.x. It does not include the brand new modules, focusing on how to upgrade database and configuration file from v4.0.x to run with Kamailio devel.

Previous Stable Release

If you look for the guidelines to upgrade to previous stable release, see:

Modules

These sections presents notes, listed by modules, about changes that need to be made to Kamailio configuration file when upgrading from Kamailio v4.0.x to devel.

TBA

  • short description

Database

MySQL - Updates to old database tables

Next are the SQL statements that must be executed to get the database structure required by modules that existed in v4.0.x.

ALTER TABLE dbaliases DROP INDEX alias_idx; # was UNIQUE (alias_username,alias_domain)
ALTER TABLE dbaliases ADD INDEX alias_idx (alias_username,alias_domain);
ALTER TABLE dbaliases ADD INDEX alias_user_idx (alias_username);
 
INSERT INTO version (TABLE_NAME, table_version) VALUES ('acc_cdrs','1');
CREATE TABLE acc_cdrs (
  id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  start_time VARCHAR(32) NOT NULL DEFAULT '',
  end_time VARCHAR(32) NOT NULL DEFAULT '',
  duration VARCHAR(32) NOT NULL DEFAULT '',
  PRIMARY KEY (id),
  KEY start_time_idx (start_time)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
 
INSERT INTO version (TABLE_NAME, table_version) VALUES ('mohqcalls','1');
CREATE TABLE mohqcalls (
  id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  mohq_id INT(10) UNSIGNED NOT NULL,
  call_id VARCHAR(100) NOT NULL,
  call_status INT(10) UNSIGNED NOT NULL,
  call_from VARCHAR(100) NOT NULL,
  call_contact VARCHAR(100) DEFAULT NULL,
  call_time datetime NOT NULL,
  PRIMARY KEY (id),
  UNIQUE KEY mohqcalls_idx (call_id)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
 
INSERT INTO version (TABLE_NAME, table_version) VALUES ('mohqueues','1');
CREATE TABLE mohqueues (
  id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  name VARCHAR(25) NOT NULL,
  uri VARCHAR(100) NOT NULL,
  mohdir VARCHAR(100) DEFAULT NULL,
  mohfile VARCHAR(100) NOT NULL,
  debug INT(11) NOT NULL,
  PRIMARY KEY (id),
  UNIQUE KEY mohqueue_uri_idx (uri),
  UNIQUE KEY mohqueue_name_idx (name)
) 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
);

The default engine has been set to InnoDB. Not really necessary for most of the tables, but if you want to change it, use following statements:

ALTER TABLE acc ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE active_watchers ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE address ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE aliases ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE carrier_name ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE carrierfailureroute ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE carrierroute ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE cpl ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE dbaliases ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE dialog ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE dialog_vars ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE dialplan ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE dispatcher ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE `domain` ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE domain_attrs ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE domain_name ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE domainpolicy ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE globalblacklist ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE grp ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE htable ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE imc_members ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE imc_rooms ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE lcr_gw ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE lcr_rule ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE lcr_rule_target ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE location ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE location_attrs ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE missed_calls ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE mtree ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE mtrees ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE pdt ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE pl_pipes ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE presentity ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE pua ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE purplemap ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE re_grp ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE rls_presentity ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE rls_watchers ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE sca_subscriptions ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE silo ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE sip_trace ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE speed_dial ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE subscriber ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE `trusted` ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE uacreg ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE uid_credentials ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE uid_domain ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE uid_domain_attrs ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE uid_global_attrs ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE uid_uri ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE uid_uri_attrs ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE uid_user_attrs ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE uri ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE userblacklist ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE usr_preferences ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE version ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE watchers ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE xcap ENGINE=InnoDB DEFAULT CHARSET=latin1; # was ENGINE=MyISAM DEFAULT CHARSET=latin1

Configuration File Language

Core Parameters

  • 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:

if($avp(x)==$null)

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:

$avp(x)=0;
if($avp(x)==$null)

was true, but actually $avp(x) was defined, having value 0.

Issue was reported on:

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.txt · Last modified: 2013/12/06 11:25 by miconda