Kaynağa Gözat

srdb1: updated the definition of siptrace table to include time_us column

- regenerated scripts to create the database schema based on latest xml
  schema definition
Daniel-Constantin Mierla 14 yıl önce
ebeveyn
işleme
1aaf6bc3a2

+ 9 - 2
lib/srdb1/schema/sip_trace.xml

@@ -9,7 +9,7 @@
 
 <table id="sip_trace" xmlns:db="http://docbook.org/ns/docbook">
     <name>sip_trace</name>
-    <version>2</version>
+    <version>3</version>
     <type db="mysql">&MYSQL_TABLE_TYPE;</type>
     <description>
         <db:para>This table is used to store incoming/outgoing SIP messages in database. More informations can be found in the siptrace module documentation at: &KAMAILIO_MOD_DOC;siptrace.html.
@@ -31,7 +31,14 @@
         <type>datetime</type>
         <default>&DEFAULT_DATETIME;</default>
         <default db="oracle">to_date('&DEFAULT_DATETIME;','yyyy-mm-dd hh24:mi:ss')</default>
-        <description>Recording date</description>
+        <description>Time stamp of processing the SIP message</description>
+    </column>
+
+    <column id="time_us">
+        <name>time_us</name>
+        <type>unsigned int</type>
+        <default>0</default>
+        <description>Store the milliseconds part of the time</description>
     </column>
 
     <column id="callid">

+ 2 - 2
utils/kamctl/db_berkeley/kamailio/htable

@@ -1,5 +1,5 @@
 METADATA_COLUMNS
-id(int) key_name(str) key_type(int) value_type(int) key_value(str)
+id(int) key_name(str) key_type(int) value_type(int) key_value(str) expires(str)
 METADATA_KEY
 
 METADATA_READONLY
@@ -7,4 +7,4 @@ METADATA_READONLY
 METADATA_LOGFLAGS
 0
 METADATA_DEFAULTS
-NIL|''|0|0|''
+NIL|''|0|0|''|0

+ 3 - 3
utils/kamctl/db_berkeley/kamailio/sip_trace

@@ -1,10 +1,10 @@
 METADATA_COLUMNS
-id(int) time_stamp(datetime) callid(str) traced_user(str) msg(str) method(str) status(str) fromip(str) toip(str) fromtag(str) direction(str)
+id(int) time_stamp(datetime) time_us(int) callid(str) traced_user(str) msg(str) method(str) status(str) fromip(str) toip(str) fromtag(str) direction(str)
 METADATA_KEY
-2 
+3 
 METADATA_READONLY
 0
 METADATA_LOGFLAGS
 0
 METADATA_DEFAULTS
-NIL|'1900-01-01 00:00:01'|''|''|NIL|''|''|''|''|''|''
+NIL|'1900-01-01 00:00:01'|0|''|''|NIL|''|''|''|''|''|''

+ 4 - 4
utils/kamctl/db_berkeley/kamailio/version

@@ -51,7 +51,7 @@ globalblacklist|1
 grp|
 grp|2
 htable|
-htable|1
+htable|2
 imc_members|
 imc_members|1
 imc_rooms|
@@ -77,19 +77,19 @@ pl_pipes|1
 presentity|
 presentity|3
 pua|
-pua|6
+pua|7
 purplemap|
 purplemap|1
 re_grp|
 re_grp|1
 rls_presentity|
-rls_presentity|0
+rls_presentity|1
 rls_watchers|
 rls_watchers|1
 silo|
 silo|5
 sip_trace|
-sip_trace|2
+sip_trace|3
 speed_dial|
 speed_dial|2
 subscriber|

+ 3 - 2
utils/kamctl/db_sqlite/htable-create.sql

@@ -1,9 +1,10 @@
-INSERT INTO version (table_name, table_version) values ('htable','1');
+INSERT INTO version (table_name, table_version) values ('htable','2');
 CREATE TABLE htable (
     id INTEGER PRIMARY KEY NOT NULL,
     key_name VARCHAR(64) DEFAULT '' NOT NULL,
     key_type INTEGER DEFAULT 0 NOT NULL,
     value_type INTEGER DEFAULT 0 NOT NULL,
-    key_value VARCHAR(128) DEFAULT '' NOT NULL
+    key_value VARCHAR(128) DEFAULT '' NOT NULL,
+    expires VARCHAR DEFAULT 0 NOT NULL
 );
 

+ 0 - 1
utils/kamctl/db_sqlite/pipelimit-create.sql

@@ -6,4 +6,3 @@ CREATE TABLE pl_pipes (
     plimit INTEGER DEFAULT 0 NOT NULL
 );
 
-CREATE INDEX pl_pipes_account_idx ON pl_pipes (

+ 2 - 2
utils/kamctl/db_sqlite/presence-create.sql

@@ -67,7 +67,7 @@ CREATE TABLE xcap (
 
 CREATE INDEX xcap_source_idx ON xcap (source);
 
-INSERT INTO version (table_name, table_version) values ('pua','6');
+INSERT INTO version (table_name, table_version) values ('pua','7');
 CREATE TABLE pua (
     id INTEGER PRIMARY KEY NOT NULL,
     pres_uri VARCHAR(128) NOT NULL,
@@ -79,7 +79,7 @@ CREATE TABLE pua (
     etag VARCHAR(64) NOT NULL,
     tuple_id VARCHAR(64),
     watcher_uri VARCHAR(128) NOT NULL,
-    call_id VARCHAR(128) NOT NULL,
+    call_id VARCHAR(255) NOT NULL,
     to_tag VARCHAR(64) NOT NULL,
     from_tag VARCHAR(64) NOT NULL,
     cseq INTEGER NOT NULL,

+ 2 - 2
utils/kamctl/db_sqlite/rls-create.sql

@@ -1,9 +1,9 @@
-INSERT INTO version (table_name, table_version) values ('rls_presentity','0');
+INSERT INTO version (table_name, table_version) values ('rls_presentity','1');
 CREATE TABLE rls_presentity (
     id INTEGER PRIMARY KEY NOT NULL,
     rlsubs_did VARCHAR(255) NOT NULL,
     resource_uri VARCHAR(128) NOT NULL,
-    content_type VARCHAR(64) NOT NULL,
+    content_type VARCHAR(255) NOT NULL,
     presence_state BYTEA NOT NULL,
     expires INTEGER NOT NULL,
     updated INTEGER NOT NULL,

+ 2 - 1
utils/kamctl/db_sqlite/siptrace-create.sql

@@ -1,7 +1,8 @@
-INSERT INTO version (table_name, table_version) values ('sip_trace','2');
+INSERT INTO version (table_name, table_version) values ('sip_trace','3');
 CREATE TABLE sip_trace (
     id INTEGER PRIMARY KEY NOT NULL,
     time_stamp TIMESTAMP WITHOUT TIME ZONE DEFAULT '1900-01-01 00:00:01' NOT NULL,
+    time_us INTEGER DEFAULT 0 NOT NULL,
     callid VARCHAR(255) DEFAULT '' NOT NULL,
     traced_user VARCHAR(128) DEFAULT '' NOT NULL,
     msg TEXT NOT NULL,

+ 1 - 1
utils/kamctl/dbtext/kamailio/htable

@@ -1 +1 @@
-id(int,auto) key_name(string) key_type(int) value_type(int) key_value(string) 
+id(int,auto) key_name(string) key_type(int) value_type(int) key_value(string) expires(string) 

+ 1 - 1
utils/kamctl/dbtext/kamailio/sip_trace

@@ -1 +1 @@
-id(int,auto) time_stamp(int) callid(string) traced_user(string) msg(string) method(string) status(string) fromip(string) toip(string) fromtag(string) direction(string) 
+id(int,auto) time_stamp(int) time_us(int) callid(string) traced_user(string) msg(string) method(string) status(string) fromip(string) toip(string) fromtag(string) direction(string) 

+ 4 - 4
utils/kamctl/dbtext/kamailio/version

@@ -20,7 +20,7 @@ dr_gw_lists:1
 dr_rules:3
 globalblacklist:1
 grp:2
-htable:1
+htable:2
 imc_members:1
 imc_rooms:1
 lcr_gw:2
@@ -33,13 +33,13 @@ mtree:1
 pdt:1
 pl_pipes:1
 presentity:3
-pua:6
+pua:7
 purplemap:1
 re_grp:1
-rls_presentity:0
+rls_presentity:1
 rls_watchers:1
 silo:5
-sip_trace:2
+sip_trace:3
 speed_dial:2
 subscriber:6
 trusted:5

+ 3 - 2
utils/kamctl/mysql/htable-create.sql

@@ -1,9 +1,10 @@
-INSERT INTO version (table_name, table_version) values ('htable','1');
+INSERT INTO version (table_name, table_version) values ('htable','2');
 CREATE TABLE htable (
     id INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     key_name VARCHAR(64) DEFAULT '' NOT NULL,
     key_type INT DEFAULT 0 NOT NULL,
     value_type INT DEFAULT 0 NOT NULL,
-    key_value VARCHAR(128) DEFAULT '' NOT NULL
+    key_value VARCHAR(128) DEFAULT '' NOT NULL,
+    expires VARCHAR DEFAULT 0 NOT NULL
 ) ENGINE=MyISAM;
 

+ 0 - 1
utils/kamctl/mysql/pipelimit-create.sql

@@ -6,4 +6,3 @@ CREATE TABLE pl_pipes (
     plimit INT DEFAULT 0 NOT NULL
 ) ENGINE=MyISAM;
 
-CREATE INDEX account_idx ON pl_pipes (

+ 2 - 2
utils/kamctl/mysql/presence-create.sql

@@ -67,7 +67,7 @@ CREATE TABLE xcap (
 
 CREATE INDEX source_idx ON xcap (source);
 
-INSERT INTO version (table_name, table_version) values ('pua','6');
+INSERT INTO version (table_name, table_version) values ('pua','7');
 CREATE TABLE pua (
     id INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     pres_uri VARCHAR(128) NOT NULL,
@@ -79,7 +79,7 @@ CREATE TABLE pua (
     etag VARCHAR(64) NOT NULL,
     tuple_id VARCHAR(64),
     watcher_uri VARCHAR(128) NOT NULL,
-    call_id VARCHAR(128) NOT NULL,
+    call_id VARCHAR(255) NOT NULL,
     to_tag VARCHAR(64) NOT NULL,
     from_tag VARCHAR(64) NOT NULL,
     cseq INT(11) NOT NULL,

+ 2 - 2
utils/kamctl/mysql/rls-create.sql

@@ -1,9 +1,9 @@
-INSERT INTO version (table_name, table_version) values ('rls_presentity','0');
+INSERT INTO version (table_name, table_version) values ('rls_presentity','1');
 CREATE TABLE rls_presentity (
     id INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     rlsubs_did VARCHAR(255) NOT NULL,
     resource_uri VARCHAR(128) NOT NULL,
-    content_type VARCHAR(64) NOT NULL,
+    content_type VARCHAR(255) NOT NULL,
     presence_state BLOB NOT NULL,
     expires INT(11) NOT NULL,
     updated INT(11) NOT NULL,

+ 3 - 3
utils/kamctl/mysql/siptrace-create.sql

@@ -1,7 +1,8 @@
-INSERT INTO version (table_name, table_version) values ('sip_trace','2');
+INSERT INTO version (table_name, table_version) values ('sip_trace','3');
 CREATE TABLE sip_trace (
     id INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     time_stamp DATETIME DEFAULT '1900-01-01 00:00:01' NOT NULL,
+    time_us INT UNSIGNED DEFAULT 0 NOT NULL,
     callid VARCHAR(255) DEFAULT '' NOT NULL,
     traced_user VARCHAR(128) DEFAULT '' NOT NULL,
     msg MEDIUMTEXT NOT NULL,
@@ -10,8 +11,7 @@ CREATE TABLE sip_trace (
     fromip VARCHAR(50) DEFAULT '' NOT NULL,
     toip VARCHAR(50) DEFAULT '' NOT NULL,
     fromtag VARCHAR(64) DEFAULT '' NOT NULL,
-    direction VARCHAR(4) DEFAULT '' NOT NULL,
-    time_us INT(10) UNSIGNED DEFAULT 0 NOT NULL
+    direction VARCHAR(4) DEFAULT '' NOT NULL
 ) ENGINE=MyISAM;
 
 CREATE INDEX traced_user_idx ON sip_trace (traced_user);

+ 3 - 2
utils/kamctl/oracle/htable-create.sql

@@ -1,10 +1,11 @@
-INSERT INTO version (table_name, table_version) values ('htable','1');
+INSERT INTO version (table_name, table_version) values ('htable','2');
 CREATE TABLE htable (
     id NUMBER(10) PRIMARY KEY,
     key_name VARCHAR2(64) DEFAULT '',
     key_type NUMBER(10) DEFAULT 0 NOT NULL,
     value_type NUMBER(10) DEFAULT 0 NOT NULL,
-    key_value VARCHAR2(128) DEFAULT ''
+    key_value VARCHAR2(128) DEFAULT '',
+    expires VARCHAR2 DEFAULT 0 NOT NULL
 );
 
 CREATE OR REPLACE TRIGGER htable_tr

+ 0 - 1
utils/kamctl/oracle/pipelimit-create.sql

@@ -14,4 +14,3 @@ END pl_pipes_tr;
 /
 BEGIN map2users('pl_pipes'); END;
 /
-CREATE INDEX pl_pipes_account_idx  ON pl_pipes (

+ 2 - 2
utils/kamctl/oracle/presence-create.sql

@@ -99,7 +99,7 @@ BEGIN map2users('xcap'); END;
 /
 CREATE INDEX xcap_source_idx  ON xcap (source);
 
-INSERT INTO version (table_name, table_version) values ('pua','6');
+INSERT INTO version (table_name, table_version) values ('pua','7');
 CREATE TABLE pua (
     id NUMBER(10) PRIMARY KEY,
     pres_uri VARCHAR2(128),
@@ -111,7 +111,7 @@ CREATE TABLE pua (
     etag VARCHAR2(64),
     tuple_id VARCHAR2(64),
     watcher_uri VARCHAR2(128),
-    call_id VARCHAR2(128),
+    call_id VARCHAR2(255),
     to_tag VARCHAR2(64),
     from_tag VARCHAR2(64),
     cseq NUMBER(10),

+ 2 - 2
utils/kamctl/oracle/rls-create.sql

@@ -1,9 +1,9 @@
-INSERT INTO version (table_name, table_version) values ('rls_presentity','0');
+INSERT INTO version (table_name, table_version) values ('rls_presentity','1');
 CREATE TABLE rls_presentity (
     id NUMBER(10) PRIMARY KEY,
     rlsubs_did VARCHAR2(255),
     resource_uri VARCHAR2(128),
-    content_type VARCHAR2(64),
+    content_type VARCHAR2(255),
     presence_state BLOB,
     expires NUMBER(10),
     updated NUMBER(10),

+ 2 - 1
utils/kamctl/oracle/siptrace-create.sql

@@ -1,7 +1,8 @@
-INSERT INTO version (table_name, table_version) values ('sip_trace','2');
+INSERT INTO version (table_name, table_version) values ('sip_trace','3');
 CREATE TABLE sip_trace (
     id NUMBER(10) PRIMARY KEY,
     time_stamp DATE DEFAULT to_date('1900-01-01 00:00:01','yyyy-mm-dd hh24:mi:ss'),
+    time_us NUMBER(10) DEFAULT 0 NOT NULL,
     callid VARCHAR2(255) DEFAULT '',
     traced_user VARCHAR2(128) DEFAULT '',
     msg CLOB,

+ 3 - 2
utils/kamctl/postgres/htable-create.sql

@@ -1,9 +1,10 @@
-INSERT INTO version (table_name, table_version) values ('htable','1');
+INSERT INTO version (table_name, table_version) values ('htable','2');
 CREATE TABLE htable (
     id SERIAL PRIMARY KEY NOT NULL,
     key_name VARCHAR(64) DEFAULT '' NOT NULL,
     key_type INTEGER DEFAULT 0 NOT NULL,
     value_type INTEGER DEFAULT 0 NOT NULL,
-    key_value VARCHAR(128) DEFAULT '' NOT NULL
+    key_value VARCHAR(128) DEFAULT '' NOT NULL,
+    expires VARCHAR DEFAULT 0 NOT NULL
 );
 

+ 0 - 1
utils/kamctl/postgres/pipelimit-create.sql

@@ -6,4 +6,3 @@ CREATE TABLE pl_pipes (
     plimit INTEGER DEFAULT 0 NOT NULL
 );
 
-CREATE INDEX pl_pipes_account_idx ON pl_pipes (

+ 2 - 2
utils/kamctl/postgres/presence-create.sql

@@ -67,7 +67,7 @@ CREATE TABLE xcap (
 
 CREATE INDEX xcap_source_idx ON xcap (source);
 
-INSERT INTO version (table_name, table_version) values ('pua','6');
+INSERT INTO version (table_name, table_version) values ('pua','7');
 CREATE TABLE pua (
     id SERIAL PRIMARY KEY NOT NULL,
     pres_uri VARCHAR(128) NOT NULL,
@@ -79,7 +79,7 @@ CREATE TABLE pua (
     etag VARCHAR(64) NOT NULL,
     tuple_id VARCHAR(64),
     watcher_uri VARCHAR(128) NOT NULL,
-    call_id VARCHAR(128) NOT NULL,
+    call_id VARCHAR(255) NOT NULL,
     to_tag VARCHAR(64) NOT NULL,
     from_tag VARCHAR(64) NOT NULL,
     cseq INTEGER NOT NULL,

+ 2 - 2
utils/kamctl/postgres/rls-create.sql

@@ -1,9 +1,9 @@
-INSERT INTO version (table_name, table_version) values ('rls_presentity','0');
+INSERT INTO version (table_name, table_version) values ('rls_presentity','1');
 CREATE TABLE rls_presentity (
     id SERIAL PRIMARY KEY NOT NULL,
     rlsubs_did VARCHAR(255) NOT NULL,
     resource_uri VARCHAR(128) NOT NULL,
-    content_type VARCHAR(64) NOT NULL,
+    content_type VARCHAR(255) NOT NULL,
     presence_state BYTEA NOT NULL,
     expires INTEGER NOT NULL,
     updated INTEGER NOT NULL,

+ 2 - 1
utils/kamctl/postgres/siptrace-create.sql

@@ -1,7 +1,8 @@
-INSERT INTO version (table_name, table_version) values ('sip_trace','2');
+INSERT INTO version (table_name, table_version) values ('sip_trace','3');
 CREATE TABLE sip_trace (
     id SERIAL PRIMARY KEY NOT NULL,
     time_stamp TIMESTAMP WITHOUT TIME ZONE DEFAULT '1900-01-01 00:00:01' NOT NULL,
+    time_us INTEGER DEFAULT 0 NOT NULL,
     callid VARCHAR(255) DEFAULT '' NOT NULL,
     traced_user VARCHAR(128) DEFAULT '' NOT NULL,
     msg TEXT NOT NULL,