Skip to content

Commit

Permalink
presence: add flags and user_agent to schema
Browse files Browse the repository at this point in the history
  • Loading branch information
lazedo committed Jan 31, 2016
1 parent 97cd5d3 commit b1daeac
Show file tree
Hide file tree
Showing 12 changed files with 61 additions and 21 deletions.
18 changes: 17 additions & 1 deletion lib/srdb1/schema/pr_active_watchers.xml
Expand Up @@ -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
Expand Down Expand Up @@ -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"/>
Expand Down
4 changes: 2 additions & 2 deletions utils/kamctl/db_berkeley/kamailio/active_watchers
@@ -1,10 +1,10 @@
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
0
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|''
2 changes: 1 addition & 1 deletion utils/kamctl/db_berkeley/kamailio/version
Expand Up @@ -15,7 +15,7 @@ acc|5
acc_cdrs|
acc_cdrs|2
active_watchers|
active_watchers|11
active_watchers|12
address|
address|6
aliases|
Expand Down
4 changes: 3 additions & 1 deletion utils/kamctl/db_sqlite/presence-create.sql
Expand Up @@ -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)
);

Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion 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)
2 changes: 1 addition & 1 deletion utils/kamctl/dbtext/kamailio/version
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion utils/kamctl/mysql/presence-create.sql
Expand Up @@ -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`)
);

Expand All @@ -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,
Expand Down
4 changes: 3 additions & 1 deletion utils/kamctl/oracle/presence-create.sql
Expand Up @@ -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)
);

Expand All @@ -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,
Expand Down
4 changes: 3 additions & 1 deletion utils/kamctl/postgres/presence-create.sql
Expand Up @@ -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)
);

Expand All @@ -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,
Expand Down
30 changes: 19 additions & 11 deletions utils/kamctl/xhttp_pi/pi_framework.xml
Expand Up @@ -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>
Expand All @@ -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>
Expand Down Expand Up @@ -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">
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down
6 changes: 6 additions & 0 deletions utils/kamctl/xhttp_pi/presence-mod
Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down
2 changes: 2 additions & 0 deletions utils/kamctl/xhttp_pi/presence-table
Expand Up @@ -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">
Expand Down

0 comments on commit b1daeac

Please sign in to comment.