Browse Source

lib/srdb1, kamctl: Add new rtpproxy db table to schema

Hugh Waite 12 years ago
parent
commit
45b4d0b480

+ 12 - 0
lib/srdb1/schema/kamailio-rtpproxy.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE database PUBLIC "-//kamailio.org//DTD DBSchema V1.1//EN"
+  "http://kamailio.org/pub/kamailio/dbschema/dtd/1.1/dbschema.dtd" [
+
+  <!ENTITY % entities SYSTEM "entities.xml">
+  %entities;
+]>
+
+<database xmlns:xi="http://www.w3.org/2001/XInclude">
+    <name>RTPProxy</name>
+    <xi:include href="rtpproxy.xml"/>
+</database>

+ 69 - 0
lib/srdb1/schema/rtpproxy.xml

@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE table PUBLIC "-//kamailio.org//DTD DBSchema V1.1//EN" 
+  "http://kamailio.org/pub/kamailio/dbschema/dtd/1.1/dbschema.dtd" [
+
+<!ENTITY % entities SYSTEM "entities.xml">
+%entities;
+
+]>
+
+<table id="rtpproxy" xmlns:db="http://docbook.org/ns/docbook">
+    <name>rtpproxy</name>
+    <version>1</version>
+    <type db="mysql">&MYSQL_TABLE_TYPE;</type>
+    <description>
+        <db:para>This table is used by the rtpproxy module. It contains the sets of rtpproxy instances used for proxying media between endpoints. More information about the rtpproxy module can be found at: &KAMAILIO_MOD_DOC;rtpproxy.html
+        </db:para>
+    </description>
+
+    <column id="id">
+        <name>id</name>
+        <type>unsigned int</type>
+        <size>&table_id_len;</size>
+        <autoincrement/>
+        <primary/>
+        <type db="dbtext">int,auto</type>
+        <description>unique ID</description>
+    </column>
+
+    <column id="setid">
+        <name>setid</name>
+        <type>string</type>
+	<size>32</size>
+        <description>Set ID</description>
+        <default>00</default>
+    </column>
+
+    <column id="url">
+        <name>url</name>
+        <type>string</type>
+        <size>64</size>
+        <description>RTPProxy instance socket URL</description>
+        <default/>
+    </column>
+
+    <column id="flags">
+        <name>flags</name>
+        <type>int</type>
+        <description>Flags of the rtpproxy instance</description>
+        <default>0</default>
+        <natural/>
+    </column>
+
+    <column id="weight">
+        <name>weight</name>
+        <type>int</type>
+        <description>Weighting of this rtpproxy instance in the set</description>
+        <default>1</default>
+        <natural/>
+    </column>
+
+    <column>
+        <name>description</name>
+        <type>string</type>
+        <size>64</size>
+        <default/>
+        <description>Description for this instance</description>
+    </column>
+
+</table>

+ 10 - 0
utils/kamctl/db_berkeley/kamailio/rtpproxy

@@ -0,0 +1,10 @@
+METADATA_COLUMNS
+id(int) setid(str) url(str) flags(int) weight(int) description(str)
+METADATA_KEY
+3 4 
+METADATA_READONLY
+0
+METADATA_LOGFLAGS
+0
+METADATA_DEFAULTS
+NIL|00|''|0|1|''

+ 2 - 0
utils/kamctl/db_berkeley/kamailio/version

@@ -94,6 +94,8 @@ rls_presentity|
 rls_presentity|1
 rls_watchers|
 rls_watchers|3
+rtpproxy|
+rtpproxy|1
 sca_subscriptions|
 sca_subscriptions|1
 silo|

+ 10 - 0
utils/kamctl/db_sqlite/rtpproxy-create.sql

@@ -0,0 +1,10 @@
+INSERT INTO version (table_name, table_version) values ('rtpproxy','1');
+CREATE TABLE rtpproxy (
+    id INTEGER PRIMARY KEY NOT NULL,
+    setid VARCHAR(32) DEFAULT 00 NOT NULL,
+    url VARCHAR(64) DEFAULT '' NOT NULL,
+    flags INTEGER DEFAULT 0 NOT NULL,
+    weight INTEGER DEFAULT 1 NOT NULL,
+    description VARCHAR(64) DEFAULT '' NOT NULL
+);
+

+ 1 - 0
utils/kamctl/dbtext/kamailio/rtpproxy

@@ -0,0 +1 @@
+id(int,auto) setid(string) url(string) flags(int) weight(int) description(string) 

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

@@ -42,6 +42,7 @@ purplemap:1
 re_grp:1
 rls_presentity:1
 rls_watchers:3
+rtpproxy:1
 sca_subscriptions:1
 silo:7
 sip_trace:3

+ 10 - 0
utils/kamctl/mysql/rtpproxy-create.sql

@@ -0,0 +1,10 @@
+INSERT INTO version (table_name, table_version) values ('rtpproxy','1');
+CREATE TABLE rtpproxy (
+    id INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
+    setid VARCHAR(32) DEFAULT 00 NOT NULL,
+    url VARCHAR(64) DEFAULT '' NOT NULL,
+    flags INT DEFAULT 0 NOT NULL,
+    weight INT DEFAULT 1 NOT NULL,
+    description VARCHAR(64) DEFAULT '' NOT NULL
+) ENGINE=MyISAM;
+

+ 18 - 0
utils/kamctl/oracle/rtpproxy-create.sql

@@ -0,0 +1,18 @@
+INSERT INTO version (table_name, table_version) values ('rtpproxy','1');
+CREATE TABLE rtpproxy (
+    id NUMBER(10) PRIMARY KEY,
+    setid VARCHAR2(32) DEFAULT 00 NOT NULL,
+    url VARCHAR2(64) DEFAULT '',
+    flags NUMBER(10) DEFAULT 0 NOT NULL,
+    weight NUMBER(10) DEFAULT 1 NOT NULL,
+    description VARCHAR2(64) DEFAULT ''
+);
+
+CREATE OR REPLACE TRIGGER rtpproxy_tr
+before insert on rtpproxy FOR EACH ROW
+BEGIN
+  auto_id(:NEW.id);
+END rtpproxy_tr;
+/
+BEGIN map2users('rtpproxy'); END;
+/

+ 10 - 0
utils/kamctl/postgres/rtpproxy-create.sql

@@ -0,0 +1,10 @@
+INSERT INTO version (table_name, table_version) values ('rtpproxy','1');
+CREATE TABLE rtpproxy (
+    id SERIAL PRIMARY KEY NOT NULL,
+    setid VARCHAR(32) DEFAULT 00 NOT NULL,
+    url VARCHAR(64) DEFAULT '' NOT NULL,
+    flags INTEGER DEFAULT 0 NOT NULL,
+    weight INTEGER DEFAULT 1 NOT NULL,
+    description VARCHAR(64) DEFAULT '' NOT NULL
+);
+

+ 58 - 0
utils/kamctl/xhttp_pi/pi_framework.xml

@@ -630,6 +630,17 @@
 		<column><field>from_domain</field><type>DB1_STR</type></column>
 		<column><field>updated</field><type>DB1_INT</type></column>
 	</db_table>
+	<!-- Declaration of rtpproxy table-->
+	<db_table id="rtpproxy">
+		<table_name>rtpproxy</table_name>
+		<db_url_id>mysql</db_url_id>
+		<column><field>id</field><type>DB1_INT</type></column>
+		<column><field>setid</field><type>DB1_STR</type></column>
+		<column><field>url</field><type>DB1_STR</type></column>
+		<column><field>flags</field><type>DB1_INT</type></column>
+		<column><field>weight</field><type>DB1_INT</type></column>
+		<column><field>description</field><type>DB1_STR</type></column>
+	</db_table>
 	<!-- Declaration of sca_subscriptions table-->
 	<db_table id="sca_subscriptions">
 		<table_name>sca_subscriptions</table_name>
@@ -3315,6 +3326,53 @@
 			</clause_cols>
 		</cmd>
 	</mod>
+	<!-- rtpproxy provisionning -->
+	<mod><mod_name>rtpproxy</mod_name>
+		<cmd><cmd_name>show</cmd_name>
+			<db_table_id>rtpproxy</db_table_id>
+			<cmd_type>DB1_QUERY</cmd_type>
+			<query_cols>
+				<col><field>id</field></col>
+				<col><field>setid</field></col>
+				<col><field>url</field></col>
+				<col><field>flags</field></col>
+				<col><field>weight</field></col>
+				<col><field>description</field></col>
+			</query_cols>
+		</cmd>
+		<cmd><cmd_name>add</cmd_name>
+			<db_table_id>rtpproxy</db_table_id>
+			<cmd_type>DB1_INSERT</cmd_type>
+			<query_cols>
+				<col><field>setid</field></col>
+				<col><field>url</field></col>
+				<col><field>flags</field></col>
+				<col><field>weight</field></col>
+				<col><field>description</field></col>
+			</query_cols>
+		</cmd>
+		<cmd><cmd_name>update</cmd_name>
+			<db_table_id>rtpproxy</db_table_id>
+			<cmd_type>DB1_UPDATE</cmd_type>
+			<clause_cols>
+				<col><field>id</field><operator>=</operator></col>
+			</clause_cols>
+			<query_cols>
+				<col><field>setid</field></col>
+				<col><field>url</field></col>
+				<col><field>flags</field></col>
+				<col><field>weight</field></col>
+				<col><field>description</field></col>
+			</query_cols>
+		</cmd>
+		<cmd><cmd_name>delete</cmd_name>
+			<db_table_id>rtpproxy</db_table_id>
+			<cmd_type>DB1_DELETE</cmd_type>
+			<clause_cols>
+				<col><field>id</field><operator>=</operator></col>
+			</clause_cols>
+		</cmd>
+	</mod>
 	<!-- sca_subscriptions provisionning -->
 	<mod><mod_name>sca_subscriptions</mod_name>
 		<cmd><cmd_name>show</cmd_name>

+ 47 - 0
utils/kamctl/xhttp_pi/rtpproxy-mod

@@ -0,0 +1,47 @@
+	<!-- rtpproxy provisionning -->
+	<mod><mod_name>rtpproxy</mod_name>
+		<cmd><cmd_name>show</cmd_name>
+			<db_table_id>rtpproxy</db_table_id>
+			<cmd_type>DB1_QUERY</cmd_type>
+			<query_cols>
+				<col><field>id</field></col>
+				<col><field>setid</field></col>
+				<col><field>url</field></col>
+				<col><field>flags</field></col>
+				<col><field>weight</field></col>
+				<col><field>description</field></col>
+			</query_cols>
+		</cmd>
+		<cmd><cmd_name>add</cmd_name>
+			<db_table_id>rtpproxy</db_table_id>
+			<cmd_type>DB1_INSERT</cmd_type>
+			<query_cols>
+				<col><field>setid</field></col>
+				<col><field>url</field></col>
+				<col><field>flags</field></col>
+				<col><field>weight</field></col>
+				<col><field>description</field></col>
+			</query_cols>
+		</cmd>
+		<cmd><cmd_name>update</cmd_name>
+			<db_table_id>rtpproxy</db_table_id>
+			<cmd_type>DB1_UPDATE</cmd_type>
+			<clause_cols>
+				<col><field>id</field><operator>=</operator></col>
+			</clause_cols>
+			<query_cols>
+				<col><field>setid</field></col>
+				<col><field>url</field></col>
+				<col><field>flags</field></col>
+				<col><field>weight</field></col>
+				<col><field>description</field></col>
+			</query_cols>
+		</cmd>
+		<cmd><cmd_name>delete</cmd_name>
+			<db_table_id>rtpproxy</db_table_id>
+			<cmd_type>DB1_DELETE</cmd_type>
+			<clause_cols>
+				<col><field>id</field><operator>=</operator></col>
+			</clause_cols>
+		</cmd>
+	</mod>

+ 11 - 0
utils/kamctl/xhttp_pi/rtpproxy-table

@@ -0,0 +1,11 @@
+	<!-- Declaration of rtpproxy table-->
+	<db_table id="rtpproxy">
+		<table_name>rtpproxy</table_name>
+		<db_url_id>mysql</db_url_id>
+		<column><field>id</field><type>DB1_INT</type></column>
+		<column><field>setid</field><type>DB1_STR</type></column>
+		<column><field>url</field><type>DB1_STR</type></column>
+		<column><field>flags</field><type>DB1_INT</type></column>
+		<column><field>weight</field><type>DB1_INT</type></column>
+		<column><field>description</field><type>DB1_STR</type></column>
+	</db_table>