/usr/share/opensips/sqlite/presence-create.sql is in opensips-sqlite-module 2.2.2-3build4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | INSERT INTO version (table_name, table_version) values ('presentity','5');
CREATE TABLE presentity (
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
username CHAR(64) NOT NULL,
domain CHAR(64) NOT NULL,
event CHAR(64) NOT NULL,
etag CHAR(64) NOT NULL,
expires INTEGER NOT NULL,
received_time INTEGER NOT NULL,
body BLOB NOT NULL,
extra_hdrs BLOB DEFAULT '' NOT NULL,
sender CHAR(128) NOT NULL,
CONSTRAINT presentity_presentity_idx UNIQUE (username, domain, event, etag)
);
INSERT INTO version (table_name, table_version) values ('active_watchers','11');
CREATE TABLE active_watchers (
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
presentity_uri CHAR(128) NOT NULL,
watcher_username CHAR(64) NOT NULL,
watcher_domain CHAR(64) NOT NULL,
to_user CHAR(64) NOT NULL,
to_domain CHAR(64) NOT NULL,
event CHAR(64) DEFAULT 'presence' NOT NULL,
event_id CHAR(64),
to_tag CHAR(64) NOT NULL,
from_tag CHAR(64) NOT NULL,
callid CHAR(64) NOT NULL,
local_cseq INTEGER NOT NULL,
remote_cseq INTEGER NOT NULL,
contact CHAR(128) NOT NULL,
record_route TEXT,
expires INTEGER NOT NULL,
status INTEGER DEFAULT 2 NOT NULL,
reason CHAR(64),
version INTEGER DEFAULT 0 NOT NULL,
socket_info CHAR(64) NOT NULL,
local_contact CHAR(128) NOT NULL,
CONSTRAINT ORA_active_watchers_idx UNIQUE (presentity_uri, callid, to_tag, from_tag)
);
INSERT INTO version (table_name, table_version) values ('watchers','4');
CREATE TABLE watchers (
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
presentity_uri CHAR(128) NOT NULL,
watcher_username CHAR(64) NOT NULL,
watcher_domain CHAR(64) NOT NULL,
event CHAR(64) DEFAULT 'presence' NOT NULL,
status INTEGER NOT NULL,
reason CHAR(64),
inserted_time INTEGER NOT NULL,
CONSTRAINT watchers_watcher_idx UNIQUE (presentity_uri, watcher_username, watcher_domain, event)
);
INSERT INTO version (table_name, table_version) values ('xcap','4');
CREATE TABLE xcap (
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
username CHAR(64) NOT NULL,
domain CHAR(64) NOT NULL,
doc BLOB NOT NULL,
doc_type INTEGER NOT NULL,
etag CHAR(64) NOT NULL,
source INTEGER NOT NULL,
doc_uri CHAR(128) NOT NULL,
port INTEGER NOT NULL,
CONSTRAINT xcap_account_doc_type_idx UNIQUE (username, domain, doc_type, doc_uri)
);
CREATE INDEX xcap_source_idx ON xcap (source);
INSERT INTO version (table_name, table_version) values ('pua','8');
CREATE TABLE pua (
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
pres_uri CHAR(128) NOT NULL,
pres_id CHAR(255) NOT NULL,
event INTEGER NOT NULL,
expires INTEGER NOT NULL,
desired_expires INTEGER NOT NULL,
flag INTEGER NOT NULL,
etag CHAR(64),
tuple_id CHAR(64),
watcher_uri CHAR(128),
to_uri CHAR(128),
call_id CHAR(64),
to_tag CHAR(64),
from_tag CHAR(64),
cseq INTEGER,
record_route TEXT,
contact CHAR(128),
remote_contact CHAR(128),
version INTEGER,
extra_headers TEXT
);
CREATE INDEX pua_del1_idx ON pua (pres_uri, event);
CREATE INDEX pua_del2_idx ON pua (expires);
CREATE INDEX pua_update_idx ON pua (pres_uri, pres_id, flag, event);
|