– Kamailio SIP Server –

Migrating OpenSER v1.2.2 to v1.3.0

This page is dedicated to the differences between versions 1.2.2 and 1.3.0 of OpenSER.

Changes in setup script commands

The database specific setup scripts like openser_postgres.sh or openser_mysql.sh are no
longer available. There are integrated into the openserdbctl command. In order to use
this command the database type must be specified in the openserctlrc config file.

1.2 syntax:

 openser_postgresql.sh create

1.3 syntax:

 openserdbctl create

Changes in Pseudo-variables

1.2 syntax:

 $avp(id[N])
 $hdr(name[N])
 $(Cxy)

1.3 syntax:

 $(avp(id)[N]) 
 $(hdr(name)[N])
 $C(xy) , $(C(xy))

Changes in core behaviour

The IPV6 DNS resolver and the automatic blacklisting are now disabled
per default. If you want to use this feature in 1.3 you must enable it
explicitly. Add this statements to your config file:

 dns_try_ipv6=yes
 disable_dns_blacklist=no

Also, the unix socket support has been moved out of core into the 'mi_datagram' module. The 'unix_sock', 'unix_sock_children', and 'unix_tx_timeout' core parameters need to be migrated to 'modparam's.

Migrating Presence

The presence server has been restructured in version 1.3. To obtain the same functionality as in 1.2.2, two modules should be loaded: presence and presence_xml.
The presence module parameters 'force_active' and 'xcap_table' were moved in presence_xml module. So, if setting these parameters is needed, the following lines:

 modparam("presence", "force_active", 1)
 modparam("presence", "xcap_table", "<your_table_name>")

should be replaced with:

 modparam("presence_xml", "force_active", 1)
 modparam("presence_xml", "xcap_table", "<your_table_name>")

The presence_xml module requires database access, so a db_url should be defined for it also.

modparam("presence_xml", "db_url", "mysql://openser:openserrw@domain/openser")

The database tables have new structure. To update them, follow the next instructions:

  • stop openser
  • login to your mysql server with mysql client, connect to “openser” database and execute:
drop table presentity;
DELETE FROM version WHERE table_name='presentity';
INSERT INTO version (table_name, table_version) values ('presentity','2');
CREATE TABLE presentity (
    id INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
    username VARCHAR(64) NOT NULL,
    domain VARCHAR(64) NOT NULL,
    event VARCHAR(64) NOT NULL,
    etag VARCHAR(64) NOT NULL,
    expires INT(11) NOT NULL,
    received_time INT(11) NOT NULL,
    body BLOB NOT NULL,
    UNIQUE KEY presentity_idx (username, domain, event, etag)
) ENGINE=MyISAM;

drop table active_watchers;
DELETE FROM version WHERE table_name='active_watchers';
INSERT INTO version (table_name, table_version) values ('active_watchers','9');
CREATE TABLE active_watchers (
    id INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
    presentity_uri VARCHAR(128) NOT NULL,
    watcher_username VARCHAR(64) NOT NULL,
    watcher_domain VARCHAR(64) NOT NULL,
    to_user VARCHAR(64) NOT NULL,
    to_domain VARCHAR(64) NOT NULL,
    event VARCHAR(64) NOT NULL DEFAULT 'presence',
    event_id VARCHAR(64),
    to_tag VARCHAR(64) NOT NULL,
    from_tag VARCHAR(64) NOT NULL,
    callid VARCHAR(64) NOT NULL,
    local_cseq INT(11) NOT NULL,
    remote_cseq INT(11) NOT NULL,
    contact VARCHAR(64) NOT NULL,
    record_route TEXT,
    expires INT(11) NOT NULL,
    status INT(11) NOT NULL DEFAULT 2,
    reason VARCHAR(64) NOT NULL,
    version INT(11) NOT NULL DEFAULT 0,
    socket_info VARCHAR(64) NOT NULL,
    local_contact VARCHAR(128) NOT NULL,
    UNIQUE KEY active_watchers_idx (presentity_uri, callid, to_tag, from_tag)
) ENGINE=MyISAM;

drop table watchers;
DELETE FROM version WHERE table_name='watchers';
INSERT INTO version (table_name, table_version) values ('watchers','3');
CREATE TABLE watchers (
    id INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
    presentity_uri VARCHAR(128) NOT NULL,
    watcher_username VARCHAR(64) NOT NULL,
    watcher_domain VARCHAR(64) NOT NULL,
    event VARCHAR(64) NOT NULL DEFAULT 'presence',
    status INT(11) NOT NULL,
    reason VARCHAR(64),
    inserted_time INT(11) NOT NULL,
    UNIQUE KEY watcher_idx (presentity_uri, watcher_username, watcher_domain, event)
) ENGINE=MyISAM;

drop table xcap_xml;
DELETE FROM version WHERE table_name='xcap_xml';
INSERT INTO version (table_name, table_version) values ('xcap','3');
CREATE TABLE xcap (
    id INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
    username VARCHAR(64) NOT NULL,
    domain VARCHAR(64) NOT NULL,
    doc BLOB NOT NULL,
    doc_type INT(11) NOT NULL,
    etag VARCHAR(64) NOT NULL,
    source INT(11) NOT NULL,
    doc_uri VARCHAR(128) NOT NULL,
    port INT(11) NOT NULL,
    UNIQUE KEY account_doc_type_idx (username, domain, doc_type),
    KEY source_idx (source)
) ENGINE=MyISAM;
  • start openser

Modules

LCR

  • need default value for “dm_flag”

modparam(“lcr”, “dm_flag”, 25)

  • gw table within database must be rebuilt
delete from version where table_name='gw';

insert into version values('gw', 5);

CREATE TABLE `gw` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `gw_name` varchar(128) NOT NULL,
  `grp_id` int(10) unsigned NOT NULL,
  `ip_addr` varchar(15) NOT NULL,
  `port` smallint(5) unsigned default NULL,
  `uri_scheme` tinyint(3) unsigned default NULL,
  `transport` tinyint(3) unsigned default NULL,
  `strip` tinyint(3) unsigned default NULL,
  `prefix` varchar(16) default NULL,
  `dm` tinyint(3) unsigned NOT NULL default '1',
  PRIMARY KEY  (`id`),
  UNIQUE KEY `gw_name_idx` (`gw_name`),
  KEY `grp_id_idx` (`grp_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

Permissions, LCR

  • change string argument to valid “avp” string arguments:

change:
modparam(“permissions”, “peer_tag_avp”, “s:peer_uuid”)

to:
modparam(“permissions”, “peer_tag_avp”, “$avp(s:peer_uuid)”)

nathelper

  • rtpproxy_disable module parameter has been removed. Its functionality is taken now by not setting “rtpproxy_sock” parameter.