Module: sip-router
Branch: master
Commit: aca01e149445a0c6f87a9ed97974bcba612e426f
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=aca01e1…
Author: Ovidiu Sas <osas(a)voipembedded.com>
Committer: Ovidiu Sas <osas(a)voipembedded.com>
Date: Thu Nov 29 09:57:48 2012 -0500
sca: adding missing sca db utils files
---
.../kamctl/db_berkeley/kamailio/sca_subscriptions | 10 +++++++
utils/kamctl/db_berkeley/kamailio/version | 2 +
utils/kamctl/db_sqlite/sca-create.sql | 20 ++++++++++++++
utils/kamctl/dbtext/kamailio/sca_subscriptions | 1 +
utils/kamctl/dbtext/kamailio/version | 1 +
utils/kamctl/oracle/sca-create.sql | 28 ++++++++++++++++++++
utils/kamctl/postgres/sca-create.sql | 20 ++++++++++++++
7 files changed, 82 insertions(+), 0 deletions(-)
diff --git a/utils/kamctl/db_berkeley/kamailio/sca_subscriptions
b/utils/kamctl/db_berkeley/kamailio/sca_subscriptions
new file mode 100644
index 0000000..39709bc
--- /dev/null
+++ b/utils/kamctl/db_berkeley/kamailio/sca_subscriptions
@@ -0,0 +1,10 @@
+METADATA_COLUMNS
+id(int) subscriber(str) aor(str) event(int) expires(int) state(int) app_idx(int)
call_id(str) from_tag(str) to_tag(str) notify_cseq(int) subscribe_cseq(int)
+METADATA_KEY
+
+METADATA_READONLY
+0
+METADATA_LOGFLAGS
+0
+METADATA_DEFAULTS
+NIL|NIL|NIL|0|0|0|0|NIL|NIL|NIL|NIL|NIL
diff --git a/utils/kamctl/db_berkeley/kamailio/version
b/utils/kamctl/db_berkeley/kamailio/version
index 61f4be3..933524c 100644
--- a/utils/kamctl/db_berkeley/kamailio/version
+++ b/utils/kamctl/db_berkeley/kamailio/version
@@ -92,6 +92,8 @@ rls_presentity|
rls_presentity|1
rls_watchers|
rls_watchers|3
+sca_subscriptions|
+sca_subscriptions|0
silo|
silo|7
sip_trace|
diff --git a/utils/kamctl/db_sqlite/sca-create.sql
b/utils/kamctl/db_sqlite/sca-create.sql
new file mode 100644
index 0000000..eca6ea2
--- /dev/null
+++ b/utils/kamctl/db_sqlite/sca-create.sql
@@ -0,0 +1,20 @@
+INSERT INTO version (table_name, table_version) values
('sca_subscriptions','0');
+CREATE TABLE sca_subscriptions (
+ id INTEGER PRIMARY KEY NOT NULL,
+ subscriber VARCHAR(255) NOT NULL,
+ aor VARCHAR(255) NOT NULL,
+ event INTEGER DEFAULT 0 NOT NULL,
+ expires INTEGER DEFAULT 0 NOT NULL,
+ state INTEGER DEFAULT 0 NOT NULL,
+ app_idx INTEGER DEFAULT 0 NOT NULL,
+ call_id VARCHAR(255) NOT NULL,
+ from_tag VARCHAR(64) NOT NULL,
+ to_tag VARCHAR(64) NOT NULL,
+ notify_cseq INTEGER NOT NULL,
+ subscribe_cseq INTEGER NOT NULL,
+ CONSTRAINT sca_subscriptions_sca_subscriptions_idx UNIQUE (subscriber, call_id,
from_tag, to_tag)
+);
+
+CREATE INDEX sca_subscriptions_sca_expires_idx ON sca_subscriptions (expires);
+CREATE INDEX sca_subscriptions_sca_subscribers_idx ON sca_subscriptions (subscriber,
event);
+
diff --git a/utils/kamctl/dbtext/kamailio/sca_subscriptions
b/utils/kamctl/dbtext/kamailio/sca_subscriptions
new file mode 100644
index 0000000..ba5183a
--- /dev/null
+++ b/utils/kamctl/dbtext/kamailio/sca_subscriptions
@@ -0,0 +1 @@
+id(int,auto) subscriber(string) aor(string) event(int) expires(int) state(int)
app_idx(int) call_id(string) from_tag(string) to_tag(string) notify_cseq(int)
subscribe_cseq(int)
diff --git a/utils/kamctl/dbtext/kamailio/version b/utils/kamctl/dbtext/kamailio/version
index b362eef..1fab1c5 100644
--- a/utils/kamctl/dbtext/kamailio/version
+++ b/utils/kamctl/dbtext/kamailio/version
@@ -41,6 +41,7 @@ purplemap:1
re_grp:1
rls_presentity:1
rls_watchers:3
+sca_subscriptions:0
silo:7
sip_trace:3
speed_dial:2
diff --git a/utils/kamctl/oracle/sca-create.sql b/utils/kamctl/oracle/sca-create.sql
new file mode 100644
index 0000000..5674097
--- /dev/null
+++ b/utils/kamctl/oracle/sca-create.sql
@@ -0,0 +1,28 @@
+INSERT INTO version (table_name, table_version) values
('sca_subscriptions','0');
+CREATE TABLE sca_subscriptions (
+ id NUMBER(10) PRIMARY KEY,
+ subscriber VARCHAR2(255),
+ aor VARCHAR2(255),
+ event NUMBER(10) DEFAULT 0 NOT NULL,
+ expires NUMBER(10) DEFAULT 0 NOT NULL,
+ state NUMBER(10) DEFAULT 0 NOT NULL,
+ app_idx NUMBER(10) DEFAULT 0 NOT NULL,
+ call_id VARCHAR2(255),
+ from_tag VARCHAR2(64),
+ to_tag VARCHAR2(64),
+ notify_cseq NUMBER(10),
+ subscribe_cseq NUMBER(10),
+ CONSTRAINT ORA_sca_subscriptions_idx UNIQUE (subscriber, call_id, from_tag, to_tag)
+);
+
+CREATE OR REPLACE TRIGGER sca_subscriptions_tr
+before insert on sca_subscriptions FOR EACH ROW
+BEGIN
+ auto_id(:NEW.id);
+END sca_subscriptions_tr;
+/
+BEGIN map2users('sca_subscriptions'); END;
+/
+CREATE INDEX ORA_sca_expires_idx ON sca_subscriptions (expires);
+CREATE INDEX ORA_sca_subscribers_idx ON sca_subscriptions (subscriber, event);
+
diff --git a/utils/kamctl/postgres/sca-create.sql b/utils/kamctl/postgres/sca-create.sql
new file mode 100644
index 0000000..6f7e1b5
--- /dev/null
+++ b/utils/kamctl/postgres/sca-create.sql
@@ -0,0 +1,20 @@
+INSERT INTO version (table_name, table_version) values
('sca_subscriptions','0');
+CREATE TABLE sca_subscriptions (
+ id SERIAL PRIMARY KEY NOT NULL,
+ subscriber VARCHAR(255) NOT NULL,
+ aor VARCHAR(255) NOT NULL,
+ event INTEGER DEFAULT 0 NOT NULL,
+ expires INTEGER DEFAULT 0 NOT NULL,
+ state INTEGER DEFAULT 0 NOT NULL,
+ app_idx INTEGER DEFAULT 0 NOT NULL,
+ call_id VARCHAR(255) NOT NULL,
+ from_tag VARCHAR(64) NOT NULL,
+ to_tag VARCHAR(64) NOT NULL,
+ notify_cseq INTEGER NOT NULL,
+ subscribe_cseq INTEGER NOT NULL,
+ CONSTRAINT sca_subscriptions_sca_subscriptions_idx UNIQUE (subscriber, call_id,
from_tag, to_tag)
+);
+
+CREATE INDEX sca_subscriptions_sca_expires_idx ON sca_subscriptions (expires);
+CREATE INDEX sca_subscriptions_sca_subscribers_idx ON sca_subscriptions (subscriber,
event);
+