[sr-dev] git:master: lib/srdb1/schema: replaced lcr schema files

Juha Heinanen jh at tutpro.com
Thu Jun 10 13:09:58 CEST 2010


Module: sip-router
Branch: master
Commit: eabca5c0e74a0c2707bba439815c9ebd9670b0d4
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=eabca5c0e74a0c2707bba439815c9ebd9670b0d4

Author: Juha Heinanen <jh at tutpro.com>
Committer: Juha Heinanen <jh at tutpro.com>
Date:   Thu Jun 10 13:32:35 2010 +0300

lib/srdb1/schema: replaced lcr schema files
- Replaced lcr and gw schema files with lcr_rule, lcr_rule_target and
  lcr_gw schema files.

---

 lib/srdb1/schema/{gw.xml => lcr_gw.xml}           |   41 ++++------------
 lib/srdb1/schema/{lcr.xml => lcr_rule.xml}        |   34 ++++++++------
 lib/srdb1/schema/{lcr.xml => lcr_rule_target.xml} |   52 +++++++++++----------
 3 files changed, 58 insertions(+), 69 deletions(-)

diff --git a/lib/srdb1/schema/gw.xml b/lib/srdb1/schema/lcr_gw.xml
similarity index 75%
rename from lib/srdb1/schema/gw.xml
rename to lib/srdb1/schema/lcr_gw.xml
index 3d92ae8..5f0f4e2 100644
--- a/lib/srdb1/schema/gw.xml
+++ b/lib/srdb1/schema/lcr_gw.xml
@@ -8,12 +8,13 @@
 ]>
 
 
-<table id="gw" xmlns:db="http://docbook.org/ns/docbook">
-    <name>gw</name>
-    <version>11</version>
+<table id="lcr_gw" xmlns:db="http://docbook.org/ns/docbook">
+    <name>lcr_gw</name>
+    <version>1</version>
     <type db="mysql">&MYSQL_TABLE_TYPE;</type>
     <description>
-        <db:para>This table contains Least Cost Routing Gateway definitions for the LCR module.
+        <db:para>This table is used by lcr (Least Cost Routing) module
+	         to store gateway attributes.
                  More information can be found at: &KAMAILIO_MOD_DOC;lcr.html.
         </db:para>
     </description>
@@ -37,16 +38,11 @@
         <name>gw_name</name>
         <type>string</type>
         <size>128</size>
-        <description>Name of the gateway</description>
+        <null/>
+        <description>Name of the gateway (for documentation only)</description>
         <natural/>
     </column>
 
-    <column id="grp_id">
-        <name>grp_id</name>
-        <type>unsigned int</type>
-        <description>ID of gateway's group</description>
-    </column>
-
     <column id="ip_addr">
         <name>ip_addr</name>
         <type>string</type>
@@ -89,7 +85,7 @@
         <name>transport</name>
         <type>unsigned char</type>
         <null/>
-        <description>Transport type to be used for the gateway</description>
+        <description>Transport protocol to be used for the gateway</description>
     </column>
 
     <column id="strip">
@@ -108,13 +104,6 @@
         <description>Request URI user part tag</description>
     </column>
 
-    <column id="weight">
-        <name>weight</name>
-        <type>unsigned int</type>
-        <null/>
-        <description>Weight of gateway within gw_grp.  Valid values are 1-254.</description>
-    </column>
-
     <column id="flags">
         <name>flags</name>
         <type>unsigned int</type>
@@ -127,22 +116,14 @@
         <type>unsigned int</type>
         <null/>
         <default><null/></default>
-        <description>If not null, contains unix timestamp telling when gw becomes operational.</description>
+        <description>If not null, contains unix timestamp telling when gw becomes operational</description>
     </column>
 
     <index>
-        <name>lcr_id_grp_id_gw_name_idx</name>
-        <colref linkend="lcr_id"/>
-        <colref linkend="grp_id"/>
-        <colref linkend="gw_name"/>
-        <unique/>
-    </index>
-
-    <index>
-        <name>lcr_id_grp_id_ip_addr_hostname_idx</name>
+        <name>lcr_id_ip_addr_port_hostname_idx</name>
         <colref linkend="lcr_id"/>
-        <colref linkend="grp_id"/>
         <colref linkend="ip_addr"/>
+        <colref linkend="port"/>
         <colref linkend="hostname"/>
         <unique/>
     </index>
diff --git a/lib/srdb1/schema/lcr.xml b/lib/srdb1/schema/lcr_rule.xml
similarity index 66%
copy from lib/srdb1/schema/lcr.xml
copy to lib/srdb1/schema/lcr_rule.xml
index a2f055c..6ffc6db 100644
--- a/lib/srdb1/schema/lcr.xml
+++ b/lib/srdb1/schema/lcr_rule.xml
@@ -7,12 +7,13 @@
 
 ]>
 
-<table id="lcr" xmlns:db="http://docbook.org/ns/docbook">
-    <name>lcr</name>
-    <version>3</version>
+<table id="lcr_rule" xmlns:db="http://docbook.org/ns/docbook">
+    <name>lcr_rule</name>
+    <version>1</version>
     <type db="mysql">&MYSQL_TABLE_TYPE;</type>
     <description>
-        <db:para>This table is used by the lcr (Least Cost Routing) rules.
+        <db:para>This table is used by the lcr (Least Cost Routing)
+	    module to store routing rules.
             More information can be found at: &KAMAILIO_MOD_DOC;lcr.html.
         </db:para>
     </description>
@@ -36,7 +37,7 @@
         <name>prefix</name>
         <type>string</type>
         <size>16</size>
-		<null/>
+	<null/>
         <default><null/></default>
         <description>Prefix of Request URI user part</description>
         <natural/>
@@ -48,24 +49,29 @@
         <size>&domain_len;</size>
         <null/>
         <default><null/></default>
-        <description>Pattern that is matched to caller's URI</description>
+        <description>PCRE regular expression that is matched to caller's URI</description>
     </column>
 
-    <column id="grp_id">
-        <name>grp_id</name>
+    <column id="stopper">
+        <name>stopper</name>
         <type>unsigned int</type>
-        <description>Group ID</description>
+        <default>0</default>
+        <description>Tells if rule is "stopper" rule</description>
     </column>
 
-    <column>
-        <name>priority</name>
-        <type>unsigned char</type>
-        <description>Priority</description>
+    <column id="enabled">
+        <name>enabled</name>
+        <type>unsigned int</type>
+        <default>1</default>
+        <description>Tells if rule is enabled</description>
     </column>
 
     <index>
-        <name>lcr_id_idx</name>
+        <name>lcr_id_prefix_from_uri_idx</name>
         <colref linkend="lcr_id"/>
+        <colref linkend="prefix"/>
+        <colref linkend="from_uri"/>
+	<unique/>
     </index>
 
 </table>
diff --git a/lib/srdb1/schema/lcr.xml b/lib/srdb1/schema/lcr_rule_target.xml
similarity index 57%
rename from lib/srdb1/schema/lcr.xml
rename to lib/srdb1/schema/lcr_rule_target.xml
index a2f055c..6cfcf41 100644
--- a/lib/srdb1/schema/lcr.xml
+++ b/lib/srdb1/schema/lcr_rule_target.xml
@@ -7,12 +7,13 @@
 
 ]>
 
-<table id="lcr" xmlns:db="http://docbook.org/ns/docbook">
-    <name>lcr</name>
-    <version>3</version>
+<table id="lcr_rule_target" xmlns:db="http://docbook.org/ns/docbook">
+    <name>lcr_rule_target</name>
+    <version>1</version>
     <type db="mysql">&MYSQL_TABLE_TYPE;</type>
     <description>
-        <db:para>This table is used by the lcr (Least Cost Routing) rules.
+        <db:para>This table is used by the lcr (Least Cost Routing)
+	    module to store routing rule targets.
             More information can be found at: &KAMAILIO_MOD_DOC;lcr.html.
         </db:para>
     </description>
@@ -32,37 +33,38 @@
         <description>LCR instance identifier</description>
     </column>
 
-    <column id="prefix">
-        <name>prefix</name>
-        <type>string</type>
-        <size>16</size>
-		<null/>
-        <default><null/></default>
-        <description>Prefix of Request URI user part</description>
-        <natural/>
-    </column>
-
-    <column id="from_uri">
-        <name>from_uri</name>
-        <type>string</type>
-        <size>&domain_len;</size>
-        <null/>
-        <default><null/></default>
-        <description>Pattern that is matched to caller's URI</description>
+    <column id="rule_id">
+        <name>rule_id</name>
+        <type>unsigned int</type>
+        <description>Identifies a rule in lcr_rule table</description>
     </column>
 
-    <column id="grp_id">
-        <name>grp_id</name>
+    <column id="gw_id">
+        <name>gw_id</name>
         <type>unsigned int</type>
-        <description>Group ID</description>
+        <description>Identifies a gateway in lcr_gw table</description>
     </column>
 
     <column>
         <name>priority</name>
         <type>unsigned char</type>
-        <description>Priority</description>
+        <description>Priority of this target (0-255)</description>
     </column>
 
+    <column id="weight">
+        <name>weight</name>
+        <type>unsigned int</type>
+        <default>1</default>
+        <description>Weight of this target (1-254)</description>
+    </column>
+
+    <index>
+        <name>rule_id_gw_id_idx</name>
+        <colref linkend="rule_id"/>
+        <colref linkend="gw_id"/>
+	<unique/>
+    </index>
+
     <index>
         <name>lcr_id_idx</name>
         <colref linkend="lcr_id"/>




More information about the sr-dev mailing list