Module: sip-router
Branch: master
Commit: ec21c13b86139f10d2280fe75a7ba15f3e30a83a
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=ec21c13…
Author: Timo Reimann <timo.reimann(a)1und1.de>
Committer: Timo Reimann <timo.reimann(a)1und1.de>
Date: Tue Aug 16 20:33:06 2011 +0200
utils: Add database creation scripts for dialog variable table
(dialog_vars).
---
utils/kamctl/db_berkeley/kamailio/dialog_vars | 10 ++++++++++
utils/kamctl/db_sqlite/dialog-vars-create.sql | 11 +++++++++++
utils/kamctl/dbtext/kamailio/dialog_vars | 1 +
utils/kamctl/mysql/dialog-vars-create.sql | 11 +++++++++++
utils/kamctl/oracle/dialog-vars-create.sql | 19 +++++++++++++++++++
utils/kamctl/postgres/dialog-vars-create.sql | 11 +++++++++++
6 files changed, 63 insertions(+), 0 deletions(-)
diff --git a/utils/kamctl/db_berkeley/kamailio/dialog_vars
b/utils/kamctl/db_berkeley/kamailio/dialog_vars
new file mode 100644
index 0000000..1b66d4e
--- /dev/null
+++ b/utils/kamctl/db_berkeley/kamailio/dialog_vars
@@ -0,0 +1,10 @@
+METADATA_COLUMNS
+id(int) hash_entry(int) hash_id(int) dialog_key(str) dialog_value(str)
+METADATA_KEY
+1 2
+METADATA_READONLY
+0
+METADATA_LOGFLAGS
+0
+METADATA_DEFAULTS
+NIL|NIL|NIL|NIL|NIL
diff --git a/utils/kamctl/db_sqlite/dialog-vars-create.sql
b/utils/kamctl/db_sqlite/dialog-vars-create.sql
new file mode 100644
index 0000000..860a87d
--- /dev/null
+++ b/utils/kamctl/db_sqlite/dialog-vars-create.sql
@@ -0,0 +1,11 @@
+INSERT INTO version (table_name, table_version) values
('dialog_vars','1');
+CREATE TABLE dialog_vars (
+ id INTEGER PRIMARY KEY NOT NULL,
+ hash_entry INTEGER NOT NULL,
+ hash_id INTEGER NOT NULL,
+ dialog_key VARCHAR(128) NOT NULL,
+ dialog_value VARCHAR(512) NOT NULL
+) ENGINE=MyISAM;
+
+CREATE INDEX hash_idx ON dialog_vars (hash_entry, hash_id);
+
diff --git a/utils/kamctl/dbtext/kamailio/dialog_vars
b/utils/kamctl/dbtext/kamailio/dialog_vars
new file mode 100644
index 0000000..d39ef42
--- /dev/null
+++ b/utils/kamctl/dbtext/kamailio/dialog_vars
@@ -0,0 +1 @@
+id(int,auto) hash_entry(int) hash_id(int) dialog_key(string) dialog_value(string)
diff --git a/utils/kamctl/mysql/dialog-vars-create.sql
b/utils/kamctl/mysql/dialog-vars-create.sql
new file mode 100644
index 0000000..c8787e6
--- /dev/null
+++ b/utils/kamctl/mysql/dialog-vars-create.sql
@@ -0,0 +1,11 @@
+INSERT INTO version (table_name, table_version) values
('dialog_vars','1');
+CREATE TABLE dialog_vars (
+ id INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
+ hash_entry INT(10) UNSIGNED NOT NULL,
+ hash_id INT(10) UNSIGNED NOT NULL,
+ dialog_key VARCHAR(128) NOT NULL,
+ dialog_value VARCHAR(512) NOT NULL
+) ENGINE=MyISAM;
+
+CREATE INDEX hash_idx ON dialog_vars (hash_entry, hash_id);
+
diff --git a/utils/kamctl/oracle/dialog-vars-create.sql
b/utils/kamctl/oracle/dialog-vars-create.sql
new file mode 100644
index 0000000..9dbaea7
--- /dev/null
+++ b/utils/kamctl/oracle/dialog-vars-create.sql
@@ -0,0 +1,19 @@
+INSERT INTO version (table_name, table_version) values
('dialog_vars','1');
+CREATE TABLE dialog_vars (
+ id NUMBER(10) PRIMARY KEY,
+ hash_entry NUMBER(10),
+ hash_id NUMBER(10),
+ dialog_key VARCHAR2(128),
+ dialog_value VARCHAR2(512)
+);
+
+CREATE OR REPLACE TRIGGER dialog_vars_tr
+before insert on dialog_vars FOR EACH ROW
+BEGIN
+ auto_id(:NEW.id);
+END dialog_vars_tr;
+/
+BEGIN map2users('dialog_vars'); END;
+/
+CREATE INDEX dialog_vars_hash_idx ON dialog_vars (hash_entry, hash_id);
+
diff --git a/utils/kamctl/postgres/dialog-vars-create.sql
b/utils/kamctl/postgres/dialog-vars-create.sql
new file mode 100644
index 0000000..ccc7d68
--- /dev/null
+++ b/utils/kamctl/postgres/dialog-vars-create.sql
@@ -0,0 +1,11 @@
+INSERT INTO version (table_name, table_version) values
('dialog_vars','1');
+CREATE TABLE dialog_vars (
+ id SERIAL PRIMARY KEY NOT NULL,
+ hash_entry INTEGER NOT NULL,
+ hash_id INTEGER NOT NULL,
+ dialog_key VARCHAR(128) NOT NULL,
+ dialog_value VARCHAR(512)
+);
+
+CREATE INDEX dialog_vars_hash_idx ON dialog_vars (hash_entry, hash_id);
+