Răsfoiți Sursa

lib/srdb1/schema, utils/kamctl: Updated DB schemas for presence and RLS

- New fields for from_user and from_domain as these may be different
  to the watcher_user and watcher_domain now.
Peter Dunkley 13 ani în urmă
părinte
comite
039c72b1f0

+ 15 - 1
lib/srdb1/schema/pr_active_watchers.xml

@@ -9,7 +9,7 @@
 
 <table id="active_watchers" xmlns:db="http://docbook.org/ns/docbook">
     <name>active_watchers</name>
-    <version>9</version>
+    <version>10</version>
     <type db="mysql">&MYSQL_TABLE_TYPE;</type>
     <description>
         <db:para>Table for the presence module. More information can be found at: &KAMAILIO_MOD_DOC;presence.html
@@ -172,6 +172,20 @@
         <description>Local contact</description>
     </column>
 
+    <column>
+        <name>from_user</name>
+        <type>string</type>
+        <size>&user_len;</size>
+        <description>From User</description>
+    </column>
+
+    <column>
+        <name>from_domain</name>
+        <type>string</type>
+        <size>&domain_len;</size>
+        <description>From Domain</description>
+    </column>
+
     <index>
         <name>active_watchers_idx</name>
         <colref linkend="callid"/>

+ 14 - 0
lib/srdb1/schema/rls_watchers.xml

@@ -173,6 +173,20 @@
         <description>Local contact</description>
     </column>
 
+    <column>
+        <name>from_user</name>
+        <type>string</type>
+        <size>&user_len;</size>
+        <description>From user</description>
+    </column>
+
+    <column>
+        <name>from_domain</name>
+        <type>string</type>
+        <size>&domain_len;</size>
+        <description>From domain</description>
+    </column>
+
     <column id="updated">
         <name>updated</name>
         <type>int</type>

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

@@ -1,5 +1,5 @@
 METADATA_COLUMNS
-id(int) presentity_uri(str) watcher_username(str) watcher_domain(str) to_user(str) to_domain(str) event(str) event_id(str) to_tag(str) from_tag(str) callid(str) local_cseq(int) remote_cseq(int) contact(str) record_route(str) expires(int) status(int) reason(str) version(int) socket_info(str) local_contact(str)
+id(int) presentity_uri(str) watcher_username(str) watcher_domain(str) to_user(str) to_domain(str) event(str) event_id(str) to_tag(str) from_tag(str) callid(str) local_cseq(int) remote_cseq(int) contact(str) record_route(str) expires(int) status(int) reason(str) version(int) socket_info(str) local_contact(str) from_user(str) from_domain(str)
 METADATA_KEY
 1 6 
 METADATA_READONLY
@@ -7,4 +7,4 @@ METADATA_READONLY
 METADATA_LOGFLAGS
 0
 METADATA_DEFAULTS
-NIL|NIL|NIL|NIL|NIL|NIL|'presence'|NIL|NIL|NIL|NIL|NIL|NIL|NIL|NIL|NIL|2|NIL|0|NIL|NIL
+NIL|NIL|NIL|NIL|NIL|NIL|'presence'|NIL|NIL|NIL|NIL|NIL|NIL|NIL|NIL|NIL|2|NIL|0|NIL|NIL|NIL|NIL

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

@@ -1,5 +1,5 @@
 METADATA_COLUMNS
-id(int) presentity_uri(str) to_user(str) to_domain(str) watcher_username(str) watcher_domain(str) event(str) event_id(str) to_tag(str) from_tag(str) callid(str) local_cseq(int) remote_cseq(int) contact(str) record_route(str) expires(int) status(int) reason(str) version(int) socket_info(str) local_contact(str)
+id(int) presentity_uri(str) to_user(str) to_domain(str) watcher_username(str) watcher_domain(str) event(str) event_id(str) to_tag(str) from_tag(str) callid(str) local_cseq(int) remote_cseq(int) contact(str) record_route(str) expires(int) status(int) reason(str) version(int) socket_info(str) local_contact(str) from_user(str) from_domain(str) updated(int)
 METADATA_KEY
 4 5 
 METADATA_READONLY
@@ -7,4 +7,4 @@ METADATA_READONLY
 METADATA_LOGFLAGS
 0
 METADATA_DEFAULTS
-NIL|NIL|NIL|NIL|NIL|NIL|'presence'|NIL|NIL|NIL|NIL|NIL|NIL|NIL|NIL|NIL|2|NIL|0|NIL|NIL
+NIL|NIL|NIL|NIL|NIL|NIL|'presence'|NIL|NIL|NIL|NIL|NIL|NIL|NIL|NIL|NIL|2|NIL|0|NIL|NIL|NIL|NIL|NIL

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

@@ -11,7 +11,7 @@ NIL|0
 acc|
 acc|4
 active_watchers|
-active_watchers|9
+active_watchers|10
 address|
 address|5
 aliases|
@@ -91,7 +91,7 @@ re_grp|1
 rls_presentity|
 rls_presentity|1
 rls_watchers|
-rls_watchers|1
+rls_watchers|2
 silo|
 silo|6
 sip_trace|

+ 3 - 1
utils/kamctl/db_sqlite/presence-create.sql

@@ -15,7 +15,7 @@ CREATE TABLE presentity (
 CREATE INDEX presentity_presentity_expires ON presentity (expires);
 CREATE INDEX presentity_account_idx ON presentity (username, domain, event);
 
-INSERT INTO version (table_name, table_version) values ('active_watchers','9');
+INSERT INTO version (table_name, table_version) values ('active_watchers','10');
 CREATE TABLE active_watchers (
     id INTEGER PRIMARY KEY NOT NULL,
     presentity_uri VARCHAR(128) NOT NULL,
@@ -38,6 +38,8 @@ CREATE TABLE active_watchers (
     version INTEGER DEFAULT 0 NOT NULL,
     socket_info VARCHAR(64) NOT NULL,
     local_contact VARCHAR(128) NOT NULL,
+    from_user VARCHAR(64) NOT NULL,
+    from_domain VARCHAR(64) NOT NULL,
     CONSTRAINT active_watchers_active_watchers_idx UNIQUE (callid, to_tag, from_tag)
 );
 

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

@@ -39,6 +39,8 @@ CREATE TABLE rls_watchers (
     version INTEGER DEFAULT 0 NOT NULL,
     socket_info VARCHAR(64) NOT NULL,
     local_contact VARCHAR(128) NOT NULL,
+    from_user VARCHAR(64) NOT NULL,
+    from_domain VARCHAR(64) NOT NULL,
     updated INTEGER NOT NULL,
     CONSTRAINT rls_watchers_rls_watcher_idx UNIQUE (callid, to_tag, from_tag)
 );

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

@@ -1 +1 @@
-id(int,auto) presentity_uri(string) watcher_username(string) watcher_domain(string) to_user(string) to_domain(string) event(string) event_id(string,null) to_tag(string) from_tag(string) callid(string) local_cseq(int) remote_cseq(int) contact(string) record_route(string,null) expires(int) status(int) reason(string) version(int) socket_info(string) local_contact(string) 
+id(int,auto) presentity_uri(string) watcher_username(string) watcher_domain(string) to_user(string) to_domain(string) event(string) event_id(string,null) to_tag(string) from_tag(string) callid(string) local_cseq(int) remote_cseq(int) contact(string) record_route(string,null) expires(int) status(int) reason(string) version(int) socket_info(string) local_contact(string) from_user(string) from_domain(string) 

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

@@ -1 +1 @@
-id(int,auto) presentity_uri(string) to_user(string) to_domain(string) watcher_username(string) watcher_domain(string) event(string) event_id(string,null) to_tag(string) from_tag(string) callid(string) local_cseq(int) remote_cseq(int) contact(string) record_route(string,null) expires(int) status(int) reason(string) version(int) socket_info(string) local_contact(string) 
+id(int,auto) presentity_uri(string) to_user(string) to_domain(string) watcher_username(string) watcher_domain(string) event(string) event_id(string,null) to_tag(string) from_tag(string) callid(string) local_cseq(int) remote_cseq(int) contact(string) record_route(string,null) expires(int) status(int) reason(string) version(int) socket_info(string) local_contact(string) from_user(string) from_domain(string) updated(int) 

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

@@ -1,6 +1,6 @@
 table_name(string) table_version(int) 
 acc:4
-active_watchers:9
+active_watchers:10
 address:5
 aliases:5
 carrier_name:1
@@ -40,7 +40,7 @@ pua:7
 purplemap:1
 re_grp:1
 rls_presentity:1
-rls_watchers:1
+rls_watchers:2
 silo:6
 sip_trace:3
 speed_dial:2

+ 3 - 1
utils/kamctl/mysql/presence-create.sql

@@ -15,7 +15,7 @@ CREATE TABLE presentity (
 CREATE INDEX presentity_expires ON presentity (expires);
 CREATE INDEX account_idx ON presentity (username, domain, event);
 
-INSERT INTO version (table_name, table_version) values ('active_watchers','9');
+INSERT INTO version (table_name, table_version) values ('active_watchers','10');
 CREATE TABLE active_watchers (
     id INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     presentity_uri VARCHAR(128) NOT NULL,
@@ -38,6 +38,8 @@ CREATE TABLE active_watchers (
     version INT(11) DEFAULT 0 NOT NULL,
     socket_info VARCHAR(64) NOT NULL,
     local_contact VARCHAR(128) NOT NULL,
+    from_user VARCHAR(64) NOT NULL,
+    from_domain VARCHAR(64) NOT NULL,
     CONSTRAINT active_watchers_idx UNIQUE (callid, to_tag, from_tag)
 ) ENGINE=MyISAM;
 

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

@@ -39,6 +39,8 @@ CREATE TABLE rls_watchers (
     version INT(11) DEFAULT 0 NOT NULL,
     socket_info VARCHAR(64) NOT NULL,
     local_contact VARCHAR(128) NOT NULL,
+    from_user VARCHAR(64) NOT NULL,
+    from_domain VARCHAR(64) NOT NULL,
     updated INT(11) NOT NULL,
     CONSTRAINT rls_watcher_idx UNIQUE (callid, to_tag, from_tag)
 ) ENGINE=MyISAM;

+ 3 - 1
utils/kamctl/oracle/presence-create.sql

@@ -23,7 +23,7 @@ BEGIN map2users('presentity'); END;
 CREATE INDEX presentity_presentity_expires  ON presentity (expires);
 CREATE INDEX presentity_account_idx  ON presentity (username, domain, event);
 
-INSERT INTO version (table_name, table_version) values ('active_watchers','9');
+INSERT INTO version (table_name, table_version) values ('active_watchers','10');
 CREATE TABLE active_watchers (
     id NUMBER(10) PRIMARY KEY,
     presentity_uri VARCHAR2(128),
@@ -46,6 +46,8 @@ CREATE TABLE active_watchers (
     version NUMBER(10) DEFAULT 0 NOT NULL,
     socket_info VARCHAR2(64),
     local_contact VARCHAR2(128),
+    from_user VARCHAR2(64),
+    from_domain VARCHAR2(64),
     CONSTRAINT ORA_active_watchers_idx  UNIQUE (callid, to_tag, from_tag)
 );
 

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

@@ -47,6 +47,8 @@ CREATE TABLE rls_watchers (
     version NUMBER(10) DEFAULT 0 NOT NULL,
     socket_info VARCHAR2(64),
     local_contact VARCHAR2(128),
+    from_user VARCHAR2(64),
+    from_domain VARCHAR2(64),
     updated NUMBER(10),
     CONSTRAINT rls_watchers_rls_watcher_idx  UNIQUE (callid, to_tag, from_tag)
 );

+ 3 - 1
utils/kamctl/postgres/presence-create.sql

@@ -15,7 +15,7 @@ CREATE TABLE presentity (
 CREATE INDEX presentity_presentity_expires ON presentity (expires);
 CREATE INDEX presentity_account_idx ON presentity (username, domain, event);
 
-INSERT INTO version (table_name, table_version) values ('active_watchers','9');
+INSERT INTO version (table_name, table_version) values ('active_watchers','10');
 CREATE TABLE active_watchers (
     id SERIAL PRIMARY KEY NOT NULL,
     presentity_uri VARCHAR(128) NOT NULL,
@@ -38,6 +38,8 @@ CREATE TABLE active_watchers (
     version INTEGER DEFAULT 0 NOT NULL,
     socket_info VARCHAR(64) NOT NULL,
     local_contact VARCHAR(128) NOT NULL,
+    from_user VARCHAR(64) NOT NULL,
+    from_domain VARCHAR(64) NOT NULL,
     CONSTRAINT active_watchers_active_watchers_idx UNIQUE (callid, to_tag, from_tag)
 );
 

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

@@ -39,6 +39,8 @@ CREATE TABLE rls_watchers (
     version INTEGER DEFAULT 0 NOT NULL,
     socket_info VARCHAR(64) NOT NULL,
     local_contact VARCHAR(128) NOT NULL,
+    from_user VARCHAR(64) NOT NULL,
+    from_domain VARCHAR(64) NOT NULL,
     updated INTEGER NOT NULL,
     CONSTRAINT rls_watchers_rls_watcher_idx UNIQUE (callid, to_tag, from_tag)
 );