瀏覽代碼

drouting: adding db table definitions

- built based on readme
- needs further updates as the code is ahead of documentation with what
  tables are used and their structure
Daniel-Constantin Mierla 15 年之前
父節點
當前提交
53a25f097d
共有 3 個文件被更改,包括 171 次插入0 次删除
  1. 71 0
      lib/srdb1/schema/dr_gateways.xml
  2. 86 0
      lib/srdb1/schema/dr_rules.xml
  3. 14 0
      lib/srdb1/schema/kamailio-drouting.xml

+ 71 - 0
lib/srdb1/schema/dr_gateways.xml

@@ -0,0 +1,71 @@
+<?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="dr_gateways" xmlns:db="http://docbook.org/ns/docbook">
+	<name>dr_gateways</name>
+	<version>1</version>
+	<type db="mysql">&MYSQL_TABLE_TYPE;</type>
+	<description>
+		<db:para>This table is used by the douting module - keeps the
+			gateways data.
+		</db:para>
+	</description>
+
+	<column id="gwid">
+		<name>gwid</name>
+		<type>unsigned int</type>
+		<size>&table_id_len;</size>
+		<autoincrement/>
+		<primary/>
+		<type db="dbtext">int,auto</type>
+		<description>Unique ID per gateway
+		</description>
+	</column>
+
+	<column id="type">
+		<name>type</name>
+		<type>unsigned int</type>
+		<size>11</size>
+		<default>0</default>
+		<description>Type of gateway</description>
+	</column>
+
+	<column id="address">
+		<name>address</name>
+		<type>string</type>
+		<size>128</size>
+		<description>Address of gateway (hostname or ip and port)</description>
+	</column>
+
+	<column id="strip">
+		<name>strip</name>
+		<type>unsigned int</type>
+		<size>11</size>
+		<default>0</default>
+		<description>Number of digits to strip from dialed number</description>
+	</column>
+
+	<column id="pri_prefix">
+		<name>pri_prefix</name>
+		<type>string</type>
+		<size>64</size>
+		<null/>
+		<default><null/></default>
+		<description>What to prefix to dialed number</description>
+	</column>
+
+	<column id="description">
+		<name>description</name>
+		<type>string</type>
+		<size>128</size>
+		<default></default>
+		<description>Short description of gateway</description>
+	</column>
+</table>
+

+ 86 - 0
lib/srdb1/schema/dr_rules.xml

@@ -0,0 +1,86 @@
+<?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="dr_rules" xmlns:db="http://docbook.org/ns/docbook">
+	<name>dr_rules</name>
+	<version>1</version>
+	<type db="mysql">&MYSQL_TABLE_TYPE;</type>
+	<description>
+		<db:para>This table is used by the drouting module - keeps the
+			routing rules data.
+		</db:para>
+	</description>
+
+	<column id="ruleid">
+		<name>ruleid</name>
+		<type>unsigned int</type>
+		<size>&table_id_len;</size>
+		<autoincrement/>
+		<primary/>
+		<type db="dbtext">int,auto</type>
+		<description>Rule unique ID
+		</description>
+	</column>
+
+	<column id="groupid">
+		<name>groupid</name>
+		<type>string</type>
+		<size>255</size>
+		<description>list of routing group IDs
+		</description>
+	</column>
+
+	<column id="prefix">
+		<name>prefix</name>
+		<type>string</type>
+		<size>64</size>
+		<description>Destination prefix for this rule</description>
+	</column>
+
+	<column id="timerec">
+		<name>timerec</name>
+		<type>string</type>
+		<size>255</size>
+		<description>Time recurrence for this rule.</description>
+	</column>
+
+	<column id="priority">
+		<name>priority</name>
+		<type>int</type>
+		<size>11</size>
+		<default>0</default>
+		<description>Priority of the rule.</description>
+	</column>
+
+	<column id="routeid">
+		<name>routeid</name>
+		<type>string</type>
+		<size>64</size>
+		<description>Name of route block (from cfg script) to be
+			executed when matching this rule.</description>
+	</column>
+
+	<column id="gwlist">
+		<name>gwlist</name>
+		<type>string</type>
+		<size>255</size>
+		<description>The list of destinations (gws) to be used when
+		matching this rule.</description>
+	</column>
+
+	<column id="description">
+		<name>description</name>
+		<type>string</type>
+		<size>128</size>
+		<default></default>
+		<description>Short description of the rule</description>
+	</column>
+
+</table>
+

+ 14 - 0
lib/srdb1/schema/kamailio-drouting.xml

@@ -0,0 +1,14 @@
+<?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>DRouting</name>
+    <xi:include href="dr_gateways.xml"/>
+    <xi:include href="dr_rules.xml"/>
+</database>