浏览代码

msilo(k): added callid and status columns

- needed to eventually apply patch from FS#211 for notifying on message
  delivery
- not in use right now, time version increased and db creation scripts
  were regenerated
Daniel-Constantin Mierla 13 年之前
父节点
当前提交
3788a89f24

+ 18 - 2
lib/srdb1/schema/silo.xml

@@ -9,7 +9,7 @@
 
 <table id="silo" xmlns:db="http://docbook.org/ns/docbook">
     <name>silo</name>
-    <version>6</version>
+    <version>7</version>
     <type db="mysql">&MYSQL_TABLE_TYPE;</type>
     <description>
         <db:para> This table us used by the msilo module to provide offline message storage More information about the msilo module can be found at: &KAMAILIO_MOD_DOC;msilo.html
@@ -103,7 +103,23 @@
         <description>iExtra headers that must be restored</description>
     </column>
 
-    <index>
+    <column id="callid">
+        <name>callid</name>
+        <type>string</type>
+        <size>128</size>
+        <default/>
+        <description>SIP Call-Id</description>
+        <natural/>
+    </column>
+
+    <column>
+        <name>status</name>
+        <type>int</type>
+        <default>0</default>
+        <description>Status of notification</description>
+    </column>
+
+	<index>
         <name>account_idx</name>
         <colref linkend="username"/>
         <colref linkend="domain"/>

+ 1 - 1
utils/kamctl/db_berkeley/kamailio/lcr_rule

@@ -1,5 +1,5 @@
 METADATA_COLUMNS
-id(int) lcr_id(int) prefix(str) request_uri(str) from_uri(str) stopper(int) enabled(int)
+id(int) lcr_id(int) prefix(str) from_uri(str) request_uri(str) stopper(int) enabled(int)
 METADATA_KEY
 2 
 METADATA_READONLY

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

@@ -1,10 +1,10 @@
 METADATA_COLUMNS
-id(int) src_addr(str) dst_addr(str) username(str) domain(str) inc_time(int) exp_time(int) snd_time(int) ctype(str) body(str) extra_hdrs(str)
+id(int) src_addr(str) dst_addr(str) username(str) domain(str) inc_time(int) exp_time(int) snd_time(int) ctype(str) body(str) extra_hdrs(str) callid(str) status(int)
 METADATA_KEY
-3 4 
+3 4 11 
 METADATA_READONLY
 0
 METADATA_LOGFLAGS
 0
 METADATA_DEFAULTS
-NIL|''|''|''|''|0|0|0|'text/plain'|''|''
+NIL|''|''|''|''|0|0|0|'text/plain'|''|''|''|0

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

@@ -63,7 +63,7 @@ imc_rooms|1
 lcr_gw|
 lcr_gw|2
 lcr_rule|
-lcr_rule|2
+lcr_rule|1
 lcr_rule_target|
 lcr_rule_target|1
 location|
@@ -93,7 +93,7 @@ rls_presentity|1
 rls_watchers|
 rls_watchers|3
 silo|
-silo|6
+silo|7
 sip_trace|
 sip_trace|3
 speed_dial|

+ 3 - 3
utils/kamctl/db_sqlite/lcr-create.sql

@@ -31,15 +31,15 @@ CREATE TABLE lcr_rule_target (
 
 CREATE INDEX lcr_rule_target_lcr_id_idx ON lcr_rule_target (lcr_id);
 
-INSERT INTO version (table_name, table_version) values ('lcr_rule','2');
+INSERT INTO version (table_name, table_version) values ('lcr_rule','1');
 CREATE TABLE lcr_rule (
     id INTEGER PRIMARY KEY NOT NULL,
     lcr_id SMALLINT NOT NULL,
     prefix VARCHAR(16) DEFAULT NULL,
-    request_uri VARCHAR(64) DEFAULT NULL,
     from_uri VARCHAR(64) DEFAULT NULL,
+    request_uri VARCHAR(64) DEFAULT NULL,
     stopper INTEGER DEFAULT 0 NOT NULL,
     enabled INTEGER DEFAULT 1 NOT NULL,
-    CONSTRAINT lcr_rule_lcr_id_prefix_from_uri_idx UNIQUE (lcr_id, prefix, request_uri, from_uri)
+    CONSTRAINT lcr_rule_lcr_id_prefix_from_uri_idx UNIQUE (lcr_id, prefix, from_uri)
 );
 

+ 4 - 2
utils/kamctl/db_sqlite/msilo-create.sql

@@ -1,4 +1,4 @@
-INSERT INTO version (table_name, table_version) values ('silo','6');
+INSERT INTO version (table_name, table_version) values ('silo','7');
 CREATE TABLE silo (
     id INTEGER PRIMARY KEY NOT NULL,
     src_addr VARCHAR(128) DEFAULT '' NOT NULL,
@@ -10,7 +10,9 @@ CREATE TABLE silo (
     snd_time INTEGER DEFAULT 0 NOT NULL,
     ctype VARCHAR(32) DEFAULT 'text/plain' NOT NULL,
     body BYTEA DEFAULT '' NOT NULL,
-    extra_hdrs TEXT DEFAULT '' NOT NULL
+    extra_hdrs TEXT DEFAULT '' NOT NULL,
+    callid VARCHAR(128) DEFAULT '' NOT NULL,
+    status INTEGER DEFAULT 0 NOT NULL
 );
 
 CREATE INDEX silo_account_idx ON silo (username, domain);

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

@@ -1 +1 @@
-id(int,auto) lcr_id(int) prefix(string,null) request_uri(string,null) from_uri(string,null) stopper(int) enabled(int) 
+id(int,auto) lcr_id(int) prefix(string,null) from_uri(string,null) request_uri(string,null) stopper(int) enabled(int) 

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

@@ -1 +1 @@
-id(int,auto) src_addr(string) dst_addr(string) username(string) domain(string) inc_time(int) exp_time(int) snd_time(int) ctype(string) body(string) extra_hdrs(string) 
+id(int,auto) src_addr(string) dst_addr(string) username(string) domain(string) inc_time(int) exp_time(int) snd_time(int) ctype(string) body(string) extra_hdrs(string) callid(string) status(int) 

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

@@ -26,7 +26,7 @@ htable:2
 imc_members:1
 imc_rooms:1
 lcr_gw:2
-lcr_rule:2
+lcr_rule:1
 lcr_rule_target:1
 location:5
 matrix:1
@@ -41,7 +41,7 @@ purplemap:1
 re_grp:1
 rls_presentity:1
 rls_watchers:3
-silo:6
+silo:7
 sip_trace:3
 speed_dial:2
 subscriber:6

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

@@ -31,15 +31,15 @@ CREATE TABLE lcr_rule_target (
 
 CREATE INDEX lcr_id_idx ON lcr_rule_target (lcr_id);
 
-INSERT INTO version (table_name, table_version) values ('lcr_rule','2');
+INSERT INTO version (table_name, table_version) values ('lcr_rule','1');
 CREATE TABLE lcr_rule (
     id INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     lcr_id SMALLINT UNSIGNED NOT NULL,
     prefix VARCHAR(16) DEFAULT NULL,
-    request_uri VARCHAR(64) DEFAULT NULL,
     from_uri VARCHAR(64) DEFAULT NULL,
+    request_uri VARCHAR(64) DEFAULT NULL,
     stopper INT UNSIGNED DEFAULT 0 NOT NULL,
     enabled INT UNSIGNED DEFAULT 1 NOT NULL,
-    CONSTRAINT lcr_id_prefix_from_uri_idx UNIQUE (lcr_id, prefix, request_uri, from_uri)
+    CONSTRAINT lcr_id_prefix_from_uri_idx UNIQUE (lcr_id, prefix, from_uri)
 ) ENGINE=MyISAM;
 

+ 4 - 2
utils/kamctl/mysql/msilo-create.sql

@@ -1,4 +1,4 @@
-INSERT INTO version (table_name, table_version) values ('silo','6');
+INSERT INTO version (table_name, table_version) values ('silo','7');
 CREATE TABLE silo (
     id INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     src_addr VARCHAR(128) DEFAULT '' NOT NULL,
@@ -10,7 +10,9 @@ CREATE TABLE silo (
     snd_time INT DEFAULT 0 NOT NULL,
     ctype VARCHAR(32) DEFAULT 'text/plain' NOT NULL,
     body BLOB DEFAULT '' NOT NULL,
-    extra_hdrs TEXT DEFAULT '' NOT NULL
+    extra_hdrs TEXT DEFAULT '' NOT NULL,
+    callid VARCHAR(128) DEFAULT '' NOT NULL,
+    status INT DEFAULT 0 NOT NULL
 ) ENGINE=MyISAM;
 
 CREATE INDEX account_idx ON silo (username, domain);

+ 3 - 3
utils/kamctl/oracle/lcr-create.sql

@@ -47,16 +47,16 @@ BEGIN map2users('lcr_rule_target'); END;
 /
 CREATE INDEX lcr_rule_target_lcr_id_idx  ON lcr_rule_target (lcr_id);
 
-INSERT INTO version (table_name, table_version) values ('lcr_rule','2');
+INSERT INTO version (table_name, table_version) values ('lcr_rule','1');
 CREATE TABLE lcr_rule (
     id NUMBER(10) PRIMARY KEY,
     lcr_id NUMBER(5),
     prefix VARCHAR2(16) DEFAULT NULL,
-    request_uri VARCHAR2(64) DEFAULT NULL,
     from_uri VARCHAR2(64) DEFAULT NULL,
+    request_uri VARCHAR2(64) DEFAULT NULL,
     stopper NUMBER(10) DEFAULT 0 NOT NULL,
     enabled NUMBER(10) DEFAULT 1 NOT NULL,
-    CONSTRAINT ORA_lcr_id_prefix_from_uri_idx  UNIQUE (lcr_id, prefix, request_uri, from_uri)
+    CONSTRAINT ORA_lcr_id_prefix_from_uri_idx  UNIQUE (lcr_id, prefix, from_uri)
 );
 
 CREATE OR REPLACE TRIGGER lcr_rule_tr

+ 4 - 2
utils/kamctl/oracle/msilo-create.sql

@@ -1,4 +1,4 @@
-INSERT INTO version (table_name, table_version) values ('silo','6');
+INSERT INTO version (table_name, table_version) values ('silo','7');
 CREATE TABLE silo (
     id NUMBER(10) PRIMARY KEY,
     src_addr VARCHAR2(128) DEFAULT '',
@@ -10,7 +10,9 @@ CREATE TABLE silo (
     snd_time NUMBER(10) DEFAULT 0 NOT NULL,
     ctype VARCHAR2(32) DEFAULT 'text/plain',
     body BLOB DEFAULT '',
-    extra_hdrs CLOB DEFAULT ''
+    extra_hdrs CLOB DEFAULT '',
+    callid VARCHAR2(128) DEFAULT '',
+    status NUMBER(10) DEFAULT 0 NOT NULL
 );
 
 CREATE OR REPLACE TRIGGER silo_tr

+ 3 - 3
utils/kamctl/postgres/lcr-create.sql

@@ -31,15 +31,15 @@ CREATE TABLE lcr_rule_target (
 
 CREATE INDEX lcr_rule_target_lcr_id_idx ON lcr_rule_target (lcr_id);
 
-INSERT INTO version (table_name, table_version) values ('lcr_rule','2');
+INSERT INTO version (table_name, table_version) values ('lcr_rule','1');
 CREATE TABLE lcr_rule (
     id SERIAL PRIMARY KEY NOT NULL,
     lcr_id SMALLINT NOT NULL,
     prefix VARCHAR(16) DEFAULT NULL,
-    request_uri VARCHAR(64) DEFAULT NULL,
     from_uri VARCHAR(64) DEFAULT NULL,
+    request_uri VARCHAR(64) DEFAULT NULL,
     stopper INTEGER DEFAULT 0 NOT NULL,
     enabled INTEGER DEFAULT 1 NOT NULL,
-    CONSTRAINT lcr_rule_lcr_id_prefix_from_uri_idx UNIQUE (lcr_id, prefix, request_uri, from_uri)
+    CONSTRAINT lcr_rule_lcr_id_prefix_from_uri_idx UNIQUE (lcr_id, prefix, from_uri)
 );
 

+ 4 - 2
utils/kamctl/postgres/msilo-create.sql

@@ -1,4 +1,4 @@
-INSERT INTO version (table_name, table_version) values ('silo','6');
+INSERT INTO version (table_name, table_version) values ('silo','7');
 CREATE TABLE silo (
     id SERIAL PRIMARY KEY NOT NULL,
     src_addr VARCHAR(128) DEFAULT '' NOT NULL,
@@ -10,7 +10,9 @@ CREATE TABLE silo (
     snd_time INTEGER DEFAULT 0 NOT NULL,
     ctype VARCHAR(32) DEFAULT 'text/plain' NOT NULL,
     body BYTEA DEFAULT '' NOT NULL,
-    extra_hdrs TEXT DEFAULT '' NOT NULL
+    extra_hdrs TEXT DEFAULT '' NOT NULL,
+    callid VARCHAR(128) DEFAULT '' NOT NULL,
+    status INTEGER DEFAULT 0 NOT NULL
 );
 
 CREATE INDEX silo_account_idx ON silo (username, domain);