User Tools

Site Tools


install:upgrade:3.2.x-to-3.3.0

This is an old revision of the document!


Upgrade Kamailio from v3.2.x to v3.3.0 (unreleased)

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

Database Structure

These sections presents notes, listed by modules, about the structure of database tables that existed in v3.2.x and changed during development of v3.3.0.

modules_k/dialog

  • table dialog
    • table version is 7
    • new columns:
      • iflags INT(10) UNSIGNED DEFAULT 0 NOT NULL
      • xdata VARCHAR(512)
    • column definition changes:
      • caller_cseq VARCHAR(20) NOT NULL
      • callee_cseq VARCHAR(20) NOT NULL

modules_k/domain

  • new table domain_attrs
  • table domain
    • new column did

modules/lcr

  • table lcr_gw
    • ip_addr column has now the size varchar(47)

modules_k/msilo

  • table silo
    • table version is 6
    • new columns:
      • extra_hdrs TEXT DEFAULT ' ' NOT NULL

modules/mtree

  • table mtrees
    • table version is 2
    • definition changes:
      • drop: CONSTRAINT tname_tprefix_idx UNIQUE (tname, tprefix)
      • add: CONSTRAINT tname_tprefix_tvalue_idx UNIQUE (tname, tprefix, tvalue)

modules_k/permissions

  • table address
    • table version is 5
    • column definition changes:
      • grp INT(11) UNSIGNED DEFAULT 1 NOT NULL
      • ip_addr VARCHAR(48) NOT NULL
      • mask INT DEFAULT 32 NOT NULL

modules_k/usrloc

  • table aliases
    • table version is 5
    • new columns:
      • ruid VARCHAR(64) DEFAULT NOT NULL * instance VARCHAR(255) DEFAULT NULL * table location * table version is 5 * new columns: * ruid VARCHAR(64) DEFAULT NOT NULL
      • instance VARCHAR(255) DEFAULT NULL

SQL Commands

You can use next SQL commands (made for MySQL) to update the structure of existing tables in v3.2.x for v3.3.0:

-- DIALOG
ALTER TABLE dialog ADD iflags INT(10) UNSIGNED DEFAULT 0 NOT NULL;
ALTER TABLE dialog ADD xdata VARCHAR(512);
ALTER TABLE dialog MODIFY caller_cseq VARCHAR(20) NOT NULL;
ALTER TABLE dialog MODIFY callee_cseq VARCHAR(20) NOT NULL;
UPDATE version SET table_version=7 WHERE TABLE_NAME='dialog';
 
-- DOMAIN
ALTER TABLE DOMAIN ADD did VARCHAR(64) DEFAULT NULL;
UPDATE version SET table_version=2 WHERE TABLE_NAME='domain';
 
CREATE TABLE domain_attrs (
    id INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
    did VARCHAR(64) NOT NULL,
    name VARCHAR(32) NOT NULL,
    TYPE INT UNSIGNED NOT NULL,
    VALUE VARCHAR(255) NOT NULL,
    last_modified DATETIME DEFAULT '1900-01-01 00:00:01' NOT NULL,
    CONSTRAINT domain_attrs_idx UNIQUE (did, name, VALUE)
) ENGINE=MyISAM;
INSERT INTO version (TABLE_NAME, table_version) VALUES ('domain_attrs','1');
 
-- LCR
ALTER TABLE lcr_gw MODIFY ip_addr VARCHAR(47) NOT NULL;
 
-- MSILO
ALTER TABLE silo ADD extra_hdrs TEXT DEFAULT '' NOT NULL;
UPDATE version SET table_version=6 WHERE TABLE_NAME='silo';
 
-- MTREE
 
ALTER TABLE mtrees ADD CONSTRAINT tname_tprefix_idx UNIQUE (tname, tprefix);
ALTER TABLE mtrees DROP CONSTRAINT tname_tprefix_tvalue_idx UNIQUE (tname, tprefix, tvalue);
UPDATE version SET table_version=2 WHERE TABLE_NAME='mtrees';
 
-- PERMISSIONS
ALTER TABLE address MODIFY grp INT(11) UNSIGNED DEFAULT 1 NOT NULL
ALTER TABLE address MODIFY ip_addr VARCHAR(48) NOT NULL
ALTER TABLE address MODIFY mask INT DEFAULT 32 NOT NULL
UPDATE version SET table_version=5 WHERE TABLE_NAME='address';
 
-- USRLOC
ALTER TABLE aliases ADD ruid VARCHAR(64) DEFAULT '' NOT NULL;
ALTER TABLE aliases ADD instance VARCHAR(255) DEFAULT NULL;
UPDATE version SET table_version=2 WHERE TABLE_NAME='aliases';
 
ALTER TABLE location ADD ruid VARCHAR(64) DEFAULT '' NOT NULL;
ALTER TABLE location ADD instance VARCHAR(255) DEFAULT NULL;
UPDATE version SET table_version=2 WHERE TABLE_NAME='location';

This is the translation of the above script for PostgreSQL (should work with 9.1.1, but is untested!)

ALTER TABLE lcr_gw ALTER COLUMN ip_addr TYPE VARCHAR(47);

Modules

modules/your-module-here

  • Add changes or additions reflected in kamailio config syntax here.
install/upgrade/3.2.x-to-3.3.0.1334567899.txt.gz · Last modified: 2012/04/16 11:18 by miconda