瀏覽代碼

- new module: Resource List Server (implements the specifications in RFC 4662 and RFC 4826)
- requires 2 new databse tables - rls_presentity and rls_watchers
- works independent from presence server
- testing required


git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@2739 689a6050-402a-0410-94f2-e92a70836424

Anca Vamanu 18 年之前
父節點
當前提交
962bcbcdc8

+ 1 - 1
lib/srdb1/schema/Makefile

@@ -5,7 +5,7 @@
 # OpenSER database descriptions for modules
 TABLES = standard acc imc lcr siptrace domainpolicy cpl domain group \
 	dialog permissions registrar usrloc msilo alias_db uri_db speeddial \
-	avpops auth_db pdt dispatcher presence serweb extensions carrierroute
+	avpops auth_db pdt dispatcher presence rls serweb extensions carrierroute
 
 ROOT=../..
 STYLESHEETS=$(ROOT)/doc/dbschema/xsl

+ 15 - 0
lib/srdb1/schema/openser-rls.xml

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

+ 8 - 15
lib/srdb1/schema/pr_active_watchers.xml

@@ -62,7 +62,7 @@
         <description>From Domain</description>
     </column>
 
-    <column id="event">
+    <column>
         <name>event</name>
         <type>string</type>
         <size>&user_len;</size>
@@ -85,14 +85,14 @@
         <description>TO tag</description>
     </column>
 
-    <column>
+    <column id="from_tag">
         <name>from_tag</name>
         <type>string</type>
         <size>&domain_len;</size>
         <description>From tag</description>
     </column>
 
-    <column>
+    <column id="callid">
         <name>callid</name>
         <type>string</type>
         <size>&domain_len;</size>
@@ -127,7 +127,7 @@
         <description>Record route</description>
     </column>
 
-    <column id="expires">
+    <column>
         <name>expires</name>
         <type>int</type>
         <size>&expires_len;</size>
@@ -172,19 +172,12 @@
     </column>
 
     <index>
-        <name>tt_watchers</name>
+        <name>pctt_watchers</name>
+        <colref linkend="pres_uri"/>
+        <colref linkend="callid"/>
         <colref linkend="to_tag"/>
+        <colref linkend="from_tag"/>
         <unique/>
     </index>
 
-    <index>
-        <name>ue_active_watchers</name>
-        <colref linkend="pres_uri"/>
-        <colref linkend="event"/>
-	</index>
-	
-	<index>
-        <name>exp_active_watchers</name>
-        <colref linkend="expires"/>
-	</index>
 </table>

+ 98 - 0
lib/srdb1/schema/rls_presentity.xml

@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE table PUBLIC "-//openser.org//DTD DBSchema V1.0//EN" 
+  "http://openser.org/pub/openser/dbschema/dtd/1.0/dbschema.dtd" [
+
+<!ENTITY % entities SYSTEM "entities.xml">
+%entities;
+
+]>
+
+<table id="rls_presentity" xmlns:db="http://docbook.org/ns/docbook">
+    <name>rls_presentity</name>
+    <version>0</version>
+    <type db="mysql">&MYSQL_TABLE_TYPE;</type>
+    <description>
+		<db:para>Table for the RLS module.
+		</db:para>
+    </description>
+
+    <column id="id">
+        <name>id</name>
+        <type>unsigned int</type>
+        <size>&table_id_len;</size>
+        <autoincrement/>
+        <primary/>
+        <type db="postgres">SERIAL PRIMARY KEY</type>
+        <type db="dbtext">int,auto</type>
+        <description>Unique ID</description>
+    </column>
+
+    <column id="rlsubs_did">
+        <name>rlsubs_did</name>
+        <type>string</type>
+        <size>512</size>
+        <description>Resource list subscribe dialog id</description>
+    </column>
+
+    <column id="resource_uri">
+        <name>resource_uri</name>
+        <type>string</type>
+        <size>&uri_len;</size>
+        <description>List Uri</description>
+    </column>
+
+    <column>
+		<name>content_type</name>
+        <type>string</type>
+        <size>&domain_len;</size>
+        <description>Event</description>
+    </column>
+
+    <column>
+        <name>presence_state</name>
+        <type>binary</type>
+    </column>
+
+    <column id="expires">
+        <name>expires</name>
+        <type>int</type>
+        <size>&expires_len;</size>
+        <description>Expires</description>
+    </column>
+	
+	<column id="updated">
+        <name>updated</name>
+        <type>int</type>
+        <size>&expires_len;</size>
+        <description>Update flag</description>
+    </column>
+
+    <column>
+        <name>auth_state</name>
+        <type>int</type>
+        <size>&expires_len;</size>
+        <description>Watcher authorization state</description>
+    </column>
+   
+	<column>
+        <name>reason</name>
+        <type>string</type>
+        <size>&user_len;</size>
+		<description>reason for watcher authorization state</description>
+    </column>
+
+
+    <index>
+        <name>udid_rlspres</name>
+        <colref linkend="rlsubs_did"/>
+        <colref linkend="resource_uri"/>
+        <unique/>
+	</index>
+	
+	<index>
+        <name>u_rlspres</name>
+        <colref linkend="updated"/>
+        <unique/>
+	</index>
+
+</table>

+ 184 - 0
lib/srdb1/schema/rls_watchers.xml

@@ -0,0 +1,184 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE table PUBLIC "-//openser.org//DTD DBSchema V1.0//EN" 
+  "http://openser.org/pub/openser/dbschema/dtd/1.0/dbschema.dtd" [
+
+<!ENTITY % entities SYSTEM "entities.xml">
+%entities;
+
+]>
+
+<table id="rls_watchers" xmlns:db="http://docbook.org/ns/docbook">
+    <name>rls_watchers</name>
+    <version>0</version>
+    <type db="mysql">&MYSQL_TABLE_TYPE;</type>
+    <description>
+		<db:para>Table for RLS module used for storing resource lists subscribe
+			information.
+        </db:para>
+    </description>
+
+    <column id="id">
+        <name>id</name>
+        <type>unsigned int</type>
+        <size>&table_id_len;</size>
+        <autoincrement/>
+        <primary/>
+        <type db="postgres">SERIAL PRIMARY KEY</type>
+        <type db="dbtext">int,auto</type>
+        <description>Unique ID</description>
+    </column>
+
+    <column id="pres_uri">
+        <name>pres_uri</name>
+        <type>string</type>
+        <size>&uri_len;</size>
+        <description>Presence URI</description>
+    </column>
+
+    <column>
+        <name>to_user</name>
+        <type>string</type>
+        <size>&user_len;</size>
+        <description>To User</description>
+    </column>
+
+    <column>
+        <name>to_domain</name>
+        <type>string</type>
+        <size>&domain_len;</size>
+        <description>To Domain</description>
+    </column>
+
+    <column>
+        <name>from_user</name>
+        <type>string</type>
+        <size>&user_len;</size>
+        <description>From User</description>
+    </column>
+
+    <column>
+        <name>from_domain</name>
+        <type>string</type>
+        <size>&domain_len;</size>
+        <description>From Domain</description>
+    </column>
+
+    <column>
+        <name>event</name>
+        <type>string</type>
+        <size>&user_len;</size>
+        <default>presence</default>
+        <description>Event description</description>
+    </column>
+
+    <column>
+        <name>event_id</name>
+        <type>string</type>
+        <size>&user_len;</size>
+        <null/>
+        <description>Event ID</description>
+    </column>
+
+    <column id="to_tag">
+        <name>to_tag</name>
+        <type>string</type>
+        <size>&domain_len;</size>
+        <description>To tag</description>
+    </column>
+
+    <column id="from_tag">
+        <name>from_tag</name>
+        <type>string</type>
+        <size>&domain_len;</size>
+        <description>From tag</description>
+    </column>
+
+    <column id="callid">
+        <name>callid</name>
+        <type>string</type>
+        <size>&domain_len;</size>
+        <description>Call ID</description>
+    </column>
+
+    <column>
+        <name>local_cseq</name>
+        <type>int</type>
+        <size>&cseq_len;</size>
+        <description>Local cseq</description>
+    </column>
+
+    <column>
+        <name>remote_cseq</name>
+        <type>int</type>
+        <size>&cseq_len;</size>
+        <description>Remote cseq</description>
+    </column>
+
+    <column>
+        <name>contact</name>
+        <type>string</type>
+        <size>&domain_len;</size>
+        <description>Contact</description>
+    </column>
+
+    <column>
+        <name>record_route</name>
+        <type>text</type>
+        <null/>
+        <description>Record route</description>
+    </column>
+
+    <column>
+        <name>expires</name>
+        <type>int</type>
+        <size>&expires_len;</size>
+        <description>Expires</description>
+    </column>
+
+    <column>
+        <name>status</name>
+		<type>int</type>
+        <size>11</size>
+        <default>2</default>
+        <description>Status</description>
+    </column>
+	
+	<column>
+        <name>reason</name>
+        <type>string</type>
+        <size>&user_len;</size>
+        <description>Reason</description>
+    </column>
+
+    <column>
+        <name>version</name>
+        <type>int</type>
+        <size>11</size>
+        <default>0</default>
+        <description>Version</description>
+    </column>
+
+    <column>
+        <name>socket_info</name>
+        <type>string</type>
+        <size>&domain_len;</size>
+        <description>Socket info</description>
+    </column>
+
+    <column>
+        <name>local_contact</name>
+        <type>string</type>
+        <size>&uri_len;</size>
+        <description>Local contact</description>
+    </column>
+	
+	<index>
+        <name>pctt_rlwatchers</name>
+        <colref linkend="pres_uri"/>
+        <colref linkend="callid"/>
+        <colref linkend="to_tag"/>
+        <colref linkend="from_tag"/>
+        <unique/>
+    </index>
+
+</table>