Browse Source

presence: add flags and user_agent to schema

lazedo 10 years ago
parent
commit
b1daeaca38

+ 17 - 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>11</version>
+    <version>12</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
@@ -200,6 +200,22 @@
         <description>Update winfo flag</description>
     </column>
 
+    <column>
+        <name>flags</name>
+        <type>int</type>
+        <size>&flag_len;</size>
+        <default>0</default>
+        <description>Branch and contact flags</description>
+    </column>
+
+    <column>
+        <name>user_agent</name>
+        <type>string</type>
+        <size>&hf_len;</size>
+        <default/>
+        <description>User-Agent header field contains information about the UAC originating the request.</description>
+    </column>
+
     <index>
         <name>active_watchers_idx</name>
         <colref linkend="callid"/>

+ 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) from_user(str) from_domain(str) updated(int) updated_winfo(int)
+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) updated(int) updated_winfo(int) flags(int) user_agent(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|NIL|NIL|NIL|NIL|'presence'|NIL|NIL|NIL|NIL|NIL|NIL|NIL|NIL|NIL|2|NIL|0|NIL|NIL|NIL|NIL|NIL|NIL|0|''

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

@@ -15,7 +15,7 @@ acc|5
 acc_cdrs|
 acc_cdrs|2
 active_watchers|
-active_watchers|11
+active_watchers|12
 address|
 address|6
 aliases|

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

@@ -43,6 +43,8 @@ CREATE TABLE active_watchers (
     from_domain VARCHAR(64) NOT NULL,
     updated INTEGER NOT NULL,
     updated_winfo INTEGER NOT NULL,
+    flags INTEGER DEFAULT 0 NOT NULL,
+    user_agent VARCHAR(255) DEFAULT '' NOT NULL,
     CONSTRAINT active_watchers_active_watchers_idx UNIQUE (callid, to_tag, from_tag)
 );
 
@@ -51,7 +53,7 @@ CREATE INDEX active_watchers_active_watchers_pres ON active_watchers (presentity
 CREATE INDEX active_watchers_updated_idx ON active_watchers (updated);
 CREATE INDEX active_watchers_updated_winfo_idx ON active_watchers (updated_winfo, presentity_uri);
 
-INSERT INTO version (table_name, table_version) values ('active_watchers','11');
+INSERT INTO version (table_name, table_version) values ('active_watchers','12');
 
 CREATE TABLE watchers (
     id INTEGER PRIMARY KEY NOT NULL,

+ 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) from_user(string) from_domain(string) updated(int) updated_winfo(int) 
+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) updated(int) updated_winfo(int) flags(int) user_agent(string) 

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

@@ -2,7 +2,7 @@ table_name(string) table_version(int)
 version:1
 acc:5
 acc_cdrs:2
-active_watchers:11
+active_watchers:12
 address:6
 aliases:8
 carrier_name:1

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

@@ -43,6 +43,8 @@ CREATE TABLE `active_watchers` (
     `from_domain` VARCHAR(64) NOT NULL,
     `updated` INT(11) NOT NULL,
     `updated_winfo` INT(11) NOT NULL,
+    `flags` INT(11) DEFAULT 0 NOT NULL,
+    `user_agent` VARCHAR(255) DEFAULT '' NOT NULL,
     CONSTRAINT active_watchers_idx UNIQUE (`callid`, `to_tag`, `from_tag`)
 );
 
@@ -51,7 +53,7 @@ CREATE INDEX active_watchers_pres ON active_watchers (`presentity_uri`, `event`)
 CREATE INDEX updated_idx ON active_watchers (`updated`);
 CREATE INDEX updated_winfo_idx ON active_watchers (`updated_winfo`, `presentity_uri`);
 
-INSERT INTO version (table_name, table_version) values ('active_watchers','11');
+INSERT INTO version (table_name, table_version) values ('active_watchers','12');
 
 CREATE TABLE `watchers` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,

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

@@ -51,6 +51,8 @@ CREATE TABLE active_watchers (
     from_domain VARCHAR2(64),
     updated NUMBER(10),
     updated_winfo NUMBER(10),
+    flags NUMBER(10) DEFAULT 0 NOT NULL,
+    user_agent VARCHAR2(255) DEFAULT '',
     CONSTRAINT ORA_active_watchers_idx  UNIQUE (callid, to_tag, from_tag)
 );
 
@@ -67,7 +69,7 @@ CREATE INDEX ORA_active_watchers_pres  ON active_watchers (presentity_uri, event
 CREATE INDEX active_watchers_updated_idx  ON active_watchers (updated);
 CREATE INDEX ORA_updated_winfo_idx  ON active_watchers (updated_winfo, presentity_uri);
 
-INSERT INTO version (table_name, table_version) values ('active_watchers','11');
+INSERT INTO version (table_name, table_version) values ('active_watchers','12');
 
 CREATE TABLE watchers (
     id NUMBER(10) PRIMARY KEY,

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

@@ -43,6 +43,8 @@ CREATE TABLE active_watchers (
     from_domain VARCHAR(64) NOT NULL,
     updated INTEGER NOT NULL,
     updated_winfo INTEGER NOT NULL,
+    flags INTEGER DEFAULT 0 NOT NULL,
+    user_agent VARCHAR(255) DEFAULT '' NOT NULL,
     CONSTRAINT active_watchers_active_watchers_idx UNIQUE (callid, to_tag, from_tag)
 );
 
@@ -51,7 +53,7 @@ CREATE INDEX active_watchers_active_watchers_pres ON active_watchers (presentity
 CREATE INDEX active_watchers_updated_idx ON active_watchers (updated);
 CREATE INDEX active_watchers_updated_winfo_idx ON active_watchers (updated_winfo, presentity_uri);
 
-INSERT INTO version (table_name, table_version) values ('active_watchers','11');
+INSERT INTO version (table_name, table_version) values ('active_watchers','12');
 
 CREATE TABLE watchers (
     id SERIAL PRIMARY KEY NOT NULL,

+ 19 - 11
utils/kamctl/xhttp_pi/pi_framework.xml

@@ -221,6 +221,17 @@
 		<column><field>attrs</field><type>DB1_STR</type></column>
 		<column><field>description</field><type>DB1_STR</type></column>
 	</db_table>
+	<!-- Declaration of domainpolicy table-->
+	<db_table id="domainpolicy">
+		<table_name>domainpolicy</table_name>
+		<db_url_id>mysql</db_url_id>
+		<column><field>id</field><type>DB1_INT</type></column>
+		<column><field>rule</field><type>DB1_STR</type></column>
+		<column><field>type</field><type>DB1_STR</type></column>
+		<column><field>att</field><type>DB1_STR</type></column>
+		<column><field>val</field><type>DB1_STR</type></column>
+		<column><field>description</field><type>DB1_STR</type></column>
+	</db_table>
 	<!-- Declaration of domain table-->
 	<db_table id="domain">
 		<table_name>domain</table_name>
@@ -241,17 +252,6 @@
 		<column><field>value</field><type>DB1_STR</type></column>
 		<column><field>last_modified</field><type>DB1_DATETIME</type></column>
 	</db_table>
-	<!-- Declaration of domainpolicy table-->
-	<db_table id="domainpolicy">
-		<table_name>domainpolicy</table_name>
-		<db_url_id>mysql</db_url_id>
-		<column><field>id</field><type>DB1_INT</type></column>
-		<column><field>rule</field><type>DB1_STR</type></column>
-		<column><field>type</field><type>DB1_STR</type></column>
-		<column><field>att</field><type>DB1_STR</type></column>
-		<column><field>val</field><type>DB1_STR</type></column>
-		<column><field>description</field><type>DB1_STR</type></column>
-	</db_table>
 	<!-- Declaration of dr_gateways table-->
 	<db_table id="dr_gateways">
 		<table_name>dr_gateways</table_name>
@@ -536,6 +536,8 @@
 		<column><field>from_domain</field><type>DB1_STR</type></column>
 		<column><field>updated</field><type>DB1_INT</type></column>
 		<column><field>updated_winfo</field><type>DB1_INT</type></column>
+		<column><field>flags</field><type>DB1_INT</type></column>
+		<column><field>user_agent</field><type>DB1_STR</type></column>
 	</db_table>
 	<!-- Declaration of watchers table-->
 	<db_table id="watchers">
@@ -2975,6 +2977,8 @@
 				<col><field>from_domain</field></col>
 				<col><field>updated</field></col>
 				<col><field>updated_winfo</field></col>
+				<col><field>flags</field></col>
+				<col><field>user_agent</field></col>
 			</query_cols>
 		</cmd>
 		<cmd><cmd_name>add</cmd_name>
@@ -3005,6 +3009,8 @@
 				<col><field>from_domain</field></col>
 				<col><field>updated</field></col>
 				<col><field>updated_winfo</field></col>
+				<col><field>flags</field></col>
+				<col><field>user_agent</field></col>
 			</query_cols>
 		</cmd>
 		<cmd><cmd_name>update</cmd_name>
@@ -3038,6 +3044,8 @@
 				<col><field>from_domain</field></col>
 				<col><field>updated</field></col>
 				<col><field>updated_winfo</field></col>
+				<col><field>flags</field></col>
+				<col><field>user_agent</field></col>
 			</query_cols>
 		</cmd>
 		<cmd><cmd_name>delete</cmd_name>

+ 6 - 0
utils/kamctl/xhttp_pi/presence-mod

@@ -88,6 +88,8 @@
 				<col><field>from_domain</field></col>
 				<col><field>updated</field></col>
 				<col><field>updated_winfo</field></col>
+				<col><field>flags</field></col>
+				<col><field>user_agent</field></col>
 			</query_cols>
 		</cmd>
 		<cmd><cmd_name>add</cmd_name>
@@ -118,6 +120,8 @@
 				<col><field>from_domain</field></col>
 				<col><field>updated</field></col>
 				<col><field>updated_winfo</field></col>
+				<col><field>flags</field></col>
+				<col><field>user_agent</field></col>
 			</query_cols>
 		</cmd>
 		<cmd><cmd_name>update</cmd_name>
@@ -151,6 +155,8 @@
 				<col><field>from_domain</field></col>
 				<col><field>updated</field></col>
 				<col><field>updated_winfo</field></col>
+				<col><field>flags</field></col>
+				<col><field>user_agent</field></col>
 			</query_cols>
 		</cmd>
 		<cmd><cmd_name>delete</cmd_name>

+ 2 - 0
utils/kamctl/xhttp_pi/presence-table

@@ -42,6 +42,8 @@
 		<column><field>from_domain</field><type>DB1_STR</type></column>
 		<column><field>updated</field><type>DB1_INT</type></column>
 		<column><field>updated_winfo</field><type>DB1_INT</type></column>
+		<column><field>flags</field><type>DB1_INT</type></column>
+		<column><field>user_agent</field><type>DB1_STR</type></column>
 	</db_table>
 	<!-- Declaration of watchers table-->
 	<db_table id="watchers">